vendor: 5,165 bytes, line 1
1import{a as $n}from"./chunk-B32QALXD.js";import{b as hi}from"./chunk-6NI5EEOJ.js";import{a as Fn,b as Vn,c as zn,d as ce,e as Hn,f as Un}from"./chunk-UT4MXYWN.js";import{b as bn}from"./chunk-LY7BLC2N.js";import{a as Dn,b as Rn}from"./chunk-4MRB7X6Y.js";import{c as Hr,d as Ft,e as On}from"./chunk-AQ26TZIU.js";import"./chunk-TD72XOMM.js";import"./chunk-ULH3CVOK.js";import{a as vn,b as kn,c as Je}from"./chunk-ZJQGE4TN.js";import{a as Nn,b as qn}from"./chunk-P3VA4DGW.js";import{a as oi,b as ai,c as mi,d as di}from"./chunk-JOTPU3KO.js";import{a as li,b as pi}from"./chunk-2H4S4N3R.js";import{v as Ln,w as si,x as In,y as ci}from"./chunk-FBPTJYVW.js";import"./chunk-MW4XNDYZ.js";import"./chunk-JNDXSFPG.js";import{a as Tn}from"./chunk-MHNKS4ZX.js";import{b as wn}from"./chunk-RIK4RH5M.js";import{a as et}from"./chunk-DRRJD65U.js";import{a as Qn}from"./chunk-S5RF3Z3A.js";import{a as Sn,b as Xe}from"./chunk-6AFG5WRS.js";import"./chunk-WKKASWNC.js";import"./chunk-HAJNCCJF.js";import"./chunk-C4PSTJLR.js";import{a as ti,b as ei,c as Ee}from"./chunk-WU6ZD43X.js";import{a as yn,b as Ye}from"./chunk-HKY6FACR.js";import{a as re}from"./chunk-HCIBNUPL.js";import{a as ii}from"./chunk-SLN4E5FB.js";import{a as V,b as Oe,c as Ti,d as kt,e as De,f as Mn,g as oe,h as An,j as St,k as Pn,l as En,n as bt,o as $}from"./chunk-FRWJJGQD.js";import"./chunk-AOESBAGS.js";import"./chunk-GF2IO6C6.js";import"./chunk-SWUOSIC5.js";import"./chunk-P7YSOWHR.js";import{a as ae,c as ni,d as ri,f as se,g as Vt}from"./chunk-WG7KUOJM.js";import{a as Bt}from"./chunk-FYBVQUMJ.js";import"./chunk-OA6RSADH.js";import"./chunk-NOPRY6BJ.js";import"./chunk-RKOD6SQC.js";import"./chunk-54CULWJ7.js";import"./chunk-Q4HNVMGF.js";import"./chunk-3HWY6SEC.js";import{a as Ke}from"./chunk-GUJJAVK4.js";import{b as ln,c as Ut,e as pn,j as ee,l as Qt,m as dt}from"./chunk-JHEK5B3H.js";import{a as Nt}from"./chunk-PTFVZH2M.js";import"./chunk-T5ABL6GV.js";import{c as At,d as B,e as ie,g as O,i as tt,k as vt}from"./chunk-OEW6BOWJ.js";import{a as cn,c as K,d as X}from"./chunk-FNG56J7K.js";import{a as Ze,b as ne}from"./chunk-I3CZMKWO.js";import{a as qt,b as xt}from"./chunk-254WTS54.js";import{a as yt}from"./chunk-3KC2QHRH.js";import{A as Cn,D as mt,E as xn,b as We,c as Ge,f as Lt,g as mn,i as dn,l as It,m as hn,t as un,u as gn,v as fn,z as _n}from"./chunk-7QU4DVBB.js";import{a as I}from"./chunk-FR5BZMYJ.js";import"./chunk-DHQFFTLW.js";import{c as je,g as an,h as sn,i as te}from"./chunk-LVJRXQ3Y.js";import{n as on}from"./chunk-HIPDSQEU.js";import{B as Ct,a as rn,l as Rt,q as Ue,r as Mt,y as Be}from"./chunk-VPP56BL3.js";import{Ab as Ae,Bb as ki,Cb as tn,Db as L,E as Se,Ea as C,Eb as d,F as T,Fb as q,G as Gi,Gb as M,H as x,Hb as Yt,Jb as ze,Kb as Pe,L as Fe,Lb as $e,Ma as Yi,Mb as Jt,Nb as en,Ob as Si,Pb as Xt,Qb as J,Rb as ut,Sb as He,Ta as Ji,Tb as nn,U as Zi,Va as Q,Wa as h,Xa as we,Xb as bi,Ya as rt,Yb as wi,bb as _,bc as Z,c as Qe,cb as Ve,db as Xi,eb as ot,fa as H,fb as at,ga as be,gb as a,hb as l,i as g,ib as y,la as Ki,lb as U,ma as s,mb as A,pb as v,pc as pt,qb as m,qc as f,rc as E,s as k,t as S,u as F,v as ht,va as yi,wa as vi,yb as Te,za as N,zb as Me}from"./chunk-MSDPDPRL.js";import{E as ye,J as Zt,N as _t,S as Dt,ba as ve,ca as ke,da as Kt,fa as Ie,g as xe,i as ji,m as Wi,r as G,w as Ht,y as lt}from"./chunk-4I6C6WA7.js";import{a as z,b as W,c as Bi,f as $r,h as w}from"./chunk-SDIY36DU.js";var Pr=$r(Hr());var Pt={square:{id:"square",dimensions:{width:1080,height:1080},marketSnapshot:{width:700},marketAction:{width:420},aspectRatio:"1:1"},landscape:{id:"landscape",dimensions:{width:1080,height:1350},marketSnapshot:{width:750},marketAction:{width:750},aspectRatio:"4:5"},portrait:{id:"portrait",dimensions:{width:1080,height:1920},marketSnapshot:{width:600},marketAction:{width:336},aspectRatio:"9:16"}};function Bn(e,r){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;let t=document.implementation.createHTMLDocument(),i=t.createElement("base"),n=t.createElement("a");return t.head.appendChild(i),t.body.appendChild(n),r&&(i.href=r),n.href=e,n.href}var jn=(()=>{let e=0,r=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${r()}${e}`)})();function gt(e){let r=[];for(let t=0,i=e.length;t<i;t++)r.push(e[t]);return r}var le=null;function gi(e={}){return le||(e.includeStyleProperties?(le=e.includeStyleProperties,le):(le=gt(window.getComputedStyle(document.documentElement)),le))}function ui(e,r){let i=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(r);return i?parseFloat(i.replace("px","")):0}function Ur(e){let r=ui(e,"border-left-width"),t=ui(e,"border-right-width");return e.clientWidth+r+t}function Br(e){let r=ui(e,"border-top-width"),t=ui(e,"border-bottom-width");return e.clientHeight+r+t}function Mi(e,r={}){let t=r.width||Ur(e),i=r.height||Br(e);return{width:t,height:i}}function Wn(){let e,r;try{r=process}catch{}let t=r&&r.env?r.env.devicePixelRatio:null;return t&&(e=parseInt(t,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}var st=16384;function Gn(e){(e.width>st||e.height>st)&&(e.width>st&&e.height>st?e.width>
1e.height?(e.height*=st/e.width,e.width=st):(e.width*=st/e.height,e.height=st):e.width>st?(e.height*=st/e.width,e.width=st):(e.width*=st/e.height,e.height=st))}function pe(e){return new Promise((r,t)=>{let i=new Image;i.onload=()=>{i.decode().then(()=>{requestAnimationFrame(()=>r(i))})},i.onerror=t,i.crossOrigin="anonymous",i.decoding="async",i.src=e})}function jr(e){return w(this,null,function*(){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(r=>`data:image/svg+xml;charset=utf-8,${r}`)})}function Zn(e,r,t){return w(this,null,function*(){let i="http://www.w3.org/2000/svg",n=document.createElementNS(i,"svg"),o=document.createElementNS(i,"foreignObject");return n.setAttribute("width",`${r}`),n.setAttribute("height",`${t}`),n.setAttribute("viewBox",`0 0 ${r} ${t}`),o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),n.appendChild(o),o.appendChild(e),jr(n)})}var Y=(e,r)=>{if(e instanceof r)return!0;let t=Object.getPrototypeOf(e);return t===null?!1:t.constructor.name===r.name||Y(t,r)};function Wr(e){let r=e.getPropertyValue("content");return`${e.cssText} content: '${r.replace(/'|"/g,"")}';`}function Gr(e,r){return gi(r).map(t=>{let i=e.getPropertyValue(t),n=e.getPropertyPriority(t);return`${t}: ${i}${n?" !important":""};`}).join(" ")}function Zr(e,r,t,i){let n=`.${e}:${r}`,o=t.cssText?Wr(t):Gr(t,i);return document.createTextNode(`${n}{${o}}`)}function Kn(e,r,t,i){let n=window.getComputedStyle(e,t),o=n.getPropertyValue("content");if(o===""||o==="none")return;let c=jn();try{r.className=`${r.className} ${c}`}catch{return}let p=document.createElement("style");p.appendChild(Zr(c,t,n,i)),r.appendChild(p)}function Yn(e,r,t){Kn(e,r,":before",t),Kn(e,r,":after",t)}var Jn="application/font-woff",Xn="image/jpeg",Kr={woff:Jn,woff2:Jn,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Xn,jpeg:Xn,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function Yr(e){let r=/\.([^./]*?)$/g.exec(e);return r?r[1]:""}function me(e){let r=Yr(e).toLowerCase();return Kr[r]||""}function Jr(e){return e.split(/,/)[1]}function Re(e){return e.search(/^(data:)/)!==-1}function Pi(e,r){return`data:${r};base64,${e}`}function Ei(e,r,t){return w(this,null,function*(){let i=yield fetch(e,r);if(i.status===404)throw new Error(`Resource "${i.url}" not found`);let n=yield i.blob();return new Promise((o,c)=>{let p=new FileReader;p.onerror=c,p.onloadend=()=>{try{o(t({res:i,result:p.result}))}catch(u){c(u)}},p.readAsDataURL(n)})})}var Ai={};function Xr(e,r,t){let i=e.replace(/\?.*/,"");return t&&(i=e),/ttf|otf|eot|woff2?/i.test(i)&&(i=i.replace(/.*\//,"")),r?`[${r}]${i}`:i}function de(e,r,t){return w(this,null,function*(){let i=Xr(e,r,t.includeQueryParams);if(Ai[i]!=null)return Ai[i];t.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let n;try{let o=yield Ei(e,t.fetchRequestInit,({res:c,result:p})=>(r||(r=c.headers.get("Content-Type")||""),Jr(p)));n=Pi(o,r)}catch(o){n=t.imagePlaceholder||"";let c=`Failed to fetch resource: ${e}`;o&&(c=typeof o=="string"?o:o.message),c&&console.warn(c)}return Ai[i]=n,n})}function to(e){return w(this,null,function*(){let r=e.toDataURL();return r==="data:,"?e.cloneNode(!1):pe(r)})}function eo(e,r){return w(this,null,function*(){if(e.currentSrc){let o=document.createElement("canvas"),c=o.getContext("2d");o.width=e.clientWidth,o.height=e.clientHeight,c?.drawImage(e,0,0,o.width,o.height);let p=o.toDataURL();return pe(p)}let t=e.poster,i=me(t),n=yield de(t,i,r);return pe(n)})}function io(e,r){return w(this,null,function*(){var t;try{if(!((t=e?.contentDocument)===null||t===void 0)&&t.body)return yield Ne(e.contentDocument.body,r,!0)}catch{}return e.cloneNode(!1)})}function no(e,r){return w(this,null,function*(){return Y(e,HTMLCanvasElement)?to(e):Y(e,HTMLVideoElement)?eo(e,r):Y(e,HTMLIFrameElement)?io(e,r):e.cloneNode(tr(e))})}var ro=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",tr=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";function oo(e,r,t){return w(this,null,function*(){var i,n;if(tr(r))return r;let o=[];return ro(e)&&e.assignedNodes?o=gt(e.assignedNodes()):Y(e,HTMLIFrameElement)&&(!((i=e.contentDocument)===null||i===void 0)&&i.body)?o=gt(e.contentDocument.body.childNodes):o=gt(((n=e.shadowRoot)!==null&&n!==void 0?n:e).childNodes),o.length===0||Y(e,HTMLVideoElement)||(yield o.reduce((c,p)=>c.then(()=>Ne(p,t)).then(u=>{u&&r.appendChild(u)}),Promise.resolve())),r})}function ao(e,r,t){let i=r.style;if(!i)return;let n=window.getComputedStyle(e);n.cssText?(i.cssText=n.cssText,i.transformOrigin=n.transformOrigin):gi(t).forEach(o=>{let c=n.getPropertyValue(o);o==="font-size"&&c.endsWith("px")&&(c=`${Math.floor(parseFloat(c.substring(0,c.length-2)))-.1}px`),Y(e,HTMLIFrameElement)&&o==="display"&&c==="inline"&&(c="block"),o==="d"&&r.getAttribute("d")&&(c=`path(${r.getAttribute("d")})`),i.setProperty(o,c,n.getPropertyPriority(o))})}function so(e,r){Y(e,HTMLTextAreaElement)&&(r.innerHTML=e.value),Y(e,HTMLInputElement)&&r.setAttribute("value",e.value)}function co(e,r){if(Y(e,HTMLSelectElement)){let t=r,i=Array.from(t.children).find(n=>e.value===n.getAttribute("value"));i&&i.setAttribute("selected","")}}function lo(e,r,t){return Y(r,Element)&&(ao(e,r,t),Yn(e,r,t),so(e,r),co(e,r)),r}function po(e,r){return w(this,null,function*(){let t=e.querySelectorAll?e.querySelectorAll("use"):[];if(t.length===0)return e;let i={};for(let o=0;o<t.length;o++){let p=t[o].getAttribute("xlink:href");if(p){let u=e.querySelector(p),b=document.querySelector(p);!u&&b&&!i[p]&&(i[p]=yield Ne(b,r,!0))}}let n=Object.values(i);if(n.length){let o="http://www.w3.org/1999/xhtml",c=document.createElementNS(o,"svg");c.setAttribute("xmlns",o),c.style.position="absolute",c.style.width="0",c.style.height="0",c.style.overflow="hidden",c.style.display="none";let p=document.createElementNS(o,"defs");c.appendChild(p);for(let u=0;u<n.length;u++)p.appendChild(n[u]);e.appendChild(c)}return e})}function Ne(e,r,t){return w(this,null,function*(){return!t&&r.filter&&!r.filter(e)?null:Promise.resolve(e).then(i=>no(i,r)).then(i=>oo(e,i,r)).then(i=>lo(e,i,r)).then(i=>po(i,r))})}var er=/url\((['"]?)([^'"]+?)\1\)/g,mo=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ho=/src:\s
1*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function uo(e){let r=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${r})(['"]?\\))`,"g")}function go(e){let r=[];return e.replace(er,(t,i,n)=>(r.push(n),t)),r.filter(t=>!Re(t))}function fo(e,r,t,i,n){return w(this,null,function*(){try{let o=t?Bn(r,t):r,c=me(r),p;if(n){let u=yield n(o);p=Pi(u,c)}else p=yield de(o,c,i);return e.replace(uo(r),`$1${p}$3`)}catch{}return e})}function _o(e,{preferredFontFormat:r}){return r?e.replace(ho,t=>{for(;;){let[i,,n]=mo.exec(t)||[];if(!n)return"";if(n===r)return`src: ${i};`}}):e}function Oi(e){return e.search(er)!==-1}function fi(e,r,t){return w(this,null,function*(){if(!Oi(e))return e;let i=_o(e,t);return go(i).reduce((o,c)=>o.then(p=>fo(p,c,r,t)),Promise.resolve(i))})}function he(e,r,t){return w(this,null,function*(){var i;let n=(i=r.style)===null||i===void 0?void 0:i.getPropertyValue(e);if(n){let o=yield fi(n,null,t);return r.style.setProperty(e,o,r.style.getPropertyPriority(e)),!0}return!1})}function Co(e,r){return w(this,null,function*(){(yield he("background",e,r))||(yield he("background-image",e,r)),(yield he("mask",e,r))||(yield he("-webkit-mask",e,r))||(yield he("mask-image",e,r))||(yield he("-webkit-mask-image",e,r))})}function xo(e,r){return w(this,null,function*(){let t=Y(e,HTMLImageElement);if(!(t&&!Re(e.src))&&!(Y(e,SVGImageElement)&&!Re(e.href.baseVal)))return;let i=t?e.src:e.href.baseVal,n=yield de(i,me(i),r);yield new Promise((o,c)=>{e.onload=o,e.onerror=r.onImageErrorHandler?(...u)=>{try{o(r.onImageErrorHandler(...u))}catch(b){c(b)}}:c;let p=e;p.decode&&(p.decode=o),p.loading==="lazy"&&(p.loading="eager"),t?(e.srcset="",e.src=n):e.href.baseVal=n})})}function yo(e,r){return w(this,null,function*(){let i=gt(e.childNodes).map(n=>Di(n,r));yield Promise.all(i).then(()=>e)})}function Di(e,r){return w(this,null,function*(){Y(e,Element)&&(yield Co(e,r),yield xo(e,r),yield yo(e,r))})}function ir(e,r){let{style:t}=e;r.backgroundColor&&(t.backgroundColor=r.backgroundColor),r.width&&(t.width=`${r.width}px`),r.height&&(t.height=`${r.height}px`);let i=r.style;
1return i!=null&&Object.keys(i).forEach(n=>{t[n]=i[n]}),e}var nr={};function rr(e){return w(this,null,function*(){let r=nr[e];if(r!=null)return r;let i=yield(yield fetch(e)).text();return r={url:e,cssText:i},nr[e]=r,r})}function or(e,r){return w(this,null,function*(){let t=e.cssText,i=/url\(["']?([^"')]+)["']?\)/g,o=(t.match(/url\([^)]+\)/g)||[]).map(c=>w(null,null,function*(){let p=c.replace(i,"$1");return p.startsWith("https://")||(p=new URL(p,e.url).href),Ei(p,r.fetchRequestInit,({result:u})=>(t=t.replace(c,`url(${u})`),[c,u]))}));return Promise.all(o).then(()=>t)})}function ar(e){if(e==null)return[];let r=[],t=/(\/\*[\s\S]*?\*\/)/gi,i=e.replace(t,""),n=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){let u=n.exec(i);if(u===null)break;r.push(u[0])}i=i.replace(n,"");let o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,c="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",p=new RegExp(c,"gi");for(;;){let u=o.exec(i);if(u===null){if(u=p.exec(i),u===null)break;o.lastIndex=p.lastIndex}else p.lastIndex=o.lastIndex;r.push(u[0])}return r}function vo(e,r){return w(this,null,function*(){let t=[],i=[];return e.forEach(n=>{if("cssRules"in n)try{gt(n.cssRules||[]).forEach((o,c)=>{if(o.type===CSSRule.IMPORT_RULE){let p=c+1,u=o.href,b=rr(u).then(P=>or(P,r)).then(P=>ar(P).forEach(D=>{try{n.insertRule(D,D.startsWith("@import")?p+=1:n.cssRules.length)}catch(nt){console.error("Error inserting rule from remote css",{rule:D,error:nt})}})).catch(P=>{console.error("Error loading remote css",P.toString())});i.push(b)}})}catch(o){let c=e.find(p=>p.href==null)||document.styleSheets[0];n.href!=null&&i.push(rr(n.href).then(p=>or(p,r)).then(p=>ar(p).forEach(u=>{c.insertRule(u,c.cssRules.length)})).catch(p=>{console.error("Error loading remote stylesheet",p)})),console.error("Error inlining remote css file",o)}}),Promise.all(i).then(()=>(e.forEach(n=>{if("cssRules"in n)try{gt(n.cssRules||[]).forEach(o=>{t.push(o)})}catch(o){console.error(`Error while reading CSS rules from ${n.href}`,o)}}),t))})}function ko(e){return e.filter(r=>r.type===CSSRule.FONT_FACE_RULE).filter(r=>Oi(r.style.getPropertyValue("src")))}function So(e,r){return w(this,null,function*(){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");let t=gt(e.ownerDocument.styleSheets),i=yield vo(t,r);return ko(i)})}function sr(e){return e.trim().replace(/["']/g,"")}function bo(e){let r=new Set;function t(i){(i.style.fontFamily||getComputedStyle(i).fontFamily).split(",").forEach(o=>{r.add(sr(o))}),Array.from(i.children).forEach(o=>{o instanceof HTMLElement&&t(o)})}return t(e),r}function cr(e,r){return w(this,null,function*(){let t=yield So(e,r),i=bo(e);return(yield Promise.all(t.filter(o=>i.has(sr(o.style.fontFamily))).map(o=>{let c=o.parentStyleSheet?o.parentStyleSheet.href:null;return fi(o.cssText,c,r)}))).join(` 2`)})}function lr(e,r){return w(this,null,function*(){let t=r.fontEmbedCSS!=null?r.fontEmbedCSS:r.skipFonts?null:yield cr(e,r);if(t){let i=document.createElement("style"),n=document.createTextNode(t);i.appendChild(n),e.firstChild?e.insertBefore(i,e.firstChild):e.appendChild(i)}})}function Ri(t){return w(this,arguments,function*(e,r={}){let{width:i,height:n}=Mi(e,r),o=yield Ne(e,r,!0);return yield lr(o,r),yield Di(o,r),ir(o,r),yield Zn(o,i,n)})}function pr(t){return w(this,arguments,function*(e,r={}){let{width:i,height:n}=Mi(e,r),o=yield Ri(e,r),c=yield pe(o),p=document.createElement("canvas"),u=p.getContext("2d"),b=r.pixelRatio||Wn(),P=r.canvasWidth||i,D=r.canvasHeight||n;return p.width=P*b,p.height=D*b,r.skipAutoScale||Gn(p),p.style.width=`${P}`,p.style.height=`${D}`,r.backgroundColor&&(u.fillStyle=r.backgroundColor,u.fillRect(0,0,p.width,p.height)),u.drawImage(c,0,0,p.width,p.height),p})}function mr(t){return w(this,arguments,function*(e,r={}){return(yield pr(e,r)).toDataURL()})}function dr(t){return w(this,arguments,function*(e,r={}){return(yield pr(e,r)).toDataURL("image/jpeg",r.quality||1)})}var To=(e,r)=>r.id;function Mo(e,r){if(e&1){let t=A();a(0,"button",14),v("click",function(){let n=k(t).$implicit,o=m();return S(o.selectSize(n.id))}),d(1),l()}if(e&2){let t=r.$implicit,i=m();h("ngClass",i.selectedSizeId()!==t.id?"btn-purple-outline":"btn-purple"),s(),M(" ",t.label," ")}}function Ao(e,r){e&1&&d(0," Copied! ")}function Po(e,r){e&1&&d(0," Copy Embed Code ")}var hr=(()=>{class e{constructor(){this.sizeSelected$=Se(),this.copied$=Se(),this.defaultSize=T("medium"),this.src=T(""),this.chartAspectRatio=T(null),this.selectedSizeId=x("medium"),this.copied=x(!1),this.sizes=x([{id:"small",label:"Small",width:360,height:450},{id:"medium",label:"Medium",width:480,height:600},{id:"large",label:"Large",width:640,height:800},{id:"xl",label:"XL",width:800,height:1e3}]),this.selectedSize=f(()=>{let t=this.selectedSizeId(),i=this.sizes().find(o=>o.id===t)??this.sizes()[0],n=this.chartAspectRatio();return n&&n>0?W(z({},i),{height:Math.ceil(i.width/n)}):i}),this.sizeLabel=f(()=>{let t=this.selectedSize();return`${t.width} \xD7 ${t.height}px`}),this.embedSrc=f(()=>this.applySizeToSrc(this.src(),this.selectedSizeId())),this.embedCode=f(()=>{let t=this.selectedSize(),i=this.embedSrc().replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<"),n=this.chartAspectRatio()?`height:auto;aspect-ratio:${t.width}/${t.height}`:`height:${t.height}px`;return` 3 <iframe 4 src="${i}" 5 title="Altos chart" 6 style="border:0;display:block;width:${t.width}px;max-width:100%;${n}" 7 scrolling="auto" 8 loading="lazy"> 9 </iframe> 10 `}),this.selectedSizeId.set(this.defaultSize())}selectSize(t){this.selectedSizeId.set(t),this.copied.set(!1),this.sizeSelected$.emit(t)}copy(){return w(this,null,function*(){let t=this.embedCode();try{yield navigator.clipboard.writeText(t),this.copied.set(!0),this.copyEmbedCode(),setTimeout(()=>this.copied.set(!1),1500)}catch{let i=document.createElement("textarea");i.value=t,i.style.position="fixed",i.style.left="-9999px",document.body.appendChild(i),i.focus(),i.select();try{document.execCommand("copy"),this.copied.set(!0),this.copyEmbedCode(),setTimeout(()=>this.copied.set(!1),1500)}finally{document.body.removeChild(i)}}})}copyEmbedCode(){let t=this.selectedSize(),i={embed_size:t.label.toLowerCase(),embed_dimensions:`${t.width}x${t.height}`};this.copied$.emit(i)}applySizeToSrc(t,i){if(!t)return t;try{let n=new URL(t);return n.searchParams.set("size",i),n.toString()}catch{let n=t.indexOf("#"),o=n>=0?t.slice(n):"",c=n>=0?t.slice(0,n):t,p=c.indexOf("?"),u=p>=0?c.slice(0,p):c,b=p>
10=0?c.slice(p+1):"",P=new URLSearchParams(b);P.set("size",i);let D=P.toString();return`${u}${D?`?${D}`:""}${o}`}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-share-embed"]],inputs:{defaultSize:[1,"defaultSize"],src:[1,"src"],chartAspectRatio:[1,"chartAspectRatio"]},outputs:{sizeSelected$:"sizeSelected$",copied$:"copied$"},decls:23,vars:3,consts:[[1,"t-mt-6"],[1,"t-space-y-[20px]","font-hanken"],[1,"t-space-y-[8px]"],[1,"t-text-[14px]","t-font-medium"],[1,"t-flex","t-gap-[8px]","t-flex-wrap"],["type","button",1,"t-btn","t-text-[13px]",3,"ngClass"],[1,"t-text-[12px]","t-text-gray-500"],[1,"t-bg-gray-100","t-rounded-[10px]","t-p-[12px]","t-text-[12px]","t-font-mono","t-overflow-x-auto"],[1,"t-whitespace-pre-wrap","t-break-all","t-py-0","t-px-4"],[1,"t-flex","t-justify-center","t-pt-[8px]"],["type","button",1,"t-btn","btn-purple-outline","t-bg-white","t-text-[14px]","t-font-medium",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"t-w-[16px]","t-h-[16px]"],["width","14","height","14","x","8","y","8","rx","2","ry","2"],["d","M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"],["type","button",1,"t-btn","t-text-[13px]",3,"click","ngClass"]],template:function(i,n){i&1&&(a(0,"div",0)(1,"div",1)(2,"div",2)(3,"label",3),d(4,"Select Embed Size:"),l(),a(5,"div",4),ot(6,Mo,2,2,"button",5,To),l(),a(8,"p",6),d(9),l()(),a(10,"div",2)(11,"label",3),d(12,"Generated Embed Code:"),l(),a(13,"div",7)(14,"pre",8),d(15),l()()(),a(16,"div",9)(17,"button",10),v("click",function(){return n.copy()}),F(),a(18,"svg",11),y(19,"rect",12)(20,"path",13),l(),C(21,Ao,1,0)(22,Po,1,0),l()()()()),i&2&&(s(6),at(n.sizes()),s(3),q(n.sizeLabel()),s(6),q(n.embedCode()),s(6),_(n.copied()?21:22))},dependencies:[Rt],encapsulation:2})}}return e})();function Eo(e,r){if(e&1){let t=A();a(0,"label",12)(1,"input",16),$e("ngModelChange",function(n){k(t);let o=m();return Pe(o.includeDefaultCampaign,n)||(o.includeDefaultCampaign=n),S(n)}),l(),a(2,"div",17),d(3," Add new contact to New Client Default Campaign "),l()()}if(e&2){let t=m();s(),ze("ngModel",t.includeDefaultCampaign)}}function Oo(e,r){e&1&&y(0,"loading")}function Do(e,r){e&1&&y(0,"loading")}function Ro(e,r){e&1&&d(0," Save & Add ")}var ur=(()=>{class e{constructor(){this.adminApiService=g(Nt),this.recaptchaV3Service=g(ne),this.recaptchaLoaderService=g(Ke),this.bsModalRef=g(ln),this.toastService=g(yt),this.verifyEmailService=g(ii),this.captchaToken=null,this.hasResolved=!1,this.result$=new ji(1),this.email=x(""),this.firstName=x(""),this.lastName=x(""),this.isLoading=x(!1),this.includeDefaultCampaign=x(!0),this.campaigns=X({loader:()=>G([]),defaultValue:[]}),this.canSubmit=f(()=>!!(this.email().trim()&&this.firstName().trim()&&this.lastName().trim())&&!this.isLoading()),this.defaultCampaign=f(()=>this.campaigns.value().find(t=>t.isDefault)?.id??null)}ngOnInit(){this.recaptchaLoaderService.load()}ngOnDestroy(){this.cleanupSensitiveState(),this.hasResolved||this.resolve(null),this.result$.complete(),this.recaptchaLoaderService.delete()}cancel(){this.resolve(null),this.bsModalRef.hide()}submit(){return w(this,null,function*(){if(this.canSubmit()){this.isLoading.set(!0);try{this.captchaToken=yield Ht(this.recaptchaV3Service.execute("admin_contact_save"));let t="";this.defaultCampaign()&&this.includeDefaultCampaign()&&(t=this.defaultCampaign().toString());let i={email:this.email().trim(),firstName:this.firstName().trim(),lastName:this.lastName().trim(),leadType:"UNASSIGNED",propertyType:"SFH",signupType:"MANUAL",send_email:!1,reOptIn:!1,optOut:!1,phone:"",campaigns:t,reports:""};if(!(yield Ht(this.adminApiService.postAddContact(i,this.captchaToken)))?.success){this.resolve("not_success");return}this.resolve(this.email().trim())}catch(t){console.error("Error submitting contact:",t),this.verifyEmailService.isEmailNotConfirmed(t)?this.toastService.showErrorToast("Please verify your email to continue."):this.toastService.showErrorToast("Failed to add contact. Please try again."),this.resolve("manual_error")}finally{this.captchaToken=null,this.isLoading.set(!1),this.bsModalRef.hide()}}})}resolve(t){this.hasResolved||(this.hasResolved=!0,this.result$.next(t))}cleanupSensitiveState(){this.captchaToken=null,this.firstName.set(""),this.lastName.set("")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["quick-action-add-new-contact-modal"]],features:[Xt([ne,{provide:Ze,useValue:I.altos.gRecaptchaKey}])],decls:29,vars:7,consts:[["role","dialog","aria-modal","true","tabindex","-1",1,"t-relative","t-w-full","t-max-w-[980px]","t-rounded-[16px]","t-border","t-border-gray-200","t-bg-white","t-p-[24px]","t-shadow-lg",3,"click"],[1,"t-flex","t-flex-col","t-gap-[24px]"],[1,"t-flex","t-flex-col","t-gap-[8px]"],[1,"t-m-0","t-text-[22px]","t-font-bold","font-scale"],[1,"t-m-0","t-text-[16
10px]","t-font-medium","t-text-gray-400","font-hanken"],[1,"t-grid","t-grid-cols-1","md:t-grid-cols-2","t-gap-[24px]","font-hanken"],[1,"t-form-control","t-gap-[8px]"],["for","quick-action-first-name",1,"t-text-[14px]","t-font-semibold"],["id","quick-action-first-name","type","text","autocomplete","given-name","name","firstName",1,"t-input","t-input-bordered","t-w-full","t-h-16","t-text-[14px]",3,"ngModelChange","ngModel"],["for","quick-action-last-name",1,"t-text-[14px]","t-font-semibold"],[1,"t-relative"],["id","quick-action-last-name","type","text","autocomplete","family-name","name","lastName",1,"t-input","t-input-bordered","t-w-full","t-h-16","t-pr-[76px]","t-text-[14px]","focus:t-border-[#9747FF]","focus:t-outline-none","focus:t-ring-2","focus:t-ring-[#9747FF]",3,"ngModelChange","ngModel"],[1,"t-label-text","t-text-[15px]","t-mb-4","t-flex","t-gap-4","t-items-center","t-cursor-pointer"],[1,"t-flex","t-flex-col-reverse","sm:t-flex-row","t-justify-end","t-gap-[16px]"],["type","button",1,"t-btn","btn-navy-outline","t-h-[36px]","t-min-h-[36px]","t-px-[24px]","t-text-[14px]","font-cofo-mono",3,"click","disabled"],["type","button",1,"t-btn","btn-purple","t-h-[36px]","t-min-h-[36px]","t-px-[24px]","t-text-[14px]","font-cofo-mono",3,"click","disabled"],["type","checkbox",1,"checkbox-purple","t-m-0",3,"ngModelChange","ngModel"],[1,"font-hanken","t-font-normal"]],template:function(i,n){i&1&&(a(0,"div",0),v("click",function(c){return c.stopPropagation()}),a(1,"div",1)(2,"div",2)(3,"h1",3),d(4,"Save new contact"),l(),a(5,"p",4),d(6),l()(),a(7,"div",5)(8,"div",6)(9,"label",7),d(10," First name "),a(11,"span"),d(12,"*"),l()(),a(13,"input",8),v("ngModelChange",function(c){return n.firstName.set(c)}),l()(),a(14,"div",6)(15,"label",9),d(16," Last name "),a(17,"span"),d(18,"*"),l()(),a(19,"div",10)(20,"input",11),v("ngModelChange",function(c){return n.lastName.set(c)}),l()()()(),C(21,Eo,4,1,"label",12)(22,Oo,1,0,"loading"),a(23,"div",13)(24,"button",14),v("click",function(){return n.cancel()}),d(25," Cancel "),l(),a(26,"button",15),v("click",function(){return n.submit()}),C(27,Do,1,0,"loading")(28,Ro,1,0),l()()()()),i&2&&(s(6),M(" ",n.email()," "),s(7),h("ngModel",n.firstName()),s(7),h("ngModel",n.lastName()),s(),_(n.campaigns.value().length&&n.defaultCampaign()?21:n.campaigns.isLoading()?22:-1),s(3),h("disabled",n.isLoading()),s(2),h("disabled",!n.canSubmit()||n.campaigns.isLoading()),s(),_(n.isLoading()?27:28))},dependencies:[mt,Ge,We,Lt,It,xt,qt],encapsulation:2,changeDetection:0})}}return e})();var No="there was movement this week.";function gr(e,r){let t=Li(e),i=r?.[t]?.trim();return i||r?.median_market_trend?.trim()||No}function Li(e){switch(e){case"price_median":return"median_price_trend";case"per_sqft_median":return"median_per_sqft_trend";case"dom_mean":case"dom_median":return"dom_trend";case"count":return"inventory_trend";default:return"median_market_trend"}}var zt=(()=>{class e{constructor(){this.api=g(et),this.quickActions=g($),this.state=g(bt),this.utils=g(re),this.markets=f(()=>this.state.markets()??(this.quickActions.selectedReport()?[this.quickActions.selectedReport()]:[])),this.requestKey=f(()=>this.quickActions.activeSection()==="chart-creator"&&this.markets().length?JSON.stringify({hashes:this.markets().map(t=>t.hash),type:this.quickActions.dataType()}):void 0),this.resource=X({request:this.requestKey,loader:({request:t})=>{let{hashes:i,type:n}=JSON.parse(t);return ye(i.map(o=>ye({chart:this.api.getChartData(o,n),table:this.api.getTableData(o,n)}).pipe(lt(({chart:c,table:p})=>({hash:o,chart:c,table:p,error:!c})),_t(()=>G({hash:o,chart:null,table:null,error:!0})))))}}),this.availableDates=f(()=>Fn(this.resource.value()??[])),this.median=f(()=>this.state.resolveMedian(this.availableDates())),this.coverage=f(()=>Pn(this.resource.value()??[],this.state.selectedChart(),this.state.segments(),this.median())),this.timeframe=f(()=>En(this.state.timeframe(),this.state.startDate(),this.state.endDate(),this.coverage())),this.dateRange=f(()=>{let t=this.timeframe().span;return t?`${St(t.start).getTime()}__${St(t.end).getTime()}`:null}),this.failedMarkets=f(()=>(this.resource.value()??[]).filter(t=>t.error)),this.model=f(()=>{if(this.resource.isLoading()||this.failedMarkets().length||!this.markets().length||!this.timeframe().span)return null;let t=this.resource.value();if(!t||t.length!==this.markets().length)return null;let i=this.markets().map(o=>W(z({},t.find(c=>c.hash===o.hash)),{name:this.utils.reportDisplayName(o)}
10));if(i.some(o=>!o.chart))return null;let n=this.timeframe().span;return Vn(i,this.state.selectedChart(),this.state.segments(),this.median(),St(n.start),St(n.end))}),this.titleCandidates=f(()=>this.state.buildTitleCandidates(this.markets().map(t=>{let i=this.utils.reportDisplayName(t),n=this.utils.reportDisplayName(W(z({},t),{zip:null})),o=`, ${t.state}`;return{full:i,compact:n.endsWith(o)?`${n.slice(0,-o.length)} ${t.state}`:n}}),this.availableDates(),this.timeframe().span)),this.title=f(()=>this.titleCandidates()[0]),this.hasData=f(()=>{let t=this.model();return!!t&&t.missingSeries.length<t.selection.quartileSelection.length*t.selection.rollingAvgSelection.length})}setTimeframe(t){this.state.setTimeframe(t,this.timeframe().span)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();function jt(e){switch(String(e??"").trim().toLowerCase().replace(/\s+/g,"-").replace(/_/g,"-")){case"market-snapshot":case"snapshot":return"snapshot";case"market-action":case"market-action-index":return"market_action";case"market-reports":return"market_reports";default:return"chart_creator"}}function ue(e){return e?.advanced?"advanced":e?.premium?"premium":e?.professional?"professional":e?.lite?"lite":e?.freemium?"freemium":"other"}function Ii(e){let r=e?.error?.code??e?.code;if(r)return String(r);let t=e?.status;return t!=null?String(t):"unknown"}function _i(e){return e?Math.round((Date.parse(e.end)-Date.parse(e.start))/864e5):null}function ge(e){return/^\d+m$/.test(e)?`${e}o`:e}var wt=(()=>{class e{constructor(){this.mixpanel=g(dt),this.admin=g(Qt),this.state=g(bt),this.data=g(zt),this.qa=g($),this.lastClamp=null,this.context=f(()=>({market_count:this.data.markets().length,markets:this.data.markets().map(t=>t.displayName),metric:this.state.selectedChart(),property_type:this.qa.chartType().toLowerCase(),median_series:this.data.median(),segments_selected:this.state.segments().map(t=>kt(t).label),segment_count:this.state.segments().length,timeframe_preset:ge(this.state.timeframe()),timeframe_days:this.data.resource.isLoading()?null:_i(this.data.timeframe().span),plan_tier:ue(this.admin.accountTypes$())})),E(()=>{if(this.qa.activeSection()!=="chart-creator"){this.lastClamp=null;return}if(this.data.resource.isLoading())return;let t=this.data.timeframe(),i=this.context(),p=i,{plan_tier:n}=p,o=Bi(p,["plan_tier"]),c=t.clampReason?JSON.stringify([o,t]):null;c&&c!==this.lastClamp&&pt(()=>this.track("custom_range_clamped",{requested_span_days:_i(t.requestedSpan),applied_span_days:_i(t.span),reason:t.clampReason},i)),this.lastClamp=c})}track(t,i={},n){!n&&this.qa.activeSection()!=="chart-creator"||this.mixpanel.onTrackAdmin(t,z(z({},n??this.context()),i)).catch(()=>{})}medianChanged(t,i,n=this.context()){let o=this.data.median();t!==o&&this.track("median_series_changed",{from:t,to:o,changed_by:i},n)}setMarkets(t){let i=this.data.markets(),n=this.state.segments(),o=this.data.median();this.state.setMarkets(t);let c=this.data.markets(),p=W(z({},this.context()),{timeframe_days:null});c.filter(u=>!i.some(b=>b.hash===u.hash)).forEach(()=>this.track("market_added",{market_count_after:c.length},p)),i.filter(u=>!c.some(b=>b.hash===u.hash)).forEach(()=>this.track("market_removed",{market_count_after:c.length},p)),n.length>1&&c.length>1&&this.track("segments_reset_multi_market",{segments_before:n.map(u=>kt(u).label)},p),this.medianChanged(o,"coerced",p)}setMetric(t){let i=this.state.selectedChart();i!==t&&(this.state.setMetric(t),this.track("metric_changed",{from:i,to:t}))}setPropertyType(t){let i=this.qa.chartType();i!==t&&(this.qa.chartType.set(t),this.track("property_type_changed",{from:i.toLowerCase(),to:t.toLowerCase()},W(z({},this.context()),{timeframe_days:null})))}setMedian(t){if(this.state.medianRestriction()&&t!=="90d"){this.track("median_series_blocked",{attempted_value:t,reason:this.data.markets().length>1?"multi_market":"multi_segment"});return}let i=this.data.median();this.state.setMedian(t),this.medianChanged(i,"user")}setSegments(t){let i=this.state.segments(),n=this.data.median();this.state.setSegments(t);let o=this.state.segments();o.filter(c=>
10!i.includes(c)).forEach(c=>this.track("segment_selected",{segment:kt(c).label,segment_count_after:o.length})),i.filter(c=>!o.includes(c)).forEach(c=>this.track("segment_deselected",{segment:kt(c).label,segment_count_after:o.length})),this.medianChanged(n,"coerced")}setTimeframe(t){let i=this.state.timeframe();if(i===t)return;let n=this.data.median();this.data.setTimeframe(t),this.track("timeframe_changed",{from:ge(i),to:ge(t),changed_by:"dropdown"}),this.medianChanged(n,"auto_default")}setDates(t,i,n="manual_entry"){if(t?.getTime()===this.state.startDate()?.getTime()&&i?.getTime()===this.state.endDate()?.getTime())return;let o=this.state.timeframe(),c=this.data.median();this.state.setDates(t,i,n==="drag_selection"),n==="drag_selection"&&this.track("timeframe_changed",{from:ge(o),to:"custom",changed_by:n}),this.track("custom_range_applied",{span_days:_i(this.data.timeframe().span),source:n}),this.medianChanged(c,"auto_default")}resetZoom(){if(!this.state.canResetZoom())return;let t=this.state.timeframe(),i=this.data.median();this.state.resetZoom(),this.track("timeframe_changed",{from:ge(t),to:ge(this.state.timeframe()),changed_by:"reset_zoom"}),this.medianChanged(i,"auto_default")}setBranding(t){this.qa.hasBranding()!==t&&(this.qa.hasBranding.set(t),this.track("branding_toggled",{enabled:t}))}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275prov=Qe({token:e,factory:e.\u0275fac,providedIn:"root"})}}return e})();var Ci="[Click Here]";function fr(e){let r=e.displayName?.trim();if(!r)return"";let t=e.sectionName?.trim();return t==="Market Snapshot"?`Your latest market snapshot for ${r}`:t==="Market Action"?`A quick market pulse for ${r}`:_e(t||"")?Fo(e.selectedChart,r,e.selectedChartLabel):`${t||"Report"} for ${r}`}function _r(e){if(_e(e.sectionName))return Lo(e);let r=Io(e.sectionName,e.displayName),t=Qo(e.sectionName),i=[`Hello ${Vi()},`,"",r,"",t,"",fe(e.sectionName)],n=$o(e);return n&&i.push("",n),`${i.join(` 11`)} 12`}function Cr(e,r,t){let i=[],n=Vi(),o=fe(r);return e.includes(n)||i.push({id:"first-name",text:`${n} was removed. The greeting will no longer be personalized.`}),zi(e,o)||i.push({id:"section-image",text:Ho(t)?`${o} was removed. The ${r} image will be automatically added to your email body.`:`${o} was removed. The ${r} image will not appear in the email body.`}),i}function Fi(e,r,t){let i=fe(r).toLowerCase(),n=t?.trim()??"",o=!!n,c=[],p=e.replace(/\r\n/g,` 13`).split(` 14`).map(b=>b.trim()).filter(Boolean),u=p.some(b=>b.toLowerCase()===i);for(let b of p){if(b.toLowerCase()===i){o&&c.push({kind:"image"});continue}n&&b===n||/^\{.+\s+png\}$/i.test(b)||c.push({kind:"text",value:b})}return!u&&o&&Uo(c),c}function xr(e,r,t,i){let n=Fi(e,r,t);if(!n.length)return"";let c=`${r?.trim()||"Selected Section"} PNG`,p=t?.trim()??"";return`<div>${n.map(b=>{if(b.kind==="image")return`<p><img src="${p}" alt="${c}"/></p>`;if(b.kind==="text"){let P=b.value.indexOf(Ci);if(P!==-1){let D=b.value.slice(0,P),nt=b.value.slice(P+Ci.length),j=`${I.altos.baseUrl}/r/${i}`;return`<p>${D}<a href="${j}" target="_blank">${Ci.replace(/\[|\]/g,"")}</a>${nt}</p>`}}return`<p>${b.value}</p>`}).join("")}</div>`}function qo(e,r){let t="";switch(e){case"price_median":t=r?.median_price_quartile_trend?.trim()??"";break;case"dom_mean":case"dom_median":t=r?.dom_quartile_trend?.trim()??"";break;case"mai":t=r?.median_market_quartile_trend?.trim()??"";break;default:t="";break}return t||null}function Vi(){return"[First Name]"}function fe(e){return`{${e?.trim()||"Selected Section"} PNG}`}function zi(e,r){return e.replace(/\r\n/g,` 15`).split(` 16`).some(t=>t.trim().toLowerCase()===r.toLowerCase())}function Qi(e){return`You can also view the full report here: ${Ci}`}function $i(e,r){return yr(e.replace(/\r\n/g,` 17`).replace(Qi(r),"").trimEnd())}function qe(e,r,t,i){let n=$i(e,i);if(!t)return n?`${n} 18`:"";let o=n?`${n} 19${Qi(i)}`:Qi(i);return`${yr(o)} 20`}function yr(e){return e.replace(/\n{3,}/g,` 21 22`)}function _e(e){return e==="Chart Creator"}function Lo(e){let r=e.selectedChartLabel||"this metric",t=e.displayName?.trim()||"this location",i=e.sectionName?.trim()||"Selected Section",n=e.selectedChart,o=!e.suppressMarketNarrative&&e.chartMetricNarrative?`${vr(i,n)} ${e.chartMetricNarrative}`:"",c=[`Hello ${Vi()},`,"",Vo(n,t,r),"",zo(n,t,r),"",fe(e.sectionName)];e.chartTitle&&c.push("",`Selected chart: ${e.chartTitle}`),e.primaryReportLocation&&c.push("",`The full report link below is for ${e.primaryReportLocation}.`),o&&c.push("",o);let p=e.suppressMarketNarrative?"":qo(e.selectedChart,e.conditionalQuartileText);
22return p&&c.push("",p),`${c.join(` 23`)} 24`}function Io(e,r){return e==="Market Action"?`I wanted to send over a quick update on where the market stands in ${r} this week.`:`I wanted to share a quick snapshot of what's happening in ${r} right now.`}function Qo(e){return e==="Market Action"?"I've attached the latest Market Action view so you can see how supply and demand are shaping the market right now.":"I've attached the latest Market Snapshot so you can get a clear view of pricing, inventory, and overall market conditions at a glance."}function Fo(e,r,t){switch(e){case"price_median":return`Median list price in ${r}: latest trend`;case"per_sqft_median":return`Price per square foot in ${r}: latest trend`;case"dom_mean":return`How quickly homes are selling in ${r}`;case"dom_median":return`Median days on market in ${r}: latest trend`;case"count":return`Housing inventory in ${r}: latest trend`;default:return`${t} in ${r}: latest trend`}}function Vo(e,r,t){switch(e){case"price_median":return`I wanted to share a quick update on median list price trends in ${r}.`;case"per_sqft_median":return`I wanted to share a quick look at price per square foot in ${r}.`;case"dom_mean":return`I wanted to share a quick update on how quickly homes are selling in ${r}.`;case"dom_median":return`I wanted to share a quick look at median days on market in ${r}.`;case"count":return`I wanted to share a quick update on housing inventory in ${r}.`;default:return`I wanted to share a quick update on ${t} in ${r}.`}}function zo(e,r,t){switch(e){case"price_median":return"I've attached a chart showing how list prices have been moving, which can be a helpful signal for understanding current pricing conditions in the market.";case"per_sqft_median":return"I've attached a chart that shows how values are moving over time and gives useful context on pricing in the local market.";case"dom_mean":return"I've attached a chart showing the trend in average days on market, which can help illustrate how fast buyers are moving and how competitive the market feels right now.";case"dom_median":return"I've attached a chart that shows how long homes are typically staying on the market, which can be a useful read on current buyer demand and market pace.";case"count":return"I've attached a chart showing how the number of homes on the market is trending, which is one of the clearest signals of how supply is shifting over time.";default:return"I've attached a chart showing the recent trend, which helps add context to how the local market is moving over time."}}function $o(e){if(e.suppressMarketNarrative||_e(e.sectionName)||e.hasMarketNarrative)return null;let r=e.conditionalText?.median_market_trend?.trim(),t=e.sectionName?.trim()||"Selected Section",i=e.selectedChart;return r?`${vr(t,i)} `+r:null}function Ho(e){return!!e?.trim()}function Uo(e){if(e.some(i=>i.kind==="image"))return;let r=e.reduce((i,n,o)=>(n.kind==="text"&&i.push(o),i),[]);if(!r.length){e.push({kind:"image"});return}let t=r[Math.min(1,r.length-1)];e.splice(t+1,0,{kind:"image"})}function vr(e,r){return _e(e)?{price_median:"Median Price trend:",per_sqft_median:"Median Price Per Sq.Ft trend:",dom_mean:"Average days on Market trend:",dom_median:"Median days on Market trend:",count:"Inventory trend:"}[r]??"Market Narrative:":"Market Narrative:"}var kr=At("notePanelTransition",[tt("editor => preview",[ie([vt(":leave",[O({position:"absolute",top:0,left:0,width:"100%",opacity:1,transform:"translateY(0)"}),B("120ms ease-in",O({opacity:0,transform:"translateY(-8px)"}))],{optional:!0}),vt(":enter",[O({opacity:0,transform:"translateY(10px)"}),B("220ms cubic-bezier(0.22, 1, 0.36, 1)",O({opacity:1,transform:"translateY(0)"}))],{optional:!0})])]),tt("preview => editor",[ie([vt(":leave",[O({position:"absolute",top:0,left:0,width:"100%",opacity:1,transform:"translateY(0)"}),B("120ms ease-in",O({opacity:0,transform:"translateY(8px)"}))],{optional:!0}),vt(":enter",[O({opacity:0,transform:"translateY(-8px)"}),B("180ms cubic-bezier(0.22, 1, 0.36, 1)",O({opacity:1,transform:"translateY(0)"}))],{optional:!0})])])]);var Bo=(e,r)=>r.id;function jo(e,r){if(e&1&&(a(0,"p",4),d(1),l()),e&2){let t=m();s(),q(t.error())}}function Wo(e,r){if(e&1){let t=A();a(0,"span",33),d(1),a(2,"button",34),v("click",function(){let n=k(t),o=n.item,c=n.clear;return S(c(o))}),d(3," \xD7 "),l()()}if(e&2){let t=r.item,i=r.disabled;s(),M(" ",t," "),s(),h("disabled",i)}}function Go(e,r){if(e&1&&(a(0,"span",35),d(1),l()),e&2){let t=r.item;s(),q(t)}}function Zo(e,r){e&1&&(a(0,"div",36),d(1,"No matching emails found."),l())}function Ko(e,r){if(e&1){let t=A();a(0,"div",37),v("click",function(){k(t);let n=m();return S(n.onUpgradeAccount("recipient_field"))}),a(1,"button",38),v("click",function(n){k(t);let o=m();return S(o.onUpgradeAccount("banner_cta",n))}),d(2," Upgrade now "),l()()}}function Yo(e,r){e&1&&U(0)}function Jo(e,r){if(e&1){let t=A();a(0,"p",11),C(1,Yo,1,0,"ng-container",39),d(2," One click email share available in Pro and higher plans. "),a(3,"span",40),v("click",function(n){k(t);let o=m();return S(o.onUpgradeAccount("banner_cta",n))}),d(4,"Upgrade now"),l()()}if(e&2){m();let t=L(43);s(),h("ngTemplateOutlet",t)}}function Xo(e,r){e&1&&d(0," Close Preview ")}function ta(e,r){e&1&&d(0," Preview ")}function ea(e,r){if(e&1){let t=A();a(0,"div",19)(1,"textarea",41),v("input",function(n){k(t);let o=m();return S(o.onPersonalNoteInput(n))}),l()()}if(e&2){let t=m();s(),h("value",t.personalNoteText())}}function ia(e,r){if(e&1&&(a(0,"p"),d(1),l()),e&2){let t=m().$implicit;s(),q(t.value)}}function na(e,r){e&1&&(a(0,"div",49),y(1,"div",52),l())}function ra(e,r){e&1&&(a(0,"p",51),d(1," Unable to load preview image. "),l())}function oa(e,r){if(e&1){let t=A();a(0,"div",48),C(1,na,2,0,"div",49),a(2,"img",50),v("load",function(){k(t);let n=m(3);return S(n.onPreviewImageLoad())})("error",function(){k(t);let n=m(3);return S(n.onPreviewImageError())}),l()(),C(3,ra,2,0,"p",51)}if(e&2){let t=m(3);s(),_(t.isPreviewImageLoading()?1:-1),s(),rt("t-invisible",t.isPreviewImageLoading()),h("src",t.sectionImageSrc(),be)("alt",(t.sectionName()||"Selected Section")+" PNG"),s(),_(t.isPreviewImageError()?3:-1)}}function aa(e,r){if(e&1&&C(0,ia,2,1,"p")(1,oa,4,6),e&2){let t=r.$implicit;_(t.kind==="text"?0:1)}}function sa(e,r){if(e&1&&(a(0,"div",20)(1,"div",42)(2,"div",43)(3,"span",44),d(4,"From:"),l(),a(5,"span",45),d(6),l()(),a(7,"div",43)(8,"span",44),d(9,"To:"),l(
24),a(10,"span",45),d(11),l()(),a(12,"div",43)(13,"span",44),d(14,"Subject:"),l(),a(15,"span",45),d(16),l()()(),a(17,"div",46)(18,"div",47),ot(19,aa,2,1,null,null,Ve),l()()()),e&2){let t=m();s(6),q(t.previewFrom()),s(5),M(" ",t.previewTo()||"No recipients selected"," "),s(5),q(t.previewSubject()),s(3),at(t.previewBlocks())}}function ca(e,r){if(e&1&&(a(0,"p",53),d(1),l()),e&2){let t=r.$implicit;s(),M(" ",t.text," ")}}function la(e,r){if(e&1&&(a(0,"div",21),ot(1,ca,2,1,"p",53,Bo),l()),e&2){let t=m();s(),at(t.noteWarnings())}}function pa(e,r){if(e&1&&d(0),e&2){let t=m();M(" for ",t.locationName()," ")}}function ma(e,r){if(e&1&&(a(0,"p",30),d(1),l()),e&2){let t=m();s(),M(" ",t.emailAttachmentCopy()," ")}}function da(e,r){e&1&&y(0,"loading")}function ha(e,r){e&1&&(a(0,"span"),d(1,"Send now"),l())}function ua(e,r){e&1&&(F(),a(0,"svg",54),y(1,"path",55),l())}var br=(()=>{class e{constructor(){this.chartTracking=g(wt),this.chartTrackingContext=T(null),this.adminDataService=g(Qt),this.adminApiService=g(Nt),this.apiService=g(et),this.toastService=g(yt),this.bsModalService=g(Ut),this.mixpanelService=g(dt),this.utilsService=g(re),this.upgradeService=g(ee),this.modalService=g(Ut),this.verifyEmailService=g(ii),this.document=g(rn),this.recaptchaV3Service=g(ne),this.recaptchaLoaderService=g(Ke),this.contactAdded$=Se(),this.contactEmails=T([]),this.contactsLoading=T(!1),this.displayName=T(""),this.chartCreatorConfig=T(null),this.sectionName=T("Market Snapshot"),this.sectionImageSrc=T(""),this.conditionalText=T(null),this.hasMarketNarrative=T(!1),this.suppressMarketNarrative=T(!1),this.hasSegments=T(!1),this.reportHash=T(""),this.selectedChart=T(""),this.selectedType=T(null),this.report=T(null),this.campaigns=X({loader:()=>this.adminApiService.getCampaigns().pipe(lt(t=>t?.results??[])),defaultValue:[]}),this.currentUser=K(this.adminDataService.currentCurrentUser,{initialValue:null}),this.currentAccount=K(this.adminDataService.getAccount(),{initialValue:null}),this.accountTypes=K(this.adminDataService.getAccountTypes(),{initialValue:null}),this.isExistingUser=K(this.adminDataService.isLegacyUser(),{initialValue:!1}),this.accountId=K(this.adminDataService.getAccount().pipe(Zt(t=>t!=null&&t.accountId!=null),lt(t=>t.accountId)),{initialValue:null}),this.recipients=x([]),this.error=x(""),this.customEmails=x([]),this.personalNoteContextKey=x(""),this.conditionalQuartileText=x(null),this.previousRecipientCount=x(0),this.pendingRecipientSource=x(null),this.subjectLine=x(""),this.includeLink=x(!0),this.personalNote=x(""),this.personalNoteText=x(""),this.hasEditedPersonalNote=x(!1),this.isPreviewMode=x(!1),this.isPreviewImageLoading=x(!1),this.isPreviewImageError=x(!1),this.isLoading=x(!1),this.isBlurActivated=x(!1),this.charts=oe,this.hasTrackedBodyEditEvent=!1,this.isFreemiumOrLite=f(()=>(this.accountTypes()?.freemium||this.accountTypes()?.lite)??!1),this.selectableEmails=f(()=>Array.from(new Set([...this.contactEmails(),...this.customEmails()]))),this.previewBlocks=f(()=>Fi(this.personalNoteText(),this.sectionName(),this.sectionImageSrc())),this.shouldRenderSectionImage=f(()=>this.previewBlocks().some(t=>t.kind==="image")),this.previewFrom=f(()=>this.currentUser()?.email||"Unknown"),this.previewTo=f(()=>this.recipients().join(", ")),this.previewSubject=f(()=>this.subjectLine().trim()||`${this.sectionName()} Update`),this.noteWarnings=f(()=>this.personalNoteContextKey()?Cr(this.personalNoteText(),this.sectionName(),this.sectionImageSrc()):[]),this.emailAttachmentCopy=f(()=>this.isChartCreatorSection()?"The image will be added to this email.":`The ${this.sectionName()} will be attached to this email.`),this.locationName=f(()=>{let t=this.report();return t?this.getReportLinkLocationName(t):""}),this.addCustomEmailTag=t=>w(this,null,function*(){if(this.isFreemiumOrLite())return this.error.set("This feature is not available for Freemium and Lite accounts."),null;let i=this.normalizeEmail(t);if(!i)return null;if(!this.isValidEmail(i))return this.error.set(`Invalid email: ${i}`),null;if(this.recipients().some(n=>n.toLowerCase()===i))return this.error.set("This email is already added."),null;if(!this.selectableEmails().includes(i)){let n=this.bsModalService.show(ur,{ignoreBackdropClick:!0,keyboard:!1,initialState:{campaigns:this.campaigns}});try{n.content.email.set(i),this.isBlurActivated.set(!0);let o=yield Ht(n.content.result$.pipe(Dt(1)));if(o==="not_success")return this.toastService.showErrorToast("Failed to add contact. Please try again."),null;if(o!==i)return null;this.toastService.showSuccessToast("Contact added successfully!"),this.customEmails.update(c=>[...c,i]),this.contactAdded$.emit(i)}catch(o){return console.error("Error adding new contact:",o),this.verifyEmailService.isEmailNotConfirmed(o)?(this.toastService.showErrorToast("Please verify your email to continue."),null):(this.toastService.showErrorToast("Failed to add contact. Please try again."),null)}finally{this.isBlurActivated.set(!1)}}return this.error.set(""),this.pendingRecipientSource.set("manual"),i}),E(()=>{this.includeLink();let t=pt(()=>this.personalNoteText()),i=qe(t,this.reportHash(),this.includeLink(),this.locationName());i!==t&&this.personalNoteText.set(i)}),E(()=>{this.personalNote.set(xr(this.personalNoteText(),this.sectionName(),this.sectionImageSrc(),this.reportHash()))}),E(()=>{let t=this.buildDefaultSubjectLine();t&&this.subjectLine.set(t)}),E(()=>
24{if(!this.hasShareContext())return;let t=`${this.displayName()}|${this.sectionName()}|${this.reportHash()}|${this.selectedChart()}|${this.hasSegments()}|${this.selectedType()}|${JSON.stringify(this.chartCreatorConfig())}`;t!==pt(()=>this.personalNoteContextKey())&&(this.personalNoteContextKey.set(t),this.hasEditedPersonalNote.set(!1),this.personalNoteText.set(qe(this.buildInitialPersonalNote(),this.reportHash(),this.includeLink(),this.locationName())))}),E(()=>{if(!this.personalNoteContextKey())return;let t=this.personalNoteText(),i=this.buildInitialPersonalNote(),n=qe(i,this.reportHash(),this.includeLink(),this.locationName());this.hasEditedPersonalNote()||$i(t,this.displayName())===i&&t===n||this.personalNoteText.set(n)}),E(t=>{let i=this.reportHash()?.trim(),n=this.getResTypeId();if(!(!this.chartCreatorConfig()&&this.isChartCreatorSection()&&this.hasSegments()&&!!i&&n!==null)){this.conditionalQuartileText.set(null);return}let c=this.apiService.getConditionalQuartileText(i,n).subscribe({next:p=>this.conditionalQuartileText.set(p??null),error:()=>this.conditionalQuartileText.set(null)});t(()=>c.unsubscribe())}),E(()=>{this.isPreviewMode()&&this.startPreviewImageLoading()})}ngOnInit(){this.recaptchaLoaderService.load()}ngOnDestroy(){this.recaptchaLoaderService.delete()}onRecipientsChange(t){let i=Array.isArray(t)?t:[],n=[],o=new Set,c="";for(let p of i){let u=this.normalizeEmail(p);if(u){if(!this.isValidEmail(u)){c=c||u;continue}o.has(u)||(o.add(u),n.push(u))}}if(this.recipients.set(n),this.trackRecipientAdded(n.length),c){this.error.set(`Invalid email: ${c}`);return}this.error.set("")}onSubjectInput(t){this.subjectLine.set(t.target.value??"")}onPersonalNoteInput(t){let i=t.target.value??"";this.hasEditedPersonalNote.set(!0),this.personalNoteText.set(i),!this.hasTrackedBodyEditEvent&&i!==this.getDefaultPersonalNote()&&(this.hasTrackedBodyEditEvent=!0,this.trackEmailBodyEdit())}togglePreview(){let t=!this.isPreviewMode();if(this.isPreviewMode.set(t),t?this.trackPreviewOpenClick():this.trackPreviewCloseClick(),!t){this.isPreviewImageLoading.set(!1),this.isPreviewImageError.set(!1);return}this.startPreviewImageLoading()}onPreviewImageLoad(){this.isPreviewImageLoading.set(!1),this.isPreviewImageError.set(!1)}onPreviewImageError(){this.isPreviewImageLoading.set(!1),this.isPreviewImageError.set(!0)}normalizeEmail(t){return t.trim().toLowerCase()}isValidEmail(t){return/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/.test(t)}buildInitialPersonalNote(){return _r(this.getNoteContext())}getDefaultPersonalNote(){return qe(this.buildInitialPersonalNote(),this.reportHash(),this.includeLink(),this.locationName())}buildDefaultSubjectLine(){return this.hasShareContext()?fr(this.getNoteContext()):""}getSelectedChartLabel(){let t=this.selectedChart();return this.charts[t]||"this metric"}getReportLinkLocationName(t){let i=String(t?.category??"").toUpperCase();if(i==="ZIP"){let n=String(t?.zip??"").trim();return n&&n!=="__ALL"&&n!=="All ZIP Codes"?n:this.utilsService.toTitleCase(t?.city||t?.name||"")}return i==="CITY"?this.utilsService.toTitleCase(t?.city||t?.name||""):i==="COUNTY"?String(t?.name||t?.county||"").trim():String(t?.name||t?.city||"").trim()}hasTokenLine(t,i){return zi(t,i)}isChartCreatorSection(){return _e(this.sectionName())}hasShareContext(){return this.displayName()?.trim()?this.isChartCreatorSection()?!!this.selectedChart():!0:!1}getResTypeId(){switch(this.selectedType()){case V.HOUSES:return 100;case V.CONDOS:return 200;case V.COOP:return 300;default:return null}}startPreviewImageLoading(){this.isPreviewImageError.set(!1),this.isPreviewImageLoading.set(this.shouldRenderSectionImage())}getSectionImageToken(){return fe(this.sectionName())}getNoteContext(){let t=this.chartCreatorConfig(),i=["price_median","per_sqft_median","dom_mean","dom_median","count","mai"].includes(this.selectedChart());return{displayName:this.displayName(),sectionName:this.sectionName(),sectionImageSrc:this.sectionImageSrc(),conditionalText:this.conditionalText(),hasMarketNarrative:this.hasMarketNarrative(),suppressMarketNarrative:this.suppressMarketNarrative(),hasSegments:this.hasSegments(),selectedChart:this.selectedChart(),selectedChartLabel:this.getSelectedChartLabel(),chartMetricNarrative:t?i&&!this.suppressMarketNarrative()?this.conditionalText()?.[Li(this.selectedChart())]?.trim()??"":"":gr(this.selectedChart(),this.conditionalText()),conditionalQuartileText:t?null:this.conditionalQuartileText(),chartTitle:t?.title,primaryReportLocation:t?.markets.length>1&&this.includeLink()?this.locationName():void 0}}onSendEmail(){if(this.isLoading())return;let t=this.subjectLine(),i=this.personalNote(),n=this.personalNoteText(),o=this.currentUser(),c=[...this.recipients()],p=`${o?.firstName} ${o?.lastName}`,u=this.getEmailSendTrackingState(c.length);this.trackEmailSendClick(u);let b=new URLSearchParams;b.set("name",p),b.set("subject",t.trim()),b.set("from_name",o?.firstName??""),b.set("from_email",o?.email??""),b.set("html_content",i),b.set("text_content",n),b.set("include_signature","true"),c.forEac
24h((P,D)=>{b.append(`emails[${D}]`,P)}),this.isLoading.set(!0),this.recaptchaV3Service.execute("quick_action_email_share").pipe(Dt(1),ke(P=>(b.set("gRecaptchaToken",P),this.apiService.sendEmail(b))),_t(P=>(console.error("Email sending failed:",P),this.trackEmailSendFail(P,u),this.showErrorMessage("Failed to send email. Please try again later."),this.isLoading.set(!1),Wi)),Dt(1)).subscribe({next:()=>{this.trackEmailSendSuccess(u),this.showSuccessMessage("Email sent successfully!"),this.isLoading.set(!1)}})}showSuccessMessage(t){this.toastService.showSuccessToast(t)}showErrorMessage(t){this.toastService.showErrorToast(t)}trackRecipientAdded(t){let i=this.previousRecipientCount();if(t<=i){this.previousRecipientCount.set(t),t===i&&this.pendingRecipientSource.set(null);return}let n=this.pendingRecipientSource()??"contact_picker";this.previousRecipientCount.set(t),this.pendingRecipientSource.set(null),this.mixpanelService.onTrackAdmin("qa_email_recipient_add",{asset_type:this.getAssetType(),source:n,count:t})}trackPreviewOpenClick(){this.mixpanelService.onTrackAdmin("qa_email_preview_open_click",{asset_type:this.getAssetType()})}trackPreviewCloseClick(){this.mixpanelService.onTrackAdmin("qa_email_preview_close_click",{asset_type:this.getAssetType()})}trackIncludeReportLinkToggle(t){this.mixpanelService.onTrackAdmin("qa_include_report_link_toggle",{asset_type:this.getAssetType(),enabled:t})}trackEmailBodyEdit(){this.mixpanelService.onTrackAdmin("qa_email_body_edit",{asset_type:this.getAssetType(),Deployment:this.document.location.hostname,App:"Admin",membership_status:this.isExistingUser()?"Existing":"Freemium",AccountId:this.accountId(),UserId:this.mixpanelService.currentUser})}trackEmailSendClick(t){this.mixpanelService.onTrackAdmin("qa_email_send_click",{asset_type:t.asset_type,recipient_count:t.recipient_count,preview_open:t.preview_open,include_report_link:t.include_report_link,body_edited:t.body_edited})}trackEmailSendSuccess(t){t.chart_creator&&this.chartTracking.track("email_share_sent",{},t.chart_creator),this.mixpanelService.onTrackAdmin("qa_email_send_success",{asset_type:t.asset_type,recipient_count:t.recipient_count,preview_open:t.preview_open,include_report_link:t.include_report_link,body_edited:t.body_edited})}trackEmailSendFail(t,i){i.chart_creator&&this.chartTracking.track("email_share_failed",{error_type:Ii(t)},i.chart_creator),this.mixpanelService.onTrackAdmin("qa_email_send_fail",{asset_type:i.asset_type,error_code:Ii(t),preview_open:i.preview_open,include_report_link:i.include_report_link,body_edited:i.body_edited})}getAssetType(){return jt(this.sectionName())}onIncludeLinkChange(t){t!==this.includeLink()&&(this.includeLink.set(t),this.trackIncludeReportLinkToggle(t))}getEmailSendTrackingState(t){return{chart_creator:this.chartTrackingContext(),asset_type:this.getAssetType(),recipient_count:t,preview_open:this.isPreviewMode(),include_report_link:this.includeLink(),body_edited:this.isBodyEdited()}}isBodyEdited(){return this.personalNoteText()!==this.getDefaultPersonalNote()}onUpgradeAccount(t,i){i?.preventDefault(),i?.stopPropagation();let n=this.getUpgradeTrackingContext(t);this.trackUpgradePathClick(n);let o=Bt.open(this.modalService,{pricing:[this.upgradeService.getProfessionalPlan(),this.upgradeService.getAdvancedPlan()]}),c=!1;o.content.onUpgraded$$.pipe(Dt(1)).subscribe(p=>{c=!0,this.trackUpgradePathConversion(n,p)}),o.onHide.pipe(Dt(1)).subscribe(()=>{c||this.trackUpgradePathClose(n)})}trackUpgradePathClick(t){this.mixpanelService.onTrackAdmin("qa_email_share_upgrade_path_click",t)}trackUpgradePathClose(t){this.mixpanelService.onTrackAdmin("qa_email_share_upgrade_path_close",t)}trackUpgradePathConversion(t,i){let n={entry_point:t.entry_point,feature_name:t.feature_name,asset_type:t.asset_type,from_plan:t.plan_name,to_plan:this.getPlanNameFromPrice(i)},o=this.getBillingInterval(i);o&&(n.billing_interval=o),this.mixpanelService.onTrackAdmin("qa_email_share_upgrade_path_conversion",n)}getUpgradeTrackingContext(t){return{entry_point:t,feature_name:"one_click_email_share",asset_type:this.getAssetType(),plan_name:ue(this.accountTypes())}}getPlanNameFromPrice(t){switch(String(t?.name??"").trim().toLowerCase()){case"free tier":return"freemium";case"altos lite":return"lite";case"professional":return"professional";case"premium":return"premium";case"advanced":return"advanced";default:return"other"}}getBillingInterval(t){if(t?.interval)return t.interval;let i=this.currentAccount()?.subscriptionItems?.find(n=>n?.isBase)??this.currentAccount()?.subscriptionItems?.[0];return i?.interval??i?.price?.interval??null}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-share-email"]],inputs:{chartTrackingContext:[1,"chartTrackingContext"],contactEmails:[1,"contactEmails"],contactsLoading:[1,"contactsLoading"],displayName:[1,"displayName"],chartCreatorConfig:[1,"chartCreatorConfig"],sectionName:[1,"sectionName"],sectionImageSrc:[1,"sectionImageSrc"],conditionalText:[1,"conditionalText"],hasMarketNarrative:[1,"hasMarketNarrative"],suppressMarketNarrative:[1,"suppressMarketNarrative"],hasSegments:[1,"hasSegments"],reportHash:[1,"reportHash"],selectedChart:[1,"selectedChart"],selectedType:[1,"selectedType"],report:[1,"report"]},outputs:{contactAdded$:"contactAdded$"},features:[Xt([ne,{provide:Ze,useValue:I.altos.gRecaptchaKey}])],decls:44,vars:26,consts:[["lock",""],[1,"t-mt-6","t-transition-all"],[1,"t-space-y-[16px]","font-hanken"],[1,"t-space-y-[8px]"],[1,"t-text-[12px]","t-text-red-500","t-m-0"],[1,"t-relative","t-group"],["addTagText","Add contact","placeholder","Type and add from contact list or enter email and hit enter \u23CE",1,"t-w-full",3,"change","items","multiple","closeOnSelect","clearSearchOnAdd","searchable","clearable","hideSelected","addTag","loading","ngModel","disabled"],["ng-label-tmp",""],["ng-option-tmp",""],["ng-notfound-tmp",""],[1,"t-absolute","t-inset-0","t-z-10","t-flex","t-cursor-pointer","t-items-center","t-justify-center","t-transition-all","t-duration-300","group-hover:t-bg-white/80","group-hover:t-backdrop-blur-[0.3px]"],[1,"t-text-[12px]","t-text-gray-500","t-m-0","t-flex","t-gap-2"],["for","share-email-subject",1,"t-text-[14px]","t-font-medium"],[1,"t-space-y-[8px]","t-w-full","t-min-h-[40px]","t-rounded-[8px]","t-border","t-border-base-300","t-bg-base-100","t-px-[10px]","t-py-[6px]","t-flex","t-flex-wrap","t-items-center","t-gap-[6px]"],["id","share-email-subject","type","text","autocomplete","off",1,"t-flex-1","t-bg-transparent","t-border-0","t-outline-none","t-text-[14px]","t-px-0","t-py-[2px]",3,"input","value"],[1,"t-flex","t-items-center","t-justify-between","t-gap-4"],["for","share-email-note",1,"t-text-[14px]","t-font-medium"],["type","button",1,"t-btn","btn-navy-outline","t-h-[30px]","t-min-h-[30px]","t-px-[10px]","t-text-[12px]","font-cofo-mono",3,"click"],[1,"t-relative","t-overflow-hidden","t-min-h-[120px]"],[1,"t-space-y-[8px]","t-w-full","t-rounded-[8px]","t-border","t-border-base-300","t-bg-base-100","t-px-[10px]","t-py-[6px]","t-flex","t-flex-wrap","t-items-center","t-gap-[6px]"],[1,"t-mx-auto","t-rounded-[10px]","t-border","t-border-base-300","t-bg-white","t-overflow-hidden","t-shadow-sm"],[1,"t-space-y-[6px]"],[1,"t-form-control"],[1,"t-label","t-cursor-pointer","t-justify-start","t-gap-4","t-m-0","t-fit"],["type","checkbox",1,"t-checkbox","t-m-0",3,"ngModelChange","ngModel"],[1,"t-label-text","t-flex","t-items-center","t-gap-4","t-text-[14px]","t-font-normal"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"t-size-[16px]","t-text-gray-500","hover:t-text-[#9747FF]"],["cx","12","cy","12","r","10"],["d","M12 16v-4"],["d","M12 8h.01"],[1,"t-ital
24ic","t-text-gray-400","font-hanken"],[1,"t-flex","t-justify-end"],[1,"t-btn","t-h-[36px]","btn-purple","t-text-[14px]","font-cofo-mono",3,"click","disabled"],[1,"t-inline-flex","t-items-center","t-gap-[6px]","t-text-[12px]","t-rounded","t-px-[8px]","t-py-[4px]","bg-purple","t-text-white"],["type","button","aria-label","Remove email",1,"t-leading-none","t-text-white","t-cursor-pointer","t-p-0",3,"click","disabled"],[1,"t-text-[13px]"],[1,"t-py-[6px]","t-text-[13px]","t-text-gray-500"],[1,"t-absolute","t-inset-0","t-z-10","t-flex","t-cursor-pointer","t-items-center","t-justify-center","t-transition-all","t-duration-300","group-hover:t-bg-white/80","group-hover:t-backdrop-blur-[0.3px]",3,"click"],["type","button",1,"t-btn","btn-purple","t-h-[25px]","t-px-[20px]","t-text-[12px]","font-cofo-mono","t-opacity-0","t-translate-y-2","t-transition-all","t-duration-300","group-hover:t-opacity-100","group-hover:t-translate-y-0","t-shadow-lg",3,"click"],[4,"ngTemplateOutlet"],[1,"text-purple","t-cursor-pointer",3,"click"],["id","share-email-note","autocomplete","off",1,"t-flex-1","t-bg-transparent","t-border-0","t-outline-none","t-text-[14px]","t-px-0","t-py-[2px]","t-min-h-[160px]",3,"input","value"],[1,"t-bg-base-100","t-border-b","t-border-base-300","t-px-3","t-py-3","t-space-y-[6px]"],[1,"t-grid","t-grid-cols-[58px_1fr]","t-gap-x-2","t-text-[13px]"],[1,"t-text-gray-500"],[1,"t-font-medium","t-break-words"],[1,"t-p-3","sm:t-p-4","t-text-[14px]"],[1,"email-preview-body"],[1,"t-relative","t-min-h-[96px]","t-mt-3"],[1,"t-absolute","t-inset-0","t-z-[1]","t-flex","t-items-center","t-justify-center","t-rounded-[8px]","t-bg-base-100/70"],[3,"load","error","src","alt"],[1,"t-mt-2","t-text-[12px]","t-text-red-500"],[1,"t-h-8","t-w-8","t-rounded-full","t-border-2","t-border-gray-300","t-border-t-gray-700","t-animate-spin"],[1,"t-m-0","t-rounded-[8px]","t-border","t-border-amber-200","t-bg-amber-50","t-px-[10px]","t-py-[8px]","t-text-[12px]","t-text-amber-900"],["xmlns","http://www.w3.org/2000/svg","width","14","height","15","viewBox","0 0 14 15","fill","none"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.9375 4.20002C3.9375 2.39589 5.30863 0.93335 7 0.93335C8.69137 0.93335 10.0625 2.39589 10.0625 4.20002V6.06668C11.029 6.06668 11.8125 6.90242 11.8125 7.93335V12.1334C11.8125 13.1643 11.029 14 10.0625 14H3.9375C2.971 14 2.1875 13.1643 2.1875 12.1334V7.93335C2.1875 6.90242 2.971 6.06668 3.9375 6.06668V4.20002ZM3.9375 7.00002C3.45425 7.00002 3.0625 7.41788 3.0625 7.93335V12.1334C3.0625 12.6488 3.45425 13.0667 3.9375 13.0667H10.0625C10.5457 13.0667 10.9375 12.6488 10.9375 12.1334V7.93335C10.9375 7.41788 10.5457 7.00002 10.0625 7.00002H3.9375ZM9.1875 6.06668H4.8125V4.20002C4.8125 2.91135 5.79188 1.86668 7 1.86668C8.20812 1.86668 9.1875 2.91135 9.1875 4.20002V6.06668Z","fill","#A0A0A0"]],template:function(i,n){if(i&1){let o=A();a(0,"div",1)(1,"div",2)(2,"div",3),C(3,jo,2,1,"p",4),a(4,"div",5)(5,"ng-select",6),v("change",function(p){return k(o),S(n.onRecipientsChange(p))}),C(6,Wo,4,2,"ng-template",7)(7,Go,2,1,"ng-template",8)(8,Zo,2,0,"ng-template",9),l(),C(9,Ko,3,0,"div",10),l(),C(10,Jo,5,1,"p",11),l(),a(11,"div",3)(12,"label",12),d(13,"Subject line"),l(),a(14,"div",13)(15,"input",14),v("input",function(p){return k(o),S(n.onSubjectInput(p))}),l()()(),a(16,"div",3)(17,"div",15)(18,"label",16),d(19,"Personal Note"),l(),a(20,"button",17),v("click",function(){return k(o),S(n.togglePreview())}),C(21,Xo,1,0)(22,ta,1,0),l()(),a(23,"div",18),C(24,ea,2,1,"div",19)(25,sa,21,3,"div",20),l(),C(26,la,3,0,"div",21),l(),a(27,"div",22)(28,"label",23)(29,"input",24),v("ngModelChange",function(p){return k(o),S(n.onIncludeLinkChange(p))}),l(),a(30,"div",25),d(31," Include link to the full report "),C(32,pa,1,1),F(),a(33,"svg",26),y(34,"circle",27)(35,"path",28)(36,"path",29),l()()()(),C(37,ma,2,1,"p",30),ht(),a(38,"div",31)(39,"button",32),v("click",function(){return k(o),S(n.onSendEmail())}),C(40,da,1,0,"loading")(41,ha,2,0,"span"),l()()()(),C(42,ua,2,0,"ng-template",null,0,Z)}if(i&2){let o;rt("t-blur-[3px]",n.isBlurActivated()),s(3),_(n.error()?3:-1),s(2),h("items",n.selectableEmails())("multiple",!0)("closeOnSelect",!1)("clearSearchOnAdd",!0)("searchable",!0)("clearable",!1)("hideSelected",!0)("addTag",n.addCustomEmailTag)("loading",n.contactsLoading())("ngModel",n.recipients())("disabled",n.isFreemiumOrLite()),s(4),_(n.isFreemiumOrLite()?9:-1),s(),_(n.isFreemiumOrLite()?10:-1),s(5),h("value",n.subjectLine()),s(6),_(n.isPreviewMode()?21:22),s(2),h("@notePanelTransition",n.isPreviewMode()?"preview":"editor"),s(),_(n.isPreviewMode()?25:24),s(2),_(n.noteWarnings().length?26:-1),s(3),h("ngModel",n.includeLink()),s(3),_(((o=n.chartCreatorConfig())==null?null:o.markets.length)>1?32:-1),s(5),_(n.hasTokenLine(n.personalNoteText(),n.getSectionImageToken())?37:-1),s(2),h("disabled",!n.recipients().length||n.isLoading()),s(),_(n.isLoading()?40:41)}},dependencies:[mt,We,Lt,It,Vt,se,ae,ni,ri,xt,qt,Mt],styles:["[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .ng-select{width:100%;font-size:15px;font-family:Inter,sans-serif;font-weight:400;outline:none;cursor:text}[_nghost-%COMP%] .ng-select .ng-select-container{border-color:#e5e6e6}[_nghost-%COMP%] .ng-select .ng-select-container .ng-placeholder{font-size:14px;top:6px!important;font-family:OpenSans,serif}[_nghost-%COMP%] .email-preview-body{color:#111827;line-height:1.5;max-width:420px;margin:0 auto}[_nghost-%COMP%] .email-preview-body p{margin:0}[_nghost-%COMP%] .email-preview-body p+p{margin-top:10px}[_nghost-%COMP%] .email-preview-body img{display:block;width:100%;max-width:360px;height:auto;border-radius:8px;margin:12px auto 0}"],data:{animation:[kr]},changeDetection:0})}}return e})();var wr=e=>({"t-tab-active t-border-b-[#9747ff]":e}),Tr=()=>["text-purple"],Mr=()=>["t-text-gray-400"];function fa(e,r){if(e&1){let t=A();a(0,"admin-quick-action-share-email",15),v("contactAdded$",function(n){k(t);let o=m();return S(o.onContactAdded(n))}),l()}if(e&2){let t,i=m();h("chartTrackingContext",i.chartTrackingContext())("chartCreatorConfig",i.chartCreatorConfig())("contactEmails",i.contactEmails())("contactsLoading",i.contactsLoading())("displayName",i.displayName())("sectionName",i.selectedSection())("sectionImageSrc",i.pngImageLink())("hasMarketNarrative",i.showMarketNarrative())("suppressMarketNarrative",i.suppressMarketNarrative())("conditionalText",i.conditionalText())("reportHash",(t=i.report())==null?null:t.hash)("selectedChart",i.selectedChart())("selectedType",i.selectedType())("hasSegments",i.hasSegments())("report",i.report())}}function _a(e,r){if(e&1){let t=A();a(0,"admin-quick-action-share-embed",16),v("sizeSelected$",function(n){k(t);let o=m();return S(o.onEmbedSizeSelected(n))})("copied$",function(n){k(t);let o=m();return S(o.onEmbedCopied(n))}),l()}if(e&2){let t=m();h("src",t.src())("chartAspectRatio",t.chartAspectRatio())}}var Ar=(()=>{class e{constructor(){this.reportDisplayNamePipe=g(Ee),this.quickActionsService=g($),this.mixpanelService=g(dt),this.chartTracking=g(wt),this.chartTrackingContext=x(null),this.close$=new xe,this.contactAdded$=new xe,this.sizeSelected$=new xe,this.copied$=new xe,this.src=x(""),this.chartAspectRatio=x(null),this.chartCreatorConfig=x(null),this.chartCreatorMarkets=x([]),this.selectedSection=x("Market Snapshot"),this.contactEmails=x([]),this.contactsLoading=x(!1),this.report=x(null),this.selectedType=x(null),this.selectedChart=x(null),this.hasWeeklyChange=x(!1),this.hasMarketNarrative=x(!1),this.hasBranding=x(!1),this.hasSegments=x(!1),this.selectedMarketSegment=x(Oe),this.suppressMarketNarrative=f(()=>{let t=this.chartCreatorConfig();return t?t.markets.length>1||t.segments.some(i=>i!==Oe):this.selectedSection()==="Market Action"&&this.selectedMarketSegment()!==Oe}),this.showMarketNarrative=f(()=>this.hasMarketNarrative()&&!this.suppressMarketNarrative()),this.marketView=x(null),this.conditionalText=x(null),this.layout=x("landscape"),this.selectedEmbedSize=x("medium"),this.activeTab=x("email"),this.displayName=f(()=>{if(this.chartCreatorConfig())return this.chartCreatorMarkets().map(i=>this.reportDisplayNamePipe.transform(i)).join(", ");let t=this.report();return t&&t.category?this.reportDisplayNamePipe.transform(this.report()):"Unknown Location"}),this.pngImageLink=f(()=>this.src()?this.generateSharedLink():""),E(()=>{this.hasMarketNarrative.set(this.quickActionsService.isShowMarketNarrative()),this.conditionalText.set(this.quickActionsService.conditionalText())})}generateSharedLink(){let t=this.selectedSection(),i=this.report().hash,n=this.selectedType()===V.HOUSES?100:this.selectedType()===V.CONDOS?200:300,o=this.showMarketNarrative()?"&market-narrative=true":"",c=this.hasWeeklyChange()?"&weekly-change=true":"",p=this.hasBranding()?"&branding=true":"",u=this.hasSegments()?"&segments=true":"",b=hi(this.marketView()),P=b?"&stats="+encodeURIComponent(b):"",D=I.altos.fabricator,nt=I.staging;if(t==="Chart Creator"&&this.chartCreatorConfig()){let j=new URLSearchParams({config:JSON.stringify(this.chartCreatorConfig()),width:"1200"});return nt&&j.set("staging","true"),`${D}/chart-creator?${j}`}if(t==="Market Snapshot")return`${D}/market-snapshot${nt?"?staging=true&uuid=":"?uuid="}${i}&type=${n}${o}${c}${p}${P}&width=500`;if(t==="Market Action"){let j=this.selectedMarketSegment()!==Oe?`&quartile=${this.selectedMarketSegment()}`:"",Wt=this.selectedType()===V.COOP?400:n;return`${D}/chart${nt?"?staging=true&uuid=":"?uuid="}${i}&chart=gauge&res_type=${Wt}${o}${c}${p}&width=400&signal=true&layout=${this.layout()}${j}`}else return`${D}/chart${nt?"?staging=true&uuid=":"?uuid="}${i}&chart=${this.convertChartMetricTypeToApiId()}&type=${n}${u}${p}&width=300`}convertChartMetricTypeToApiId(){switch(this.selectedChart()){case"price_median":return"median-list-price";case"dom_mean":return"dom-mean";case"dom_median":return"dom";case"per_sqft_median":return"price-per-sqft";case"price_decreased_percent":return"price-decreased-percent";case"price_increased_percent":return"price-increased-percent";case"relisted_percent":return"relisted-percent";case"count":return"inventory";case"mai":return"market-action-index";default:return""}}onTabClick(t){t!==this.activeTab()&&(this.trackShareTabSelected(t==="share"?"embed":"email"),this.activeTab.set(t),t==="email"&&this.chartTrackingContext()&&this.chartTracking.track("email_share_opened",{},this.chartTrackingContext()))}onClose(){this.close$.next()}onContactAdded(t){let i=String(t??"").trim().toLowerCase();i&&(this.contactEmails.update(n=>{let o=new Set(n.map(c=>
24String(c??"").trim().toLowerCase()).filter(Boolean));return o.add(i),Array.from(o).sort((c,p)=>c.localeCompare(p))}),this.contactAdded$.next(i))}onEmbedSizeSelected(t){let i=this.selectedEmbedSize();this.selectedEmbedSize.set(t),this.sizeSelected$.next(t),this.mixpanelService.onTrackAdmin("qa_embed_size_select",{asset_type:this.getAssetType(),embed_size:t,previous_embed_size:i??null,embed_dimensions:this.getEmbedDimensions(t)})}onEmbedCopied(t){this.chartTrackingContext()&&this.chartTracking.track("embed_copied",t,this.chartTrackingContext()),this.copied$.next(t),this.mixpanelService.onTrackAdmin("qa_embed_copy_click",{asset_type:this.getAssetType(),embed_size:t.embed_size||this.selectedEmbedSize(),embed_dimensions:t.embed_dimensions||this.getEmbedDimensions(this.selectedEmbedSize()),copy_method:"button"})}trackShareTabSelected(t){this.mixpanelService.onTrackAdmin("qa_share_tab_select",{asset_type:this.getAssetType(),tab:t}),t==="embed"&&this.mixpanelService.onTrackAdmin("qa_share_embed_tab_click",{asset_type:this.getAssetType(),default_embed_size:this.selectedEmbedSize()??null})}getAssetType(){return jt(this.selectedSection())}getEmbedDimensions(t){switch(t){case"small":return"360x450";case"medium":return"480x600";case"large":return"640x800";case"xl":return"800x1000";default:return""}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-embed-modal"]],hostAttrs:[1,"t-contents"],features:[Xt([Ee])],decls:21,vars:16,consts:[["role","dialog","aria-modal","true","tabindex","-1",1,"t-relative","t-w-full","t-max-w-[860px]","t-bg-white","t-shadow-lg","t-border","t-border-gray-200","t-p-[20px]","sm:t-p-[22px]",3,"click"],[1,"t-flex","t-justify-between","t-items-start"],[1,"t-text-[22px]","t-font-bold","t-mb-4","font-scale","t-m-0"],["type","button",1,"t-opacity-70","hover:t-opacity-100","t-transition-opacity","focus:t-outline-none","focus:t-ring-2","focus:t-ring-[#9747FF]","focus:t-ring-offset-2",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"t-size-[20px]"],["d","M18 6 6 18"],["d","m6 6 12 12"],[1,"t-sr-only"],[1,"t-border-b-[2px]","t-border-gray-200","t-mt-4"],["role","tablist",1,"t-tabs","t-tabs-bordered","t-inline-flex","t-m-0","t-relative","-t-bottom-[2px]"],[1,"t-tab","t-text-[14px]","font-hanken","t-h-[40px]","hover:t-bg-gray-50","t-transition","t-border-b-[2px]","t-border-gray-200",3,"click","ngClass"],[1,"t-no-underline",3,"ngClass"],[1,"t-relative","t-overflow-hidden"],[3,"chartTrackingContext","chartCreatorConfig","contactEmails","contactsLoading","displayName","sectionName","sectionImageSrc","hasMarketNarrative","suppressMarketNarrative","conditionalText","reportHash","selectedChart","selectedType","hasSegments","report"],[3,"src","chartAspectRatio"],[3,"contactAdded$","chartTrackingContext","chartCreatorConfig","contactEmails","contactsLoading","displayName","sectionName","sectionImageSrc","hasMarketNarrative","suppressMarketNarrative","conditionalText","reportHash","selectedChart","selectedType","hasSegments","report"],[3,"sizeSelected$","copied$","src","chartAspectRatio"]],template:function(i,n){i&1&&(a(0,"div",0),v("click",function(c){return c.stopPropagation()}),a(1,"div",1)(2,"h1",2),d(3),l(),a(4,"button",3),v("click",function(){return n.onClose()}),F(),a(5,"svg",4),y(6,"path",5)(7,"path",6),l(),ht(),a(8,"span",7),d(9,"Close"),l()()(),a(10,"div",8)(11,"ul",9)(12,"li",10),v("click",function(){return n.onTabClick("email")}),a(13,"a",11),d(14," Share via Email "),l()(),a(15,"li",10),v("click",function(){return n.onTabClick("share")}),a(16,"a",11),d(17),l()()()(),a(18,"div",12),C(19,fa,1,15,"admin-quick-action-share-email",13)(20,_a,1,2,"admin-quick-action-share-embed",14),l()()),i&2&&(s(3),M(" Share ",n.selectedSection()," "),s(9),h("ngClass",ut(8,wr,n.activeTab()==="email")),s(),h("ngClass",n.activeTab()==="email"?J(10,Tr):J(11,Mr)),s(2),h("ngClass",ut(12,wr,n.activeTab()==="share")),s(),h("ngClass",n.activeTab()==="share"?J(14,Tr):J(15,Mr)),s(),M(" Embed ",n.selectedSection()," "),s(),h("@shareTabTransition",n.activeTab()),s(),_(n.activeTab()==="email"?19:20))},dependencies:[Be,Rt,hr,br],encapsulation:2,data:{animation:[At("shareTabTransition",[tt("email => share",[ie([vt(":leave",[O({position:"absolute",top:0,left:0,width:"100%"}),B("220ms ease-in-out",O({opacity:0,transform:"translateX(28px)"}))],{optional:!0}),vt(":enter",[O({opacity:0,transform:"translateX(-28px)"}),B("220ms ease-in-out",O({opacity:1,transform:"translateX(0)"}))],{optional:!0})])]),tt("share => email",[ie([vt(":leave",[O({position:"absolute",top:0,left:0,width:"100%"}),B("220ms ease-in-out",O({opacity:0,transform:"translateX(-28px)"}))],{optional:!0}),vt(":enter",[O({opacity:0,transform:"translateX(28px)"}),B("220ms ease-in-out",O({opacity:1,transform:"translateX(0)"}))],{optional:!0})])])])]},changeDetection:0})}}return e})();var xa=["selectRef"],ya=["qrCode"],va=e=>({"aria-label":e});function ka(e,r){if(e&1&&(a(0,"span",21),d(1),l()),e&2){let t=m().item;s(),M(" ",t.category," ")}}function Sa(e,r){if(e&1){let t=A();a(0,"span",18)(1,"span",19),d(2),bi(3,"reportDisplayName"),l(),a(4,"button",20),v("click",function(n){let o=k(t),c=o.item,p=o.clear;return p(c),S(n.stopPropagation())}),d(5," \xD7 "),l()(),C(6,ka,2,1,"span",21)}if(e&2){let t=r.item,i=r.disabled,n=m();s(2),q(wi(3,3,t)),s(2),h("disabled",i),s(2),_(n.isChartCreator()?-1:6)}}function ba(e,r){if(e&1&&(a(0,"div",22)(1,"span",23),d(2),bi(3,"reportDisplayName"),l(),a(4,"span",24),d(5),l()()),e&2){let t=r.item;s(2),q(wi(3,2,t)),s(3),M(" ",t.category," ")}}function wa(e,r){e&1&&(a(0,"div",25),d(1,"No reports found"),l())}function Ta(e,r){e&1&&(a(0,"div",31),y(1,"div",42)(2,"div",43),l())}function Ma(e,r){if(e&1){let t=A();a(0,"div",44,2)(2,"div",45)(3,"div",46),d(4,"NEW: Share this with your clients!"),l(
24),a(5,"button",47),v("click",function(){k(t);let n=m(2);return S(n.closeSharePopover())}),F(),a(6,"svg",48),y(7,"path",49)(8,"path",50),l(),ht(),a(9,"span",51),d(10,"Close"),l()(),y(11,"div",52),l()()}if(e&2){let t=L(1);m();let i=L(2);we("transform","translateX("+(-t.offsetWidth+i.offsetWidth)+"px) translateY(10px)")}}function Aa(e,r){if(e&1){let t=A();a(0,"div",26)(1,"button",27,1),v("click",function(){k(t);let n=m();return S(n.openEmbed())}),F(),a(3,"svg",28),y(4,"path",29),l(),ht(),a(5,"span",30),d(6,"Share"),l(),C(7,Ta,3,0,"div",31),l(),C(8,Ma,12,2,"div",32),l(),a(9,"div",33)(10,"button",34),v("click",function(n){k(t);let o=m();return S(o.toggleAssetDownloadMenu(n))}),F(),a(11,"svg",35)(12,"g",36)(13,"g",37),y(14,"path",38)(15,"path",39),l()()(),ht(),a(16,"span",30),d(17,"Download"),l()(),a(18,"div",40),v("click",function(n){k(t);let o=m();return S(o.onDropdownContentClick(n))}),a(19,"button",41),v("click",function(){k(t);let n=m();return S(n.onAssetDownload("png"))}),d(20," PNG "),l(),a(21,"button",41),v("click",function(){k(t);let n=m();return S(n.onAssetDownload("jpeg"))}),d(22," JPEG "),l(),a(23,"button",41),v("click",function(){k(t);let n=m();return S(n.onAssetDownload("svg"))}),d(24," SVG "),l()()()}if(e&2){let t=m();s(),h("disabled",!t.selectedReport()||t.comparisonUnavailable()),s(6),_(t.isSharePopoverOpened()?7:-1),s(),_(t.isSharePopoverOpened()?8:-1),s(),rt("t-dropdown-open",t.isAssetDownloadMenuOpen()),s(),h("disabled",!t.selectedReport()||t.isScreenshot()||t.comparisonUnavailable()),s(8),rt("t-block",t.isAssetDownloadMenuOpen())("t-hidden",!t.isAssetDownloadMenuOpen())}}function Pa(e,r){if(e&1){let t=A();a(0,"button",53),v("cbOnSuccess",function(){k(t);let n=m();return S(n.cbSuccess())})("click",function(){k(t);let n=m();return S(n.trackMarketReportLinkCopied())}),F(),a(1,"svg",54)(2,"g",55)(3,"g",37),y(4,"path",56)(5,"path",57),l()()(),ht(),a(6,"span",30),d(7,"Copy Link"),l()(),a(8,"div",33)(9,"button",34),v("click",function(n){k(t);let o=m();return S(o.toggleReportDownloadMenu(n))}),F(),a(10,"svg",35)(11,"g",36)(12,"g",37),y(13,"path",38)(14,"path",39),l()()(),ht(),a(15,"span",30),d(16,"Download"),l()(),a(17,"ul",58),v("click",function(n){k(t);let o=m();return S(o.onDropdownContentClick(n))}),a(18,"li",59),v("click",function(){k(t);let n=m();return S(n.onReportDownload("single"))}),d(19," Single Page PDF "),l(),a(20,"li",60),v("click",function(){k(t);let n=m();return S(n.onReportDownload("full"))}),d(21," Full Report PDF "),l(),a(22,"li",59),v("click",function(){k(t);let n=m();return S(n.onReportDownload("code"))}),d(23," QR Code "),y(24,"qrcode",61,3),l()()()}if(e&2){let t=m();h("cbContent",t.copyLink())("disabled",!t.selectedReport()),s(8),rt("t-dropdown-open",t.isReportDownloadMenuOpen()),s(),h("disabled",!t.selectedReport()),s(8),rt("t-block",t.isReportDownloadMenuOpen())("t-hidden",!t.isReportDownloadMenuOpen()),s(3),h("ngClass",t.accountTypes().freemium?"t-text-gray-300":"hover:text-purple"),s(4),h("qrdata",t.generatedLink())("width",256)("imageSrc","/assets/images/favicon-bg.png")("errorCorrectionLevel","M")}}function Ea(e,r){if(e&1&&(a(0,"div",16),d(1),l()),e&2){let t=m();s(),M(" ",t.filteredReports().length," result(s) ")}}function Oa(e,r){if(e&1&&(a(0,"p",17),d(1),l()),e&2){let t=m();s(),q(t.marketSelectionHint())}}var Da=500,Er=(()=>{class e{onDocumentClick(){this.closeDownloadMenus()}constructor(){this.router=g(te),this.route=g(an),this.quickActionsService=g($),this.chartCreatorState=g(bt),this.comparison=g(zt),this.chartTracking=g(wt),this.platformId=g(Fe),this.upgradeService=g(ee),this.modalService=g(Ut),this.toastService=g(yt),this.mixpanelService=g(dt),this.mobileService=g(Ft),this.adminApiService=g(Nt),this.filteredReports=T([]),this.isLoading=T(!1),this.chartData=T(null),this.accountTypes=T({freemium:!0,lite:!1,professional:!1,premium:!1,advanced:!1,accountTypesWasTriggered:!1}),this.selectedReport=vi(),this.query=vi(""),this.startDate=x(null),this.endDate=x(null),this.defaultReportWasSelected=x(!1),this.sizePreset=this.quickActionsService.size,this.isScreenshot=this.quickActionsService.isScreenshot,this.isMobile=this.mobileService.isMobile,this.isAssetDownloadMenuOpen=x(!1),this.isReportDownloadMenuOpen=x(!1),this.contactEmails=x([]),this.contactsLoading=x(!1),this.contactsLoaded=x(!1),this.isSharePopoverOpened=x(!1),this.sharePopoverKey="share_highlight_first_seen_at",this.deleteDate=new Date("2026-04-28T00:00:00.000Z"),this.isChartCreator=f(()=>this.activeRoute()?.path==="chart-creator"),this.comparisonHashes=f(()=>this.comparison.markets().map(t=>t.hash)),this.marketSelectionHint=f(()=>{let t=Math.max(0,3-this.comparison.markets().length);return t===3?"Select up to 3 markets":t===0?"3 of 3 markets selected":`You can add ${t} more ${t===1?"market":"markets"}`}),this.reportOptions=f(()=>{if(!this.isChartCreator())return this.filteredReports();let t=this.comparison.markets(),i=new Set(t.map(n=>n.hash));return[...t,...this.filteredReports().filter(n=>!i.has(n.hash))]}),this.comparisonUnavailable=f(()=>this.isChartCreator()&&!this.comparison.hasData()),this.isFreemium=f(()=>this.accountTypes().freemium),this.isLite=f(()=>this.accountTypes().lite),this.selectedReportHash=f(()=>this.selectedReport()?.hash),this.generatedLink=f(()=>{let t=this.quickActionsService.chartType(),i=this.quickActionsService.reportType(),n=V.CONDOS==t?"?condos=true":V.COOP===t?"?coop=true":"",o=i==="single"?"ps":"p";return I.altos.cloudfront+"/"+o+"/"+this.selectedReportHash()+n}),this.copyLink=f(()=>{let t=this.selectedReport(),i=this.quickActionsService.chartType(),n=V.CONDOS==i?"?condos=true":V.COOP===i?"?coop=true":"";return I.altos.baseUrl+"/r/"+t?.hash+n}),this.REPORT_ID_MAP={"market-snapshot":"quick-market-snapshot","market-action":"quick-market-action","chart-creator":"quick-chart-creator"},this.CHART_CREATOR_BASE_W={square:750,landscape:938,portrait:600},this.fontCache=new Map,this.FONTS_TO_EMBED=[{family:"Hanken Grotesk",src:"/assets/fonts/subsets/HankenGrotesk-Variable-latin.woff2",weight:"100 900"},{family:"Open Sans",src:"/assets/fonts/subsets/OpenSans-Regular-latin.woff2",weight:"normal"},{family:"Open Sans",src:"/assets/fonts/subsets/OpenSans-Bold-latin.woff2",weight:"bold"},{family:"Open Sans",src:"/assets/fonts/subsets/OpenSans-Semibold-latin.woff2",weight:"600"},{family:"Inter",src:"/assets/fonts/subsets/Inter_18pt-Regular-latin.woff2",weight:"400"},{family:"Inter",src:"/assets/fonts/subsets/Inter_18pt-Bold-latin.woff2",weight:"700"}],this.deepestRoute$=this.router.events.pipe(Zt(t=>t instanceof je),ve(null),lt(()=>{let t=this.route;for(;t.firstChild;)t=t.firstChild;return t})),this.activeRoute=K(this.deepestRoute$.pipe(ke(t=>t.url),lt(t=>t.at(0)))),this.routerData=K(this.deepestRoute$.pipe(ke(t=>t.data),ve({title:null,description:null})),{requireSync:!0}),this.trackById=t=>t.id,Zi(()=>{new Date<=this.deleteDate&&this.showSharePopover()}),E(()=>{let t=this.activeRoute()?.path;this.quickActionsService.activeSection.set(t)}),E(()=>{let t=this.filteredReports(),i=pt(()=>this.defaultReportWasSelected()),n=this.accountTypes();if(t.length&&!i&&n.accountTypesWasTriggered)if(pt(()=>this.isFreemium())){let c=t.find(p=>p.category==="ZIP");c&&(this.defaultReportWasSelected.set(!0),this.setReport(c))}else{let c=t.find(p=>p.isDefault);c&&(this.defaultReportWasSelected.set(!0),this.setReport(c))}}),E(()=>{let t=this.quickActionsService.openShareSchedule,i=this.selectedReport();if(!i){let n=this.filteredReports();if(n.length===0)return;this.selectedReport.set(n[0])}t()&&i&&(t.set(!1),setTimeout(()=>this.openEmbed(),500))}),this.loadContactEmails()}onSearch(t){this.query.set(t??"")}setReport(t){this.selectedReport.set(t)}onReportSelectionChange(t){if(!this.isChartCreator()){this.setReport(t);return}let i=Array.isArray(t)?t:t?[t]:[];this.chartTracking.setMarkets(i);let n=i[0];n&&n.hash!==this.selectedReport()?.hash&&this.setReport(n)}loadContactEmails(){return w(this,null,function*(){if(!(this.contactsLoaded()||this.contactsLoading())){this.contactsLoading.set(!0);try{let t=yield Ht(this.adminApiService.getContacts(1,Da,"","added",{})),i=Array.isArray(t?.results)?t.results:[],n=new Set,o=[];for(let c of i){let p=String(c?.email??"").trim().toLowerCase();!p||!/^[^\s@]+@[^\s@]+\.[^\s@]{2,}
24$/.test(p)||n.has(p)||(n.add(p),o.push(p))}o.sort((c,p)=>c.localeCompare(p)),this.contactEmails.set(o),this.contactsLoaded.set(!0)}catch(t){console.error(t),this.toastService.showErrorToast("Failed to load contact emails")}finally{this.contactsLoading.set(!1)}}})}downloadReportPdf(t){if(!Ct(this.platformId))return;let i=this.quickActionsService.selectedChart(),n=this.quickActionsService.chartType(),o=n===V.HOUSES?"":n===V.CONDOS?"&condos=true":"&coop=true";if(t==="single")this.trackMarketReportDownloadedTrigger("pdf",t),window.open(I.altos.cloudfront+"/ps/"+this.selectedReport().hash+"?data="+i+o,"_blank");else if(t==="full"){if(this.accountTypes().freemium)return this.upgradePlan();this.trackMarketReportDownloadedTrigger("pdf",t),window.open(I.altos.cloudfront+"/p/"+this.selectedReport().hash+o.replace("&","?"),"_blank")}else this.downloadQR()}download(t="png"){if(!Ct(this.platformId))return;let i=this.activeRoute()?.path;if(!i||!this.REPORT_ID_MAP[i])return;let n="#"+this.REPORT_ID_MAP[i],o=document.querySelector(n);if(o){this.isChartCreator()&&this.chartTracking.track("download_clicked",{asset_format:this.sizePreset(),image_format:t,value_pinned:!1});let c=(this.selectedReport()?.reportName??"chart").trim().replace(/\s+/g,"_").replace(/[^\w\-]+/g,""),p=`${i}_${c}_${this.sizePreset()}`;this.downloadElementAsImage(o,p,t)}}getActiveFormatId(){let t=this.quickActionsService.size();return Pt[t]?t:"square"}injectHighchartsSvgIntoClone(t,i,n){let o=this.quickActionsService.selectedHighchart();if(!o)return;let c=t.querySelector("[data-hc-host]")??t.querySelector(".highcharts-container")?.parentElement??null;if(!c)return;let p=n==="portrait"?967:650;c.style.width=`${i}px`,c.style.height=`${p}px`,c.style.overflow="hidden",c.innerHTML=o.getSVGForExport({sourceWidth:i,sourceHeight:p,scale:1},{chart:{width:i,height:p,backgroundColor:"#ffffff",animation:!1},exporting:{allowHTML:!1},title:{width:i*.85,x:i*.85/2,style:{fontSize:`${parseFloat(o.options.title.style.fontSize)*i/o.chartWidth}px`}},plotOptions:{series:{animation:!1}}});let u=c.querySelector("svg");u&&(u.setAttribute("width",String(i)),u.setAttribute("height",String(p)),u.style.width=`${i}px`,u.style.height=`${p}px`,u.style.display="block")}withOffscreenClone(t,i,n){return w(this,null,function*(){let o=document.createElement("div");o.style.position="fixed",o.style.left="-100000px",o.style.top="0",o.style.width=`${i}px`,o.style.background="#fff",o.style.pointerEvents="none",o.style.zIndex="-1";let c=t.cloneNode(!0);t.id==="quick-chart-creator"&&c.querySelectorAll("[data-chart-ui-only]").forEach(u=>u.remove()),t.id==="quick-market-action"&&!this.quickActionsService.showMarketNarrative()&&c.querySelector("[data-market-narrative]")?.remove(),c.style.width=`${i}px`,c.style.minWidth=`${i}px`,c.style.maxWidth=`${i}px`,c.style.boxSizing="border-box",c.style.height="auto",c.style.transform="none",c.style.margin="0",o.appendChild(c),document.body.appendChild(o),yield new Promise(u=>requestAnimationFrame(()=>requestAnimationFrame(()=>u())));let p=c.getBoundingClientRect();try{return yield n(c,p)}finally{o.remove()}})}fetchFontAsBase64(t){return w(this,null,function*(){if(this.fontCache.has(t))return this.fontCache.get(t);try{let i=yield fetch(t);if(!i.ok)return console.warn(`Failed to fetch font: ${t}`),"";let n=yield i.blob();return new Promise(o=>{let c=new FileReader;c.onloadend=()=>{let p=c.result;this.fontCache.set(t,p),o(p)},c.onerror=()=>{console.warn(`Failed to read font as base64: ${t}`),o("")},c.readAsDataURL(n)})}catch(i){return console.warn(`Error fetching font ${t}:`,i),""}})}buildFontEmbedCSSSafe(){return w(this,null,function*(){document.fonts?.ready&&(yield document.fonts.ready);let t=[];for(let i of this.FONTS_TO_EMBED){let n=yield this.fetchFontAsBase64(i.src);if(n){let o=i.src.endsWith(".woff2")?"woff2":i.src.endsWith(".woff")?"woff":i.src.endsWith(".otf")?"opentype":"truetype";t.push(` 25 @font-face { 26 font-family: '${i.family}'; 27 src: url('${n}') format('${o}'); 28 font-weight: ${i.weight||"normal"}; 29 font-style: ${i.style||"normal"}; 30 font-display: swap; 31 } 32 `)}}return t.join(` 33`)})}downloadElementAsImage(t,i,n="png"){return w(this,null,function*(){if(Ct(this.platformId)){this.handleClick(),this.quickActionsService.isScreenshot.set(!0),yield new Promise(o=>requestAnimationFrame(()=>requestAnimationFrame(()=>o())));try{let o=this.getActiveFormatId(),c=Pt[o],p=this.sizePreset(),b=t.id==="quick-chart-creator"?this.CHART_CREATOR_BASE_W[p]:t.id.includes("market-snapshot")?c.marketSnapshot.width:c.marketAction.width,P=yield this.withOffscreenClone(t,b,j=>w(this,null,function*(){let Wt=c.dimensions.width,$t=8;t.id==="quick-chart-creator"&&(this.injectHighchartsSvgIntoClone(j,b,this.sizePreset()),yield new Promise(ct=>requestAnimationFrame(()=>ct())));let ft=j.getBoundingClientRect(),Ce=Wt/ft.width,Le=Math.ceil(ft.height*Ce);this.isMobile()&&t.id.includes("market-snapshot")&&this.setMobileMarketSnapshotStyles(j);
33let xi=yield this.buildFontEmbedCSSSafe(),R={width:Wt+$t,height:Le+$t,fontEmbedCSS:xi,backgroundColor:"#ffffff",cacheBust:!0,style:{transform:`scale(${Ce})`,transformOrigin:"top left",fontFamily:'"Hanken Grotesk", "Open Sans", "Inter", sans-serif',width:`${ft.width}px`,height:`${ft.height}px`,margin:"0",padding:"0",left:"0",top:"0"},filter:ct=>{if(ct.tagName==="LINK"){let Et=ct.href||"";return!Et.includes("typekit")&&!Et.includes("myfonts")}return!0}};return n==="svg"?Ri(j,R):n==="jpeg"?dr(j,W(z({},R),{quality:.95})):mr(j,R)})),nt=yield(yield fetch(P)).blob();(0,Pr.saveAs)(nt,`${i}.${n}`),this.trackAssetDownloadedTrigger(n)}catch(o){console.error("Export error:",o)}finally{this.quickActionsService.isScreenshot.set(!1)}}})}setMobileMarketSnapshotStyles(t){let i=t.querySelectorAll(".type_name"),n=t.querySelectorAll(".price_name"),o=t.querySelectorAll(".weekly_name");i.forEach(c=>c.setAttribute("style","font-size: 18px!important")),n.forEach(c=>c.setAttribute("style","font-size: 24px!important")),o.forEach(c=>c.setAttribute("style","font-size: 15px!important"))}downloadQR(){if(!Ct(this.platformId))return;let t=this.qrCodeEl.nativeElement.querySelector("canvas");t&&t.toBlob(i=>{if(!i)return;let n=URL.createObjectURL(i),o=document.createElement("a");o.href=n,o.download=this.selectedReport().hash+".png",o.click(),URL.revokeObjectURL(n),this.trackMarketReportDownloadedTrigger("qr")})}upgradePlan(){let t=Dn.open(this.modalService,{free:this.upgradeService.getFreePlan(),professional:this.upgradeService.getProfessionalPlan()});t.content.comparePlanButtonClicked$$.pipe(Kt(t.onHidden)).subscribe(()=>{Bt.open(this.modalService,{pricing:[this.upgradeService.getLitePlan(),this.upgradeService.getProfessionalPlan(),this.upgradeService.getAdvancedPlan()]})})}upgradeProAdvancedPlans(){Bt.open(this.modalService,{pricing:[this.upgradeService.getProfessionalPlan(),this.upgradeService.getAdvancedPlan()],custom:{customTitle:"Send this
33snapshot to your clients",customSubtitle:"One click email share starts with Professional."}})}handleClick(){if(Ct(this.platformId)){let t=document.activeElement;t&&t.blur()}}cbSuccess(){this.toastService.showSuccessToast("Link copied to clipboard",1500)}openEmbed(){return w(this,null,function*(){if(this.comparisonUnavailable())return;if(this.trackShareClickTrigger(),this.isFreemium()||this.isLite())return this.upgradeProAdvancedPlans();let t=this.isChartCreator()?this.chartTracking.context():null,i=this.quickActionsService,n=this.selectedReport(),o=i.showMarketNarrative(),c=this.activeRoute(),p=i.chartType(),u=p===V.HOUSES?"&houses=true":p===V.CONDOS?"&condos=true":"&coop=true",b=i.hasBranding(),P=i.isShowWeeklyChange(),D=i.selectedChart(),nt=hi(i.marketView()),j=b?"&branding=true":"",Wt=nt?"&stats="+encodeURIComponent(nt):"",$t=c?.path,ft="",Ce=null,Le=null,xi=this.isChartCreator()?[...this.comparison.markets()]:[];if($t==="market-snapshot"){let ct=o?"&marketNarrative=true":"",Et=P?"&weeklyChange=true":"";ft=I.altos.baseUrl+"/html/s-html/"+n?.hash+"?scale=1"+ct+u+Et+Wt+(j.length===0?"&branding=false":j)}else if($t==="market-action"){let ct=o?"&marketNarrative=true":"";ft=I.altos.baseUrl+"/html/m-html/"+n?.hash+"?scale=1"+u+ct+j}else if($t==="chart-creator"){let ct=i.selectedHighchart()?.options.title?.text?.replace(/<br\s*\/?>/g," "),Et=this.comparison.titleCandidates().find(Tt=>zn(Tt)===ct)??this.comparison.title(),Gt={version:1,markets:this.comparison.markets().map(Tt=>Tt.hash),metric:this.chartCreatorState.selectedChart(),segments:[...this.chartCreatorState.segments()],median:this.comparison.median(),propertyType:i.dataType(),span:this.comparison.timeframe().span,layout:i.size(),branding:b,title:Et};Le=Gt,ft=`${I.altos.baseUrl}/i-html/${Gt.markets[0]}/compare?${new URLSearchParams({config:JSON.stringify(Gt)})}`;let Ot=document.getElementById("quick-chart-creator");if(Ot){let Tt=Ot.querySelector("[data-chart-ui-only]"),zr=Tt?Tt.offsetHeight+parseFloat(getComputedStyle(Tt).marginBottom||"0"):0,Ui=Ot.offsetHeight-zr;Ui>0&&(Ce=Ot.offsetWidth/Ui)}}else $t==="market-reports"&&(ft=I.altos.baseUrl+"/r/"+n?.hash+u);yield this.loadContactEmails(),this.closeSharePopover();let R=this.modalService.show(Ar);this.trackShareModalOpenTrigger(),R.content.report.set(n),R.content.src.set(ft),R.content.chartAspectRatio.set(Ce),R.content.chartCreatorConfig.set(Le),R.content.chartCreatorMarkets.set(xi),R.content.selectedSection.set(this.routerData()?.title),R.content.contactEmails.set(this.contactEmails()),R.content.contactsLoading.set(this.contactsLoading()),R.content.selectedType.set(p),R.content.selectedChart.set(D),R.content.hasWeeklyChange.set(i.isShowWeeklyChange()),R.content.hasMarketNarrative.set(i.showMarketNarrative()),R.content.conditionalText.set(i.conditionalText()),R.content.hasBranding.set(i.hasBranding()),R.content.hasSegments.set(i.hasSegments()),R.content.selectedMarketSegment.set(i.selectedMarketSegment()),R.content.marketView.set(i.marketView()),R.content.layout.set(i.size()),t&&(R.content.chartTrackingContext.set(t),this.chartTracking.track("email_share_opened",{},t)),R.content.contactAdded$.pipe(Kt(R.onHidden)).subscribe(ct=>{this.contactEmails.update(Et=>{let Gt=new Set(Et.map(Ot=>String(Ot??"").trim().toLowerCase()).filter(Boolean));return Gt.add(ct),Array.from(Gt).sort((Ot,Tt)=>Ot.localeCompare(Tt))}),this.contactsLoaded.set(!0)}),R.content.close$.pipe(Kt(R.onHidden)).subscribe(()=>{R.hide()})})}trackShareClickTrigger(){this.isChartCreator()&&this.chartTracking.track("share_clicked"),this.mixpanelService.onTrackAdmin("qa_share_click",{asset_type:jt(this.activeRoute()?.path),location:this.selectedReport()?.displayName??"",user_plan:ue(this.accountTypes())})}trackShareModalOpenTrigger(){this.mixpanelService.onTrackAdmin("qa_share_modal_open",{asset_type:jt(this.activeRoute()?.path)})}trackMarketReportDownloadedTrigger(t,i=null){let n=this.quickActionsService,o={report_type:i??n.reportType(),download_format:t,property_type:n.chartType().toLowerCase(),location_type:n.selectedReport()?.category.toLowerCase()??"",location_id:n.selectedReport()?.dis
33playName??"",surface:"quick_actions"};this.mixpanelService.onTrackAdmin("QA Market Report Downloaded",o)}trackMarketReportLinkCopied(){if(!this.selectedReport())return;let t=this.quickActionsService,i={report_type:t.reportType(),property_type:t.chartType().toLowerCase(),location_type:t.selectedReport()?.category.toLowerCase()??"",location_id:t.selectedReport()?.displayName??"",surface:"quick_actions"};this.mixpanelService.onTrackAdmin("QA Market Report Link Copied",i)}trackAssetDownloadedTrigger(t){let i=this.quickActionsService,n={asset_type:i.activeSection().replace(/-/g,"_"),image_format:t,layout:i.size(),property_type:i.chartType().toLowerCase(),branding_enabled:i.hasBranding(),weekly_change_enabled:i.isShowWeeklyChange(),market_narrative_enabled:i.showMarketNarrative(),location_type:i.selectedReport()?.category.toLowerCase()??"",location_id:i.selectedReport()?.displayName??"",surface:"quick_actions_panel",is_fully_customized:i.hasBranding()&&i.isShowWeeklyChange()&&i.showMarketNarrative(),is_social_format:"layout in "+i.size()};this.mixpanelService.onTrackAdmin("QA Asset Downloaded",n)}trackAssetViewedTrigger(){let t=this.quickActionsService,i={asset_type:t.activeSection().replace(/-/g,"_"),entry_point:"quick_actions_panel",property_type:t.chartType().toLowerCase(),layout:t.size(),branding_enabled:t.hasBranding(),weekly_change_enabled:t.isShowWeeklyChange(),market_narrative_enabled:t.showMarketNarrative()};this.mixpanelService.onTrackAdmin("QA Asset Viewed",i)}toggleAssetDownloadMenu(t){if(t.stopPropagation(),!this.selectedReport()||this.isScreenshot())return;let i=!this.isAssetDownloadMenuOpen();this.isAssetDownloadMenuOpen.set(i),this.isReportDownloadMenuOpen.set(!1),i&&this.trackAssetViewedTrigger()}toggleReportDownloadMenu(t){if(t.stopPropagation(),!this.selectedReport())return;let i=!this.isReportDownloadMenuOpen();this.isReportDownloadMenuOpen.set(i),this.isAssetDownloadMenuOpen.set(!1)}onAssetDownload(t){this.closeDownloadMenus(),this.download(t)}onReportDownload(t){this.closeDownloadMenus(),this.downloadReportPdf(t)}onDropdownContentClick(t){t.stopPropagation()}closeDownloadMenus(){this.isAssetDownloadMenuOpen.set(!1),this.isReportDownloadMenuOpen.set(!1)}showSharePopover(){if(!Ct(this.platformId))return;let t=this.sharePopoverKey;localStorage.getItem(t)||this.isSharePopoverOpened.set(!0)}closeSharePopover(){if(Ct(this.platformId)){let t=this.sharePopoverKey;if(localStorage.getItem(t))return;this.isSharePopoverOpened.set(!1),localStorage.setItem(t,"1")}}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-header"]],viewQuery:function(i,n){if(i&1&&(Te(xa,5),Te(ya,5,Gi)),i&2){let o;Me(o=Ae())&&(n.selectRef=o.first),Me(o=Ae())&&(n.qrCodeEl=o.first)}},hostBindings:function(i,n){i&1&&v("click",function(){return n.onDocumentClick()},!1,Ki)},inputs:{filteredReports:[1,"filteredReports"],isLoading:[1,"isLoading"],chartData:[1,"chartData"],accountTypes:[1,"accountTypes"],selectedReport:[1,"selectedReport"],query:[1,"query"]},outputs:{selectedReport:"selectedReportChange",query:"queryChange"},decls:19,vars:22,consts:[["selectRef",""],["shareButton",""],["sharePopover",""],["qrCode",""],[1,"t-space-y-2"],[1,"font-scale","t-text-[24px]","t-font-semibold","title","t-m-0"],[1,"font-hanken","t-text-[16px]","t-text-gray-500","description"],[1,"t-relative","t-w-full","t-mt-8","t-flex","t-gap-4","t-items-center"],[1,"t-join","t-flex-1","t-m-0","t-w-full","t-input","t-input-bordered","t-flex","t-items-center","t-gap-0","md:t-gap-2","t-h-[40px]","t-rounded-2xl","focus-within:t-outline-purple-400","label-input"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke-width","1.5","stroke","currentColor",1,"t-join-item","t-size-5","md:t-size-6","t-block","t-transition"],["stroke-linecap","round","stroke-linejoin","round","d","m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"],["bindLabel","reportName","bindValue","hash",1,"t-w-full",3,"search","change","focus","items","searchable","clearable","virtualScroll","ngModel","multiple","maxSelectedItems","hideSelected","closeOnSelect","trackByFn","loading","placeholder","inputAttrs"],["ng-label-tmp",""],["ng-option-tmp",""],["ng-notfound-tmp",""],[1,"t-flex","
33sm:t-grid","t-grid-cols-2","t-items-center","t-gap-4","action-buttons","t-w-auto","sm:t-w-[276px]","t-ml-[10px]"],[1,"t-absolute","t-right-2","t-top-[-18px]","t-text-[11px]","t-text-gray-400"],["role","status",1,"t-mt-2","t-mb-0","t-text-[12px]","t-text-gray-500","font-hanken"],[1,"t-inline-flex","t-max-w-full","t-items-center","t-gap-[2px]","md:t-gap-[6px]","t-text-[12px]","md:t-text-[14px]","t-rounded","t-p-2","bg-purple","t-text-white"],[1,"t-min-w-0","t-break-words"],["type","button","aria-label","Remove",1,"t-leading-none","t-ml-[2px]","t-text-white","t-z-10","t-cursor-pointer",3,"click","disabled"],[1,"t-absolute","t-right-0","md:t-right-4","t-z-10","t-top-[1.35rem]","t-badge","t-badge-outline","bg-purple","t-badge-sm","md:t-badge-md","t-text-white"],[1,"t-flex","t-items-center","t-justify-between","t-w-full"],[1,"t-text-[12px]","md:t-text-[14px]"],[1,"t-badge","t-badge-outline","t-badge-sm","md:t-badge-md","t-text-gray-500","t-border-gray-500"],[1,"t-py-[6px]","t-text-[13px]","t-text-gray-500"],[1,"t-relative"],["type","button",1,"t-btn","t-h-[36px]","btn-navy-outline","t-text-[14px]","font-cofo-mono","t-group","t-w-full",3,"click","disabled"],["stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","height","12","width","12","xmlns","http://www.w3.org/2000/svg","viewBox","0 0 512 512",1,"t-size-4"],["d","M512 230.431 283.498 44.621v94.807C60.776 141.244-21.842 307.324 4.826 467.379c48.696-99.493 149.915-138.677 278.672-143.14v92.003z",1,"t-fill-[#001140]","group-hover:t-fill-white"],[1,"t-hidden","md:t-block"],[1,"t-absolute","-t-top-2","-t-right-2","t-flex","t-size-5"],[1,"sharePopover","t-absolute","t-top-full","t-left-0","bg-purple","t-text-white","t-shadow-md","t-rounded-md","t-p-4","t-z-50","t-w-max","t-text-center",3,"transform"],[1,"t-dropdown","t-dropdown-end"],["type","button",1,"t-btn","t-h-[36px]","btn-purple","t-text-[14px]","font-cofo-mono","[&_svg]:t-fill-white","[&_svg]:t-size-6","[&_svg]:hover:t-fill-[#9747FF]","t-w-full",3,"click","disabled"],["width","12","height","12","viewBox","0 0 12 12","fill","none","xmlns","http://www.w3.org/2000/svg"],["id","h-icon/mini/arrow-down-tray"],["id","Vector"],["d","M6.4502 1.64922C6.4502 1.40069 6.24872 1.19922 6.0002 1.19922C5.75167 1.19922 5.5502 1.40069 5.5502 1.64922V6.81737L3.77735 4.94024C3.60671 4.75956 3.3219 4.75142 3.14122 4.92206C2.96053 5.09271 2.9524 5.37752 3.12304 5.5582L5.67304 8.2582C5.75805 8.34821 5.87639 8.39922 6.0002 8.39922C6.124 8.39922 6.24234 8.34821 6.32735 8.2582L8.87735 5.5582C9.048 5.37752 9.03986 5.09271 8.85918 4.92206C8.67849 4.75142 8.39369 4.75956 8.22304 4.94024L6.4502 6.81737V1.64922Z"],["d","M2.1002 7.64922C2.1002 7.40069 1.89872 7.19922 1.6502 7.19922C1.40167 7.19922 1.2002 7.40069 1.2002 7.64922V9.14922C1.2002 10.0605 1.93893 10.7992 2.8502 10.7992H9.1502C10.0615 10.7992 10.8002 10.0605 10.8002 9.14922V7.64922C10.8002 7.40069 10.5987 7.19922 10.3502 7.19922C10.1017 7.19922 9.9002 7.40069 9.9002 7.64922V9.14922C9.9002 9.56343 9.56441 9.89922 9.1502 9.89922H2.8502C2.43598 9.89922 2.1002 9.56343 2.1002 9.14922V7.64922Z"],["tabindex","0",1,"t-dropdown-content","t-menu","t-bg-base-100","t-rounded-box","t-p-4","t-shadow","t-text-[14px]","t-z-10","t-w-44","t-text-black","t-space-y-6",3,"click"],[1,"t-w-full","t-text-left","t-px-2","t-py-1","hover:t-bg-gray-100","t-rounded",3,"click"],[1,"t-animate-ping","t-absolute","t-inline-flex","t-h-full","t-w-full","t-rounded-full","t-opacity-25","bg-purple"],[1,"t-relative","t-inline-flex","t-size-5","t-rounded-full","bg-purple"],[1,"sharePopover","t-absolute","t-top-full","t-left-0","bg-purple","t-text-white","t-shadow-md","t-rounded-md","t-p-4","t-z-50","t-w-max","t-text-center"],[1,"t-relative","t-flex","t-gap-2"],[1,"t-text-[14px]","t-font-medium"],["type","button",1,"t-opacity-70","hover:t-opacity-100","t-transition-opacity","focus:t-outline-none","focus:t-ring-2","focus:t-ring-[#9747FF]","focus:t-ring-offset-2",3,"click"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"t-size-[18px]","ng-tns-c2522792284-5"],["d","M18 6 6 18",1,"ng-tns-c2522792284-5"],["d","m6 6 12 12",1,"ng-tns-c2522792284-5"],[1,"t-sr-only","ng-tns-c2522792284-5"],[1,"t-absolute","-t-top-[80%]","t-right-0","sm:t-right-4","t-size-5","t-rotate-45",2,"background-color","rgb(151, 72, 255)"],["type","button","ngxClipboard","",1,"t-btn","t-h-[36px]","btn-navy-outline","t-text-[14px]","font-cofo-mono","t-group",3,"cbOnSuccess","click","cbContent","disabled"],["width","12","height","12","viewBox","0 0 12 12","fill","none","xmlns","http://www.w3.org/2000/svg",1,"t-size-6"],["id","h-icon/mini/link"],["d","M7.33953 2.53856C7.92532 1.95277 8.87507 1.95277 9.46086 2.53856C10.0466 3.12435 10.0466 4.07409 9.46086 4.65988L8.72625 5.39448C8.55052 5.57021 8.55052 5.85514 8.72625 6.03087C8.90199 6.20661 9.18691 6.20661 9.36265 6.03087L10.0973 5.29627C11.0345 4.35902 11.0345 2.83942 10.0973 1.90216C9.15999 0.964904 7.6404 0.964904 6.70314 1.90216L4.90314 3.70216C3.96588 4.63942 3.96588 6.15902 4.90314 7.
3309627C4.94689 7.14002 4.99198 7.18179 5.03828 7.22154C5.22684 7.38344 5.51094 7.36183 5.67284 7.17327C5.83474 6.98471 5.81313 6.70061 5.62457 6.53871C5.59553 6.51378 5.56716 6.4875 5.53954 6.45988C4.95375 5.87409 4.95375 4.92434 5.53954 4.33856L7.33953 2.53856Z",1,"t-fill-[#001140]","group-hover:t-fill-white"],["d","M6.96211 4.77689C6.77355 4.61499 6.48945 4.6366 6.32755 4.82516C6.16565 5.01372 6.18726 5.29782 6.37582 5.45972C6.40486 5.48465 6.43323 5.51093 6.46086 5.53855C7.04664 6.12434 7.04664 7.07409 6.46086 7.65987L4.66086 9.45987C4.07507 10.0457 3.12532 10.0457 2.53954 9.45987C1.95375 8.87408 1.95375 7.92434 2.53954 7.33855L3.27414 6.60395C3.44987 6.42822 3.44987 6.14329 3.27414 5.96756C3.0984 5.79182 2.81348 5.79182 2.63774 5.96755L1.90314 6.70215C0.965881 7.63941 0.965881 9.15901 1.90314 10.0963C2.8404 11.0335 4.35999 11.0335 5.29725 10.0963L7.09725 8.29627C8.03451 7.35901 8.03451 5.83941 7.09725 4.90216C7.0535 4.8584 7.00842 4.81664 6.96211 4.77689Z",1,"t-fill-[#001140]","group-hover:t-fill-white"],["tabindex","0",1,"t-dropdown-content","t-menu","t-bg-base-100","t-rounded-box","t-p-4","t-shadow","t-text-[14px]","t-z-10","t-w-[14.5rem]","t-text-black","t-space-y-6",3,"click"],[1,"t-text-[15px]","font-hanken","hover:text-purple","t-cursor-pointer",3,"click"],[1,"t-text-[15px]","font-hanken","t-cursor-pointer",3,"click","ngClass"],["elementType","canvas",2,"display","none",3,"qrdata","width","imageSrc","errorCorrectionLevel"]],template:function(i,n){if(i&1){let o=A();a(0,"div",4)(1,"h1",5),d(2),l(),a(3,"p",6),d(4),l()(),a(5,"div",7)(6,"div",8),F(),a(7,"svg",9),y(8,"path",10),l(),ht(),a(9,"ng-select",11,0),v("search",function(p){return k(o),S(n.onSearch(p.term))})("change",function(p){return k(o),S(n.onReportSelectionChange(p))})("focus",function(){k(o);let p=L(10);return S(p.searchInput.nativeElement.focus())}),C(11,Sa,7,5,"ng-template",12)(12,ba,6,4,"ng-template",13)(13,wa,2,0,"ng-template",14),l()(),a(14,"div",15),C(15,Aa,25,10)(16,Pa,26,14),l(),C(17,Ea,2,1,"div",16),l(),C(18,Oa,2,1,"p",17)}if(i&2){let o,c;s(2),M(" ",(o=(o=n.routerData())==null?null:o.title)!==null&&o!==void 0?o:"Select the action"," "),s(2),M(" ",(c=(c=n.routerData())==null?null:c.description)!==null&&c!==void 0?c:""," "),s(2),rt("comparison-markets",n.isChartCreator()),s(3),h("items",n.reportOptions())("searchable",!0)("clearable",!1)("virtualScroll",!n.isChartCreator())("ngModel",n.isChartCreator()?n.comparisonHashes():n.selectedReportHash())("multiple",n.isChartCreator())("maxSelectedItems",n.isChartCreator()?3:void 0)("hideSelected",n.isChartCreator())("closeOnSelect",!n.isChartCreator())("trackByFn",n.trackById)("loading",n.isLoading())("placeholder",n.isChartCreator()?n.marketSelectionHint():"Search your reports")("inputAttrs",ut(20,va,n.isChartCreator()?"Select markets":"Search your reports")),s(6),_(n.activeRoute().path!=="market-reports"?15:16),s(2),_(n.query()?17:-1),s(),_(n.isChartCreator()?18:-1)}},dependencies:[Je,Ye,yn,Vt,se,ae,ni,ri,Ee,bn,Lt,It,ei,ti,Rt],styles:[".title[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:.2s}@starting-style{.title[_ngcontent-%COMP%]{transform:translateY(-20px);opacity:0}}.sharePopover[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:1.8s}@starting-style{.sharePopover[_ngcontent-%COMP%]{transform:scale(0);opacity:0}}.description[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:.65s}@starting-style{.description[_ngcontent-%COMP%]{transform:translateY(20px);opacity:0}}.label-input.comparison-markets[_ngcontent-%COMP%]{height:auto!important;min-height:40px;min-width:0;padding-top:4px;padding-bottom:4px}.label-input.comparison-markets[_ngcontent-%COMP%] .ng-select-container{height:auto!important;min-height:30px}.label-input.comparison-markets[_ngcontent-%COMP%] .ng-value-container{min-width:0;flex-wrap:wrap;gap:4px}.label-input[_ngcontent-%COMP%]{transition-property:opacity;transition-duration:.65s;transition-delay:1.1s}@starting-style{.label-input[_ngcontent-%COMP%]{opacity:0}
33}.action-buttons[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:1.4s}@starting-style{.action-buttons[_ngcontent-%COMP%]{transform:translateY(-20px);opacity:0}}.router-content[_ngcontent-%COMP%]{transition-property:opacity;transition-duration:.65s;transition-delay:1.6s}@starting-style{.router-content[_ngcontent-%COMP%]{opacity:0}}.router-content[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:1.7s}@starting-style{.router-content[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%]{transform:translateY(20px);opacity:0}}.router-content[_ngcontent-%COMP%] .right-section[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:2.1s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section[_ngcontent-%COMP%]{transform:translate(50%);opacity:0}}.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(1) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(1) div[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:2.4s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(1) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(1) div[_ngcontent-%COMP%]{opacity:0;transform:translate(50%)}}.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(2) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(2) div[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:2.7s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(2) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(2) div[_ngcontent-%COMP%]{opacity:0;transform:translate(50%)}}.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(3) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(3) div[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:3s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(3) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(3) div[_ngcontent-%COMP%]{opacity:0;transform:translate(50%)}}.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(4) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(4) div[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:3.3s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(4) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(4) div[_ngcontent-%COMP%]{opacity:0;transform:translate(50%)}}[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .ng-select{width:100%;font-size:15px;font-family:Inter,sans-serif;font-weight:400;outline:none;cursor:text}[_nghost-%COMP%] .ng-select .ng-select-container{height:40px;border-radius:0;background:transparent;border:none;box-shadow:none}[_nghost-%COMP%] .ng-select .ng-select-container:hover{border-color:#a78bfa}[_nghost-%COMP%] .ng-select .ng-input input{font-size:15px;line-height:24px;font-weight:300;outline:none;background:transparent}[_nghost-%COMP%] .ng-dropdown-panel{border-radius:.75rem;overflow:hidden;left:-30px;width:calc(100% + 40px)}"]})}}return e})();var Ra=["mobileFilterModal"],Na=["qrCodeRef"],qa=()=>({isDesktop:!0}),La=(e,r)=>({id:"houses",label:e,icon:r}),Ia=(e,r)=>({id:"condos",label:e,icon:r}),Qa=(e,r)=>({id:"coop",label:e,icon:r}),Fa=(e,r,t)=>[e,r,t],Va=()=>({"aria-label":"Timeframe"}),za=()=>({"aria-label":"Market Segment"}),$a=(e,r)=>r.id,Or=(e,r)=>r.key,Ha=(e,r)=>r.value;function Ua(e,r){e&1&&U(0)}function Ba(e,r){e&1&&U(0)}function ja(e,r){if(e&1){let t=A();a(0,"button",37),v("click",function(){k(t);let n=m(3);return S(n.openMarketViewStats())}),U(1,38),l()}if(e&2){let t=m(3),i=L(23);h("@fadeIn",void 0)("disabled",!t.reportData()),s(),h("ngTemplateOutlet",i)}}function Wa(e,r){if(e&1&&(a(0,"div",33)(1,"h4",34),d(2,"Customize"),l(),C(3,ja,2,3,"button",35),l(),y(4,"div",36)),e&2){m();let t=Si(0);s(3),_(t.config?3:-1)}}function Ga(e,r){if(e&1&&U(0,38),e&2){m(3);let t=L(35);h("ngTemplateOutlet",t)}}function Za(e,r){if(e&1){let t=A();a(0,"div",25)(1,"label",26),d(2," Property Type "),l(),a(3,"div",39)(4,"button",40),v("click",function(){k(t);let n=m(2);return S(n.selectReportType("single"))}),d(5," Single Page "),l(),a(6,"button",41),v("click",function(){k(t);let n=m(2);return S(n.selectReportType("full"))}
33),C(7,Ga,1,1,"ng-container",38),a(8,"div"),d(9,"Full Report"),l()()()()}if(e&2){let t=m(2);s(3),h("@fadeIn",void 0),s(),h("ngClass",t.reportType==="single"?"bg-purple t-text-white":"t-bg-white"),s(2),h("ngClass",t.reportType==="full"?"bg-purple t-text-white":"t-bg-white"),s(),_(t.isFreemium()?7:-1)}}function Ka(e,r){if(e&1){let t=A();a(0,"div",42)(1,"div",43),Jt(2),a(3,"button",44),v("click",function(){k(t);let n=m(3);return S(n.selectedSize="square")}),d(4," Square "),l(),a(5,"button",45),v("click",function(){k(t);let n=m(3);return S(n.selectedSize="landscape")}),d(6," Landscape "),l(),a(7,"button",46),v("click",function(){k(t);let n=m(3);return S(n.selectedSize="portrait")}),d(8," Portrait "),l()()()}if(e&2){let t=m(3),i="t-text-white t-bg-black";s(3),h("ngClass",t.selectedSize==="square"?i:"t-text-gray-500"),s(2),h("ngClass",t.selectedSize==="landscape"?i:"t-text-gray-500"),s(2),h("ngClass",t.selectedSize==="portrait"?i:"t-text-gray-500")}}function Ya(e,r){if(e&1&&C(0,Ka,9,3,"div",42),e&2){let t=m(2);_(t.hideSizes()?-1:0)}}function Ja(e,r){if(e&1){let t=A();Jt(0),a(1,"button",47),v("click",function(){let n=k(t).$implicit,o=m(2);return S(o.selectedType=n.label)}),U(2,38),a(3,"div"),d(4),l()()}if(e&2){let t=r.$implicit,i=m(2),n="bg-purple t-text-white";s(),h("ngClass",t.label===i.selectedType?n:null),s(),h("ngTemplateOutlet",t.icon),s(2),q(t.label)}}function Xa(e,r){if(e&1&&(a(0,"span",54),d(1),l()),e&2){let t=m().item;s(),M("Median price ",t.medianPrice,"")}}function ts(e,r){if(e&1&&(a(0,"div",53)(1,"span"),d(2),l(),C(3,Xa,2,1,"span",54),l()),e&2){let t=r.item;s(2),q(t.label),s(),_(t.medianPrice?3:-1)}}function es(e,r){if(e&1){let t=A();a(0,"div",29)(1,"label",48)(2,"span"),d(3,"Market Segment"),l(),a(4,"i",49)(5,"span",50),d(6," See how MAI changes across different price ranges. Each segment represents about 25% of the market, ordered by price. "),l()()(),a(7,"ng-select",51),v("ngModelChange",function(n){k(t);let o=m(2);return S(o.onMarketSegmentChange(n))}),C(8,ts,4,2,"ng-template",52),l()()}if(e&2){let t=m(2);h("@fadeIn",void 0),s(7),h("items",t.marketSegmentOptions())("searchable",!1)("clearable",!1)("ngModel",t.selectedMarketSegment())}}function is(e,r){if(e&1&&(a(0,"option",56),d(1),l()),e&2){let t=r.$implicit;h("ngValue",t.key),s(),q(t.value)}}function ns(e,r){if(e&1){let t=A();a(0,"div",31)(1,"label",26),d(2," Select Metric "),l(),a(3,"select",55),v("ngModelChange",function(n){k(t);let o=m(2);return S(o.chartTracking.setMetric(n))}),ot(4,is,2,2,"option",56,Or),l()()}if(e&2){let t=m(2);h("@fadeIn",void 0),s(3),h("ngModel",t.selectedChart()),s(),at(t.chartOptions)}}function rs(e,r){if(e&1){let t=A();Jt(0),a(1,"span",58)(2,"button",60),v("click",function(){let n=k(t).$implicit,o=m(3);return S(o.chartTracking.setMedian(n.value))}),d(3),l()()}if(e&2){let t=r.$implicit,i=m(2).isDesktop,n=m(),o=!!n.chartCreatorState.medianRestriction()&&t.value!=="90d";s(),h("title",o?n.chartCreatorState.medianRestriction():""),s(),rt("t-opacity-50",o)("t-cursor-not-allowed",o),h("ngClass",n.comparison.median()===t.value?"t-bg-black t-text-white":"t-text-gray-500"),Q("aria-disabled",o)("aria-pressed",n.comparison.median()===t.value)("aria-describedby",o?"median-reason-"+i:null),s(),M(" ",t.label," ")}}function os(e,r){if(e&1&&(a(0,"p",59),d(1),l()),e&2){let t=m(2).isDesktop,i=m();h("id","median-reason-"+t),s(),M(" ",i.chartCreatorState.medianRestriction()," ")}}function as(e,r){if(e&1&&(a(0,"div",31)(1,"div",32),d(2,"Median"),l(),a(3,"div",57),ot(4,rs,4,10,"span",58,Ha),l(),C(6,os,2,2,"p",59),l()),e&2){let t=m(2);s(4),at(t.medianOptions),s(2),_(t.chartCreatorState.medianRestriction()?6:-1)}}function ss(e,r){if(e&1){let t=A();a(0,"div",62)(1,"span",63),d(2,"Start Date"),l(),a(3,"label",64),U(4,38),a(5,"input",65),v("ngModelChange",function(n){k(t);let o=m(3);return S(o.onStartChange(n))})("keydown",function(n){k(t);let o=m(3);return S(o.dateKeyGuard(n))}),l()(),a(6,"span",63),d(7,"End Date"),l(),a(8,"label",64),U(9,38),a(10,"input",66),v("ngModelChange",function(n){k(t);let o=m(3);return S(o.onEndChange(n))})("keydown",function(n){k(t);let o=m(3);return S(o.dateKeyGuard(n))}),l()()(),a(11,"p",67),d(12,"End Date defaults to today when blank."),l()}if(e&2){let t=m(3),i=L(31);s(4),h("ngTemplateOutlet",i),s(),h("bsConfig",t.bsCfg)("ngModel",t.startDate())("disabled",t.comparison.resource.isLoading()),s(4),h("ngTemplateOutlet",i),s(),h("bsConfig",t.bsCfg)("ngModel",t.endDate())("disabled",t.comparison.resource.isLoading())}}function cs(e,r){if(e&1&&(a(0,"p",67),d(1),l()),e&2){let t=r;s(),Yt("Showing ",t.start," to ",t.end,"")}}function ls(e,r){if(e&1&&(a(0,"p",68),d(1),l()),e&2){let t=r.$implicit;s(),q(t)}}function ps(e,r){if(e&1&&(C(0,cs,2,2,"p",67),ot(1,ls,2,1,"p",68,Xi)),e&2){let t,i=m(3);_((t=i.comparison.timeframe().span)?0:-1,t),s(),at(i.comparison.timeframe().messages)}}function ms(e,r){if(e&1){let t=A();a(0,"div",31)(1,"label",26),d(2," Timeframe "),l(),a(3,"ng-select",61),v("ngModelChange",function(n){k(t);let o=m(2);return S(o.chartTracking.setTimeframe(n))}),l(),C(4,ss,13,8)(5,ps,3,1),l()}if(e&2){let t=m(2);h("@fadeIn",void 0),s(3),h("items",t.timeframeOptions)("searchable",!1)("clearable",!1)("ngModel",t.chartCreatorState.timeframe())("inputAttrs",J(8,Va)),s(),_(t.chartCreatorState.timeframe()==="custom"?4:-1),s(),_(t.comparison.resource.isLoading()?-1:5)}}function ds(e,r){if(e&1&&(a(0,"span",54),d(1),l()),e&2){let t=m().item;s(),M("Median price ",t.medianPrice,"")}}function hs(e,r){if(e&1&&(a(0,"div",53)(1,"span"),d(2),l(),C(3,ds,2,1,"span",54),l()),e&2){let t=r.item;s(2),q(t.label),s(),_(t.medianPrice?3:-1)}}function us(e,r){e&1&&(a(0,"p",68),d(1," Segments reset to Full Market for multi-market comparison. "),l())}function gs(e,r){if(e&1){let t=A();a(0,"div",31)(1,"div",69)(2,"span"),d(3,"Market Segment"),l(),a(4,"button",70),v("keydown.escape",function(n){return k(t),S(n.target.blur())}),y(5,"i",71),l(),a(6,"span",72),d(7," Each segment represents about 25% of the market, ordered by price. You can choose one price range to compare across multiple markets. Full market is selected by default "),l()(),a(8,"ng-select",73),v("ngModelChange",function(n){k(t);let o=m(2);return S(o.chartTracking.setSegments(n))}),C(9,hs,4,2,"ng-template",52),l(),C(10,us,2,0,"p",68),l()}if(e&2){let t=m().isDesktop,i=m();h("@fadeIn",void 0),s(4),Q("aria-describedby","chart-segment-help-"+t),s(2),h("id","chart-segment-help-"+t),s(2),h("items",i.chartSegmentOptions())("searchable",!1)("clearable",!1)("multiple",i.comparison.markets().length<=1)("maxSelectedItems",4)("closeOnSelect",i.comparison.markets().length>1)("ngModel",i.comparison.markets().length>1?i.chartCreatorState.segments()[0]:i.chartCreatorState.segments())("inputAttrs",J(12,za)),s(2),_(i.chartCreatorState.segmentsReset()?10:-1)}}
33function fs(e,r){e&1&&(a(0,"div",32),d(1,"Display Options"),l())}function _s(e,r){if(e&1){let t=A();a(0,"button",74),v("click",function(){k(t);let n=m(2);return S(n.copyQRCode())}),U(1,38),a(2,"div"),d(3,"Copy QR Code"),l()(),y(4,"qrcode",75,9)}if(e&2){let t=m(2),i=L(33);s(),h("ngTemplateOutlet",i),s(3),h("qrdata",t.reportLink())("width",256)("imageSrc","/assets/images/favicon-bg.png")("errorCorrectionLevel","M")("allowEmptyString",!0)}}function Cs(e,r){if(e&1&&(a(0,"i",49)(1,"div",81),d(2),l()()),e&2){let t=m(2).$implicit;s(2),M(" ",t.tooltip," ")}}function xs(e,r){if(e&1&&(a(0,"p",59),d(1," Market Narrative is currently available for Full Market only. "),l()),e&2){let t=m(3).isDesktop;h("id","segment-narrative-note-"+t)}}function ys(e,r){if(e&1){let t=A();a(0,"div",76)(1,"label",77)(2,"input",78),v("input",function(n){k(t);let o=m().$implicit,c=m(2);return S(c.toggleKey(o.key,n.target.checked))}),l(),a(3,"div",79)(4,"div",80),d(5),l(),C(6,Cs,3,1,"i",49),l()(),C(7,xs,2,1,"p",59),l()}if(e&2){let t=m().$implicit,i=m().isDesktop,n=m();h("@fadeIn",void 0),s(2),h("checked",t.key==="branding"?n.hasBranding():t.key==="marketNarrative"?n.showMarketNarrative():!0)("disabled",t.key==="marketNarrative"&&n.isBlockMarketNarrative),Q("aria-describedby",t.key==="marketNarrative"&&n.marketNarrativeUnavailableForSegment()?"segment-narrative-note-"+i:null),s(3),q(t.value),s(),_(t.tooltip?6:-1),s(),_(t.key==="marketNarrative"&&n.marketNarrativeUnavailableForSegment()?7:-1)}}function vs(e,r){if(e&1&&C(0,ys,8,7,"div",76),e&2){let t=r.$implicit;m();let i=Si(0);_(i[t.key]?0:-1)}}function ks(e,r){if(e&1&&(Jt(0),C(1,Wa,5,1),a(2,"div",24),C(3,Za,10,4,"div",25)(4,Ya,1,1),a(5,"div",25)(6,"label",26),d(7," Property Type "),l(),a(8,"div",27),Jt(9),ot(10,Ja,5,3,"button",28,$a),l()(),C(12,es,9,5,"div",29),a(13,"div",30),C(14,ns,6,2,"div",31)(15,as,7,1,"div",31)(16,ms,6,9,"div",31)(17,gs,11,13,"div",31)(18,fs,2,0,"div",32)(19,_s,6,6),ot(20,vs,1,1,null,null,Or),l()()),e&2){let t=r.isDesktop,i=m(),n=L(25),o=L(27),c=L(29),p=en(i.additionalFields());s(),_(t?1:-1),s(2),_(p.reportType?3:-1),s(),_(p.reportType?-1:4);let u=nn(20,Fa,He(11,La,i.ChartType.HOUSES,n),He(14,Ia,i.ChartType.CONDOS,o),He(17,Qa,i.ChartType.COOP,c));s(6),at(u),s(2),_(p.marketSegment?12:-1),s(2),_(p.chartMetric?14:-1),s(),_(i.isChartCreator()?15:-1),s(),_(p.date?16:-1),s(),_(p.segment?17:-1),s(),_(i.isChartCreator()?18:-1),s(),_(p.qrCode?19:-1),s(),at(i.INPUT_FIELDS)}}function Ss(e,r){e&1&&(F(),a(0,"svg",82),y(1,"path",83)(2,"circle",84),l())}function bs(e,r){e&1&&(F(),a(0,"svg",85),y(1,"path",86)(2,"path",87),l())}function ws(e,r){e&1&&(F(),a(0,"svg",85),y(1,"rect",88)(2,"path",89)(3,"path",90)(4,"path",91)(5,"path",92)(6,"path",93)(7,"path",94)(8,"path",95)(9,"path",96)(10,"path",97)(11,"path",98),l())}function Ts(e,r){e&1&&(F(),a(0,"svg",99),y(1,"path",100)(2,"path",101)(3,"path",102)(4,"path",103)(5,"path",104)(6,"path",105)(7,"path",106),l())}function Ms(e,r){e&1&&(F(),a(0,"svg",107),y(1,"path",108),l())}function As(e,r){e&1&&(F(),a(0,"svg",109),y(1,"rect",110)(2,"rect",111)(3,"rect",112)(4,"path",113)(5,"path",114)(6,"path",115)(7,"path",116)(8,"path",117)(9,"path",118)(10,"path",119)(11,"path",120)(12,"path",121),l())}function Ps(e,r){e&1&&(F(),a(0,"svg",122),y(1,"path",123),l())}var Dr=(()=>{class e{constructor(){this.router=g(te),this.quickActionsService=g($),this.modalService=g(Ut),this.upgradeService=g(ee),this.toastService=g(yt),this.mixpanelService=g(dt),this.chartCreatorState=g(bt),this.comparison=g(zt),this.chartTracking=g(wt),this.hasBranding=this.quickActionsService.hasBranding,this.showMarketNarrative=this.quickActionsService.showMarketNarrative,this.marketNarrativeUnavailableForSegment=this.quickActionsService.marketNarrativeUnavailableForSegment,this.mobileFilterModal=yi("mobileFilterModal"),this.qrCodeRef=yi("qrCodeRef"),this.chartData=T(null),this.reportData=T(null),this.isFreemium=T(!1),this.isMobile=T(!1),this._selectedType=this.quickActionsService.chartType,this._selectedSize=this.quickActionsService.size,this._reportType=this.quickActionsService.reportType,this._isBlockMarketNarrative=this.quickActionsService.isBlockMarketNarrative,this.selectedMarketSegment=this.quickActionsService.selectedMarketSegment,this.selectedChart=this.chartCreatorState.selectedChart,this.startDate=f(()=>this.chartCreatorState.startDate()??(this.comparison.timeframe().span?St(this.comparison.timeframe().span.start):null)),this.endDate=this.chartCreatorState.endDate,this.timeframeOptions=An,this.reportLink=f(()=>{let t=this.quickActionsService.selectedReport(),i=this.quickActionsService.chartType(),n=this.quickActionsService.reportType();if(t){let o=t.hash,c=V.CONDOS==i?"?condos=true":V.COOP===i?"?coop=true":"",p=n==="single"?"ps":"p";return I.altos.cloudfront+"/"+p+"/"+o+c}else return""}),this.isChartCreator=f(()=>this.additionalFields().chartMetric),this.hideSizes=f(()=>this.isMobile()&&!this.isChartCreator()),this.additionalFields=f(()=>{let t=this.currentUrl().split("/").at(-1),i=new Set(this.ENABLE_BY_ROUTE[t]??[]);return Object.fromEntries(this.ALL_FIELDS.map(n=>[n,i.has(n)]))}),this.marketSegmentOptions=f(()=>{let t=this.reportData()?.[0];return Ti.map(i=>W(z({},i),{medianPrice:i.id===0?null:De(t,i.quartile)}))}),this.currentUrl=K(this.router.events.pipe(Zt(t=>t instanceof je),ve({url:this.router.url}),lt(t=>t.urlAfterRedirects||t.url)),{requireSync:!0}),this.ALL_FIELDS=["branding","weeklyChange","chartMetric","date","marketNarrative","qrCode","reportType","config","marketSegment","segment"],this.charts=oe,this.INPUT_FIELDS=[{key:"branding",value:"Add branding",tooltip:"Apply your custom branding to this asset."},{key:"weeklyChange",value:"Show weekly change",tooltip:"View week-over-week market changes."},{key:"marketNarrative",value:"Show market narrative",tooltip:"Include a market summary with this asset."}],this.ENABLE_BY_ROUTE={"market-snapshot":["config","branding","weeklyChange","marketNarrative"],"market-action":["branding","marketNarrative","marketSegment"],"chart-creator":["chartMetric","date","segment","branding"],"market-reports":["qrCode","reportType"]},this.bsCfg={dateInputFormat:"YYYY-MM-DD",showWeekNumbers:!1,adaptivePosition:!0},this.chartOptions=Object.entries(this.charts).map(([t,i])=>({key:t,value:i})),this.medianOptions=[{value:"7d",label:"7-Day"},{value:"90d",label:"90-Day"},{value:"both",label:"Both"}],this.chartSegmentOptions=f(()=>Ti.map(t=>W(z({},t),{medianPrice:this.comparison.markets().length===1&&!this.comparison.resource.isLoading()&&t.id!==0?De(this.comparison.resource.value()?.[0]?.table,t.quartile):null}))),this.ChartType=V,E(()=>{this.isMobile()&&(this.selectedSize="portrait")})}onStartChange(t){t&&!Number.isFinite(t.getTime())||t?.getTime()!==this.startDate()?.getTime()&&this.chartTracking.setDates(t,this.endDate())}onEndChange(t){t&&!Number.isFinite(t.getTime())||t?.getTime()!==this.endDate()?.getTime()&&this.chartTracking.setDates(this.startDate(),t)}dateKeyGuard(t){t.metaKey||t.ctrlKey||["Backspace","Delete","ArrowLeft","ArrowRight","Tab","Home","End","Enter"].includes(t.key)||/[\d-]/.test(t.key)||t.preventDefault()}onMarketSegmentChange(t){let i=this.selectedMarketSegment();t!==i&&(this.selectedMarketSegment.set(t),this.mixpanelService.onTrackAdmin("qa_market_segment_select",{selected_segment:kt(t).label,previous_segment:kt(i).label,property_type:this.selectedType.toLowerCase(),asset_type:"MAI"}))}openMarketViewStats(){let t=this.modalService.show(Rn,{class:"market-view-stats"});t.content.data.set("market-view",this.quickActionsService.marketView()),t.content.data.set("report-view",{}),t.content.data.set("chart-type",this.quickActionsService.chartType()),t.content.type="market-view",t.content.selected=Object.keys(this.quickActionsService.marketView()).length,t.content.report=this.quickActionsService.selectedReport(),t.content.data$.pipe(Dt(1),Kt(t.onHidden
33)).subscribe(i=>{this.quickActionsService.marketView.set(i.get("market-view")),this.quickActionsService.chartType.set(i.get("chart-type"))})}toggleKey(t,i){t==="weeklyChange"?this.toggleWeeklyChange(i):t==="marketNarrative"?this.toggleMarketNarrative(i):t==="branding"&&this.toggleBranding(i)}toggleWeeklyChange(t){this.quickActionsService.isShowWeeklyChange.set(t)}toggleMarketNarrative(t){this.marketNarrativeUnavailableForSegment()||this.quickActionsService.isShowMarketNarrative.set(t)}toggleBranding(t){if(this.isChartCreator()){this.chartTracking.setBranding(t);return}this.quickActionsService.hasBranding.set(t)}upgrade(){Bt.open(this.modalService,{pricing:[this.upgradeService.getLitePlan(),this.upgradeService.getProfessionalPlan(),this.upgradeService.getAdvancedPlan()]})}selectReportType(t){if(t==="full"&&this.isFreemium())return this.upgrade();this.reportType=t}openMobileFilterModal(){this.mobileFilterModal()?.nativeElement.showModal()}copyQRCode(){if(this.reportLink()==="")return this.toastService.showErrorToast("No report link available");let i=this.qrCodeRef().qrcElement.nativeElement.querySelector("canvas");i?i.toBlob(n=>{let o=new ClipboardItem({"image/png":n});navigator.clipboard.write([o]).then(()=>{this.toastService.showSuccessToast("QR code copied to clipboard")}).catch(c=>{console.error("Failed to copy QR code to clipboard:",c),this.toastService.showErrorToast("Failed to copy QR code to clipboard")})}):this.toastService.showErrorToast("QR code element not found")}get selectedType(){return this._selectedType()}get selectedSize(){return this._selectedSize()}get reportType(){return this._reportType()}get isBlockMarketNarrative(){return this._isBlockMarketNarrative()||this.marketNarrativeUnavailableForSegment()}set selectedType(t){if(this.isChartCreator()){this.chartTracking.setPropertyType(t);return}this._selectedType.set(t)}set selectedSize(t){this._selectedSize.set(t)}set reportType(t){this._reportType.set(t)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-customize"]],viewQuery:function(i,n){i&1&&(ki(n.mobileFilterModal,Ra,5),ki(n.qrCodeRef,Na,5)),i&2&&tn(2)},inputs:{chartData:[1,"chartData"],reportData:[1,"reportData"],isFreemium:[1,"isFreemium"],isMobile:[1,"isMobile"]},decls:36,vars:5,consts:[["mobileFilterModal",""],["filterContent",""],["config",""],["houses",""],["condos",""],["coop",""],["dateRef",""],["qrCode",""],["lock",""],["qrCodeRef",""],[1,"md:t-hidden","t-mb-4"],[1,"t-btn","btn-purple","t-w-full","t-font-medium","font-hanken","t-text-[14px]",3,"click","disabled"],["id","mobile_filter_modal",1,"t-modal","t-modal-bottom","md:t-modal-middle"],[1,"t-modal-box","t-bg-white","t-p-0","t-rounded-t-[16px]"],[1,"t-flex","t-items-center","t-justify-between","t-p-[20px]","t-border-b","t-sticky","t-top-0","t-bg-white","t-z-10"],[1,"t-text-[18px]","t-font-bold","font-scale","t-m-0"],["method","dialog"],[1,"t-btn","t-btn-sm","t-btn-circle","t-btn-ghost","t-text-[16px]"],[1,"t-p-[20px]","t-max-h-[70vh]","t-overflow-y-auto"],[4,"ngTemplateOutlet"],["method","dialog",1,"t-modal-backdrop"],[1,"t-hidden","md:t-block","t-w-[256px]","t-h-full"],[1,"t-w-full","t-space-y-[20px]","t-border","t-rounded-[8px]","t-p-[20px]","t-min-h-full","t-bg-white"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"t-space-y-[16px]"],[1,"t-space-y-[8px]"],[1,"t-m-0","font-hanken","t-text-[14px]","t-font-medium","t-text-gray-500"],[1,"t-grid","t-grid-cols-3","t-gap-[4px]"],["type","button",1,"t-btn","t-btn-ghost","t-text-[14px]","t-font-normal","t-h-[54px]","font-hanken","t-flex","t-flex-col","t-border","t-border-base-200","t-w-full",3,"ngClass"],[1,"t-space-y-[8px]","t-w-full"],[1,"t-flex","t-flex-col","t-gap-4","t-items-start"],[1,"t-space-y-4","t-w-full"],[1,"font-hanken","t-text-[14px]","t-font-medium","t-text-gray-500"],[1,"t-flex","t-items-center","t-justify-between"],[1,"t-text-[16px]","t-font-medium","font-scale","t-m-0"],[1,"t-btn","btn-purple-outline","t-border-transparent","t-bg-transparent","[&_svg]:t-stroke-black","[&_svg]:hover:t-stroke-white","t-shadow-none",3,"disabled"],[1,"t-border-t"],[1,"t-btn","btn-purple-outline","t-border-transparent","t-bg-transparent","[&_svg]:t-stroke-black","[&_svg]:hover:t-stroke-white","t-shadow-none",3,"click","disabled"],[3,"ngTemplateOutlet"],[1,"t-grid","t-grid-cols-2","t-gap-4"],[1,"t-btn","t-text-[13px]","t-font-normal","t-h-[36px]","font-hanken","t-w-full",3,"click","ngClass"],[1,"t-btn","t-flex","t-text-[13px]","t-font-normal","t-h-[36px]","font-hanken","t-w-full","t-flex-nowrap",3,"click","ngClass"],[1,"t-space-y-[12px]"],[1,"t-join","t-border","t-border-base-300","t-w-full","t-flex"],["data-tip","Best for feed posts and clean, balanced layouts.",1,"t-join-item","t-btn","t-btn-ghost","t-text-[13px]","t-font-normal","t-h-[32px]","font-hanken","t-flex-1","sm:t-tooltip",3,"click","ngClass"],["data-tip","Optimized for social feeds and recommended for most use cases.",1,"t-join-item","t-btn","t-btn-ghost","t-text-[14px]","t-font-normal","t-h-[32px]","font-hanken","t-flex-1","t-border-x","t-border-base-200","t-border-y-transparent","t-px-[7px]","sm:t-tooltip",3,"click","ngClass"],["data-tip","Best for stories, reels, and full-screen mobile viewing.",1,"t-join-item","t-btn","t-btn-ghost","t-text-[14px]","t-font-normal","t-h-[32px]","font-hanken","t-flex-1","sm:t-tooltip",3,"click","ngClass"],["type","button",1,"t-btn","t-btn-ghost","t-text-[14px]","t-font-normal","t-h-[54px]","font-hanken","t-flex","t-flex-col","t-border","t-border-base-200","t-w-full",3,"click","ngClass"],[1,"t-flex","t-items-center","t-gap-2","t-m-0","font-hanken","t-text-[14px]","t-font-medium","t-text-gray-500"],[1,"fa","fa-info-circle","t-cursor-help","t-text-gray-400","hover:t-text-gray-500","t-relative","t-group"],[1,"custom-tooltip-top","t-bg-gray-700","t-text-[13px]","t-text-white","font-hanken","t-max-w-[270px]"],["bindLabel","label","bindValue","id",1,"market-segment-select","t-w-full","t-text-[14px]",3,"ngModelChange","items","searchable","clearable","ngModel"],["ng-option-tmp",""],[1,"t-flex","t-flex-col","t-py-[2px]"],[1,"t-text-[12px]","t-text-gray-500"],["aria-label","Select Metric",1,"t-select","t-select-bordered","t-text-[14px]","t-h-[35px]","t-m-0","t-w-full",3,"ngModelChange","ngModel"],[3,"ngValue"],["role","group","aria-label","Median",1,"t-join","t-flex","t-w-full","t-border","t-rounded-lg"],[1,"t-flex-1","t-min-w-0",3,"title"],[1,"font-hanken","t-text-[12px]","t-text-gray-500","t-m-0",3,"id"],["type","button",1,"t-btn","t-btn-ghost","t-w-full","t-h-[35px]","t-min-h-0","t-px-1","t-text-[13px]","font-hanken",3,"click","ngClass"],["bindLabel","label","bindValue","id",1,"market-segment-select","t-w-full","t-text-[14px]",3,"ngModelChange","items","searchable","clearable","ngModel","inputAttrs"],[1,"t-grid","t-grid-cols-1","t-w-full","t-items-center","t-gap-4"],[1,"font-hanken","t-text-[12px]","t-text-gray-500"],[1,"t-join","t-m-0","t-input","t-input-bordered","t-flex","t-items-center","t-gap-2","t-h-[35px]","t-rounded-2xl","focus-within:t-outline-purple-400","t-w-full"],["type","text","placeholder","Start Date","bsDatepicker","","inputmode","numeric","pattern","\\d{4}-\\d{2}-\\d{2}","maxlength","10","autocomplete","off","aria-label","Start date",1,"t-text-[14px]","t-w-full",3,"ngModelChange","keydown","bsConfig","ngModel","disabled"],["type","text","placeholder","End Date","bsDatepicker","","inputmode","numeric","pattern","\\d{4}-\\d{2}-\\d{2}","maxlength","10","autocomplete","off","aria-label","End date",1,"t-text-[14px]","t-w-full",3,"ngModelChange","keydown","bsConfig","ngModel","disabled"],[1,"font-hanken","t-text-[12px]","t-text-gray-500","t-m-0"],["role","status",1,"font-hanken","t-text-[12px]","t-text-gray-500","t-m-0"],[1,"chart-segment-help","t-relative","t-flex","t-items-center","t-gap-2","font-hanken","t-text-[14px]","t-font-medium","t-text-gray-500"],["type","button","aria-label","About market segments",1,"t-border-0","t-bg-transparent","t-p-0","t-text-gray-400","hover:t-text-gray-500",3,"keydown.escape"],["aria-hidden","true",1,"fa","fa-info-circle"],["role","tooltip",1,"chart-segment-tooltip",3,"id"],["bindLabel","label","bindValue","id",1,"market-segment-select","chart
33-creator-segments","t-w-full","t-text-[14px]",3,"ngModelChange","items","searchable","clearable","multiple","maxSelectedItems","closeOnSelect","ngModel","inputAttrs"],[1,"t-btn","t-bg-white","hover:btn-purple-outline","t-text-[13px]","t-font-normal","t-h-[36px]","font-hanken","t-w-full",3,"click"],["elementType","canvas",2,"display","none",3,"qrdata","width","imageSrc","errorCorrectionLevel","allowEmptyString"],[1,"t-form-control"],[1,"t-label","t-cursor-pointer","t-justify-start","t-gap-4","t-m-0"],["type","checkbox",1,"t-checkbox","t-m-0",3,"input","checked","disabled"],[1,"t-flex","t-items-center","t-gap-2"],[1,"t-label-text","t-text-[14px]"],[1,"custom-tooltip-top","t-bg-gray-700","t-text-[13px]","t-text-white","font-hanken","t-max-w-[190px]"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"t-size-[16px]"],["d","M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"],["cx","12","cy","12","r","3"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"t-size-[16px]"],["d","M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"],["d","M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"],["width","16","height","20","x","4","y","2","rx","2","ry","2"],["d","M9 22v-4h6v4"],["d","M8 6h.01"],["d","M16 6h.01"],["d","M12 6h.01"],["d","M12 10h.01"],["d","M12 14h.01"],["d","M16 10h.01"],["d","M16 14h.01"],["d","M8 10h.01"],["d","M8 14h.01"],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"t-lucide","t-lucide-building2","t-size-[16px]"],["d","M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z"],["d","M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2"],["d","M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2"],["d","M10 6h4"],["d","M10 10h4"],["d","M10 14h4"],["d","M10 18h4"],["xmlns","http://www.w3.org/2000/svg","fill","none","viewBox","0 0 24 24","stroke-width","1.5","stroke","currentColor",1,"t-join-item","t-size-6","t-block","t-transition"],["stroke-linecap","round","stroke-linejoin","round","d",`M6.75 3v2.25M17.25 3v2.25M3 8.25h18 34 M4.5 21h15a1.5 1.5 0 0 0 1.5-1.5V7.5A1.5 1.5 0 0 0 19.5 6H4.5A1.5 1.5 0 0 0 3 7.5v12A1.5 1.5 0 0 0 4.5 21z 35 M8.25 12h.008v.008H8.25V12zM12 12h.008v.008H12V12zM15.75 12h.008v.008h-.008V12z 36 M8.25 15.75h.008v.008H8.25v-.008zM12 15.75h.008v.008H12v-.008zM15.75 15.75h.008v.008h-.008v-.008z`],["xmlns","http://www.w3.org/2000/svg","width","24","height","24","viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"t-size-6","t-mr-1"],["width","5","height","5","x","3","y","3","rx","1"],["width","5","height","5","x","16","y","3","rx","1"],["width","5","height","5","x","3","y","16","rx","1"],["d","M21 16h-3a2 2 0 0 0-2 2v3"],["d","M21 21v.01"],["d","M12 7v3a2 2 0 0 1-2 2H7"],["d","M3 12h.01"],["d","M12 3h.01"],["d","M12 16v.01"],["d","M16 12h1"],["d","M21 12v.01"],["d","M12 21v-1"],["xmlns","http://www.w3.org/2000/svg","width","14","height","15","viewBox","0 0 14 15","fill","none"],["fill-rule","evenodd","clip-rule","evenodd","d","M3.9375 4.20002C3.9375 2.39589 5.30863 0.93335 7 0.93335C8.69137 0.93335 10.0625 2.39589 10.0625 4.20002V6.06668C11.029 6.06668 11.8125 6.90242 11.8125 7.93335V12.1334C11.8125 13.1643 11.029 14 10.0625 14H3.9375C2.971 14 2.1875 13.1643 2.1875 12.1334V7.93335C2.1875 6.90242 2.971 6.06668 3.9375 6.06668V4.20002ZM3.9375 7.00002C3.45425 7.00002 3.0625 7.41788 3.0625 7.93335V12.1334C3.0625 12.6488 3.45425 13.0667 3.9375 13.0667H10.0625C10.5457 13.0667 10.9375 12.6488 10.9375 12.1334V7.93335C10.9375 7.41788 10.5457 7.00002 10.0625 7.00002H3.9375ZM9.1875 6.06668H4.8125V4.20002C4.8125 2.91135 5.79188 1.86668 7 1.86668C8.20812 1.86668 9.1875 2.91135 9.1875 4.20002V6.06668Z","fill","#A0A0A0"]],template:function(i,n){if(i&1){let o=A();a(0,"div",10)(1,"button",11),v("click",function(){return k(o),S(n.openMobileFilterModal())}),d(2," Customize "),l()(),a(3,"dialog",12,0)(5,"div",13)(6,"div",14)(7,"h3",15),d(8,"Customize"),l(),a(9,"form",16)(10,"button",17),d(11,"\u2715"),l()()(),a(12,"div",18),C(13,Ua,1,0,"ng-container",19),l()(),a(14,"form",20)(15,"button"),d(16,"close"),l()()(),a(17,"div",21)(18,"div",22),C(19,Ba,1,0,"ng-container",23),l()(),C(20,ks,22,24,"ng-template",null,1,Z)(22,Ss,3,0,"ng-template",null,2,Z)(24,bs,3,0,"ng-template",null,3,Z)(26,ws,12,0,"ng-template",null,4,Z)(28,Ts,8,0,"ng-template",null,5,Z)(30,Ms,2,0,"ng-template",null,6,Z)(32,As,13,0,"ng-template",null,7,Z)(34,Ps,2,0,"ng-template",null,8,Z)}if(i&2){let o=L(21);s(),h("disabled",!n.reportData()),s(12),h("ngTemplateOutlet",o),s(6),h("ngTemplateOutlet",o)("ngTemplateOutletContext",J(4,qa))}},dependencies:[Rt,Mt,mt,hn,gn,fn,Ge,un,Lt,mn,_n,Cn,It,dn,Vt,se,ae,Je,vn,kn,ei,ti],styles:["[_nghost-%COMP%] .t-tooltip[_ngcontent-%COMP%]:before, [_nghost-%COMP%] .sm\\:t-tooltip[_ngcontent-%COMP%]:before{font-size:13px;font-family:Hanken Grotesk,sans-serif;border-radius:4px}[_nghost-%COMP%] .font-awesome[_ngcontent-%COMP%]{font-family:
36Font Awesome,sans-serif}[_nghost-%COMP%] .market-segment-select.ng-select{font-family:Hanken Grotesk,sans-serif;font-size:14px;cursor:pointer}.chart-segment-tooltip[_ngcontent-%COMP%]{position:absolute;bottom:calc(100% + 8px);left:0;width:min(270px,100%);padding:10px;border-radius:6px;background:#374151;color:#fff;font-size:13px;font-weight:400;line-height:1.4;z-index:30;visibility:hidden;opacity:0;transition:opacity .12s ease}.chart-segment-help[_ngcontent-%COMP%]:hover .chart-segment-tooltip[_ngcontent-%COMP%], .chart-segment-help[_ngcontent-%COMP%]:focus-within .chart-segment-tooltip[_ngcontent-%COMP%]{visibility:visible;opacity:1}[_nghost-%COMP%] .market-segment-select.ng-select .ng-select-container{min-height:35px;height:35px;border:1px solid #d1d5db;border-radius:8px;background:#fff;box-shadow:none;cursor:pointer}[_nghost-%COMP%] .market-segment-select.ng-select .ng-dropdown-panel{left:0;right:auto;width:100%;min-width:100%;max-width:100%;box-sizing:border-box}[_nghost-%COMP%] .market-segment-select.ng-select .ng-dropdown-panel-items .ng-option{min-height:35px;padding:6px 10px;white-space:normal}[_nghost-%COMP%] .market-segment-select.ng-select .ng-dropdown-panel-items .ng-option>div{min-width:0;overflow-wrap:anywhere}@media (max-width: 767px){[_nghost-%COMP%] .market-segment-select.ng-select .ng-dropdown-panel .ng-dropdown-panel-items{max-height:132px}}[_nghost-%COMP%] .market-segment-select.ng-select .ng-value-container{padding-left:16px}[_nghost-%COMP%] .market-segment-select.ng-select .ng-arrow-wrapper{padding-right:12px}[_nghost-%COMP%] .market-segment-select.ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#9747ff;box-shadow:0 0 0 1px #9747ff}[_nghost-%COMP%] .chart-creator-segments.ng-select.ng-select-multiple .ng-select-container{height:auto;min-height:35px}[_nghost-%COMP%] .chart-creator-segments .ng-value-container{min-width:0}"],data:{animation:[At("fadeIn",[tt(":enter",[O({opacity:"0",transform:"scale(0)"}),B("300ms ease-in",O({opacity:"1",transform:"scale(1)"}))]),tt(":leave",[O({opacity:"1",transform:"scale(1)",height:"*"}),B("300ms ease-in",O({opacity:"0",transform:"scale(0)",height:"0"}))])])]}})}}return e})();function Es(e,r){e&1&&(a(0,"div",8),y(1,"loading"),l())}function Os(e,r){if(e&1&&(y(0,"router-outlet"),C(1,Es,2,0,"div",8)),e&2){let t=m();s(),_(t.reportData.isLoading()?1:-1)}}function Ds(e,r){e&1&&(a(0,"h2",6),d(1,"Select your report"),l())}var Rr=(()=>{class e{constructor(){if(this.adminApiService=g(Nt),this.utilsService=g(re),this.toastService=g(yt),this.quickActionsService=g($),this.apiService=g(et),this.cookieService=g(pn),this.adminDataService=g(Qt),this.mobileService=g(Ft),this.platformId=g(Fe),this._reports=x([]),this.query=x(""),this.isLoading=x(!0),this.selectedReport=x(null),this.chartData=x(null),this.chartType=this.quickActionsService.chartType,this.dataType=this.quickActionsService.dataType,this.isMobile=this.mobileService.isMobile,this.filteredReports=f(()=>{let t=this.query().trim().toLowerCase();return t?this._allReports().results.filter(i=>i.displayName.toLowerCase().includes(t)):this._reports()}),this.reportData=X({request:()=>this.selectedReport(),loader:({request:t})=>t?ye([this.apiService.getTableData(t.hash,this.dataType()).pipe(_t(()=>G(null))),this.apiService.getChartData(t.hash,this.dataType()).pipe(_t(()=>G(null))),this.apiService.getRentalTableData(t.hash,this.dataType()).pipe(_t(()=>G(null))),this.apiService.getReportParameters(t.hash).pipe(_t(()=>G(null)))]).pipe(Ie(([i,n,o,c])=>{this.selectedReport.update(p=>(p.tableData=i,p.chartData=n,p.rentalData=o,p)),this.updateReportParameters(c),this.chartData.update(()=>n),this.quickActionsService.selectedReport.update(()=>z({},this.selectedReport()))})):G(null)}),this._allReports=K(this.getReports().pipe(Ie(t=>this._reports.set(t.results)),_t(t=>(console.error(t),this.toastService.showErrorToast("Failed to load reports"),G({results:[]})))),{initialValue:{results:[]}}),this.accountTypes=K(this.adminDataService.getAccountTypes(),{initialValue:{freemium:!0,lite:!1,professional:!1,premium:!1,advanced:!1}}),this.cookieService.check("market-view-stats")){let t=JSON.parse(this.cookieService.get("market-view-stats"));this.quickActionsService.marketView.set(t.marketView)}E(()=>{let t=this.selectedReport();t&&this.quickActionsService.selectedReport.set(t)}),E(()=>{let t=this.dataType();pt(()=>this.selectedReport())&&t&&this.reportData.reload()})}onSearch(t){this.query.set(t??"")}getReports(){return this.adminApiService.getReportsAll().pipe(lt(t=>({results:t.results.map(i=>W(z({},i),{reportName:this.utilsService.reportDisplayName(i)}))})),Ie(()=>{this.isLoading.set(!1)}))}share(t){if(!Ct(this.platformId))return;let i=this.selectedReport();if(!i)return;let n=I.dev?"https://api.staging.altos.re":I.altos.apiUrl,o=this.quickActionsService.activeSection(),c;if(o==="market-snapshot"){let u=new URLSearchParams;this.quickActionsService.isShowMarketNarrative()&&u.set("marketNarrative","true");let b=this.dataType();b===200&&u.set("condos","true"),b===400&&u.set("coop","true");let P=this.quickActionsService?.settings()?.name;if(P&&u.set("sender",P),t==="native")c=`${I.altos.baseUrl}/html/s-html/${i.hash}?${u.toString()}`;else{let D=this.quickActionsService.isShowMarketNarrative()?"&marketNarrative=true":"";c=`${n}/api/share?hash=${i.hash}${D}`}}else if(o==="market-action"){let u=this.quickActionsService.marketActionType()==="modern"?"&modern=true&width=250&height=240":"";c=`${n}/api/market-action?hash=${i.hash}${u}`}else if(o==="chart-creator"){let u=this.quickActionsService.selectedChart();c=`${n}/api/charts?hash=${i.hash}&data=${u}`}else c=`${n.replace("api.","")}/r/${i.hash}`;let p=encodeURIComponent(c);
36switch(t){case"fb":window.open(`https://www.facebook.com/sharer/sharer.php?u=${p}&fbrefresh=true&src=fb`,"_blank");break;case"linkedin":window.open(`https://www.linkedin.com/sharing/share-offsite/?url=${p}&src=li`,"_blank");break;case"twitter":window.open(`https://twitter.com/share?url=${p}&src=tw`,"_blank");break;case"native":this.handleShare(c,o);break}}handleShare(t,i){let n=i==="market-snapshot"?"Market Snapshot":"Market Report",c=`${this.quickActionsService?.settings()?.name??"User"} sent you a real-time housing market report from Altos. Tap to view the data for your area.`;navigator.share?navigator.share({title:n,url:t,text:c}).catch(p=>{p?.name!=="AbortError"&&console.error("Error sharing",p)}):this.copyToClipboard(`${c} 37${t}`)}copyToClipboard(t){navigator.clipboard.writeText(t).then(()=>{this.toastService.showSuccessToast("Link copied to clipboard!")}).catch(i=>{console.error("Could not copy text: ",i),this.toastService.showErrorToast("Failed to copy link")})}updateReportParameters(t){t.report.location.category.toUpperCase()!="CITY"&&t.report.location.category.toUpperCase()!="ZIP"?(t.displayNameWithZip=this.utilsService.toTitleCase(t.report.location.name)+", "+t.report.location.state,t.displayName=this.utilsService.toTitleCase(t.report.location.name)):(t.displayNameWithZip=this.utilsService.toTitleCase(t.report.location.city)+", "+t.report.location.state+" "+t.report.location.zip.replace("All ZIP Codes",""),t.displayName=this.utilsService.toTitleCase(t.report.location.city)),this.quickActionsService.reportParams.set(t),this.quickActionsService.settings.set(t.settings)}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-actions"]],decls:10,vars:11,consts:[[1,"t-sticky","-t-top-[15px]","t-z-10","t-px-[18px]","md:t-px-[32px]","t-pt-[18px]","md:t-pt-[32px]","t-pb-[20px]","t-backdrop-blur-[5px]",3,"selectedReportChange","queryChange","selectedReport","query","filteredReports","isLoading","chartData","accountTypes"],[1,"t-bg-white","t-rounded-xl","t-border","t-border-base-200","t-shadow","router-content","t-min-h-[530px]","t-mx-[18px]","md:t-mx-[32px]","t-p-8"],[1,"t-flex","t-justify-between","t-items-center"],[1,"t-m-0","font-scale","t-text-[16px]","preview"],[1,"t-flex","t-justify-between","t-mt-8","t-gap-8","t-min-h-[440px]","t-flex-col-reverse","md:t-flex-row"],[1,"t-relative","t-block","t-w-full","t-flex-1","t-border","t-p-6","md:t-p-8","t-rounded-[8px]","t-overflow-hidden"],[1,"font-scale","t-text-[27px]"],[3,"chartData","reportData","isFreemium","isMobile"],[1,"absolute-loader"]],template:function(i,n){i&1&&(a(0,"admin-quick-action-header",0),$e("selectedReportChange",function(c){return Pe(n.selectedReport,c)||(n.selectedReport=c),c})("queryChange",function(c){return Pe(n.query,c)||(n.query=c),c}),l(),a(1,"div",1)(2,"div",2)(3,"span",3),d(4,"Preview"),l()(),a(5,"div",4)(6,"section",5),C(7,Os,2,1)(8,Ds,2,0,"h2",6),l(),y(9,"admin-quick-action-customize",7),l()()),i&2&&(ze("selectedReport",n.selectedReport)("query",n.query),h("filteredReports",n.filteredReports())("isLoading",n.isLoading())("chartData",n.chartData())("accountTypes",n.accountTypes()),s(7),_(n.selectedReport()?7:8),s(2),h("chartData",n.chartData())("reportData",n.reportData.value())("isFreemium",n.accountTypes().freemium)("isMobile",n.isMobile()))},dependencies:[sn,Ye,Vt,mt,xt,qt,Er,Dr],styles:[".title[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:.2s}@starting-style{.title[_ngcontent-%COMP%]{transform:translateY(-20px);opacity:0}}.sharePopover[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:1.8s}@starting-style{.sharePopover[_ngcontent-%COMP%]{transform:scale(0);opacity:0}}.description[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:.65s}@starting-style{.description[_ngcontent-%COMP%]{transform:translateY(20px);opacity:0}}.label-input.comparison-markets[_ngcontent-%COMP%]{height:auto!important;min-height:40px;min-width:0;padding-top:4px;padding-bottom:4px}.label-input.comparison-markets[_ngcontent-%COMP%] .ng-select-container{height:auto!important;min-height:30px}.label-input.comparison-markets[_ngcontent-%COMP%] .ng-value-container{min-width:0;flex-wrap:wrap;gap:4px}.label-input[_ngcontent-%COMP%]{transition-property:opacity;transition-duration:.65s;transition-delay:1.1s}@starting-style{.label-input[_ngcontent-%COMP%]{opacity:0}
37}.action-buttons[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:1.4s}@starting-style{.action-buttons[_ngcontent-%COMP%]{transform:translateY(-20px);opacity:0}}.router-content[_ngcontent-%COMP%]{transition-property:opacity;transition-duration:.65s;transition-delay:1.6s}@starting-style{.router-content[_ngcontent-%COMP%]{opacity:0}}.router-content[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:1.7s}@starting-style{.router-content[_ngcontent-%COMP%] .preview[_ngcontent-%COMP%]{transform:translateY(20px);opacity:0}}.router-content[_ngcontent-%COMP%] .right-section[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:2.1s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section[_ngcontent-%COMP%]{transform:translate(50%);opacity:0}}.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(1) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(1) div[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:2.4s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(1) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(1) div[_ngcontent-%COMP%]{opacity:0;transform:translate(50%)}}.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(2) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(2) div[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:2.7s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(2) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(2) div[_ngcontent-%COMP%]{opacity:0;transform:translate(50%)}}.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(3) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(3) div[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:3s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(3) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(3) div[_ngcontent-%COMP%]{opacity:0;transform:translate(50%)}}.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(4) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(4) div[_ngcontent-%COMP%]{transition-property:transform,opacity;transition-duration:.65s;transition-delay:3.3s}@starting-style{.router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(4) svg[_ngcontent-%COMP%], .router-content[_ngcontent-%COMP%] .right-section__buttons[_ngcontent-%COMP%] *[_ngcontent-%COMP%]:nth-child(4) div[_ngcontent-%COMP%]{opacity:0;transform:translate(50%)}}[_nghost-%COMP%]{display:block}[_nghost-%COMP%] .ng-select{width:100%;font-size:15px;font-family:Inter,sans-serif;font-weight:400;outline:none;cursor:text}[_nghost-%COMP%] .ng-select .ng-select-container{height:40px;border-radius:0;background:transparent;border:none;box-shadow:none}[_nghost-%COMP%] .ng-select .ng-select-container:hover{border-color:#a78bfa}[_nghost-%COMP%] .ng-select .ng-input input{font-size:15px;line-height:24px;font-weight:300;outline:none;background:transparent}[_nghost-%COMP%] .ng-dropdown-panel{border-radius:.75rem;overflow:hidden;left:-30px;width:calc(100% + 40px)}"]})}}return e})();var Rs=e=>({maxWidth:e});function Ns(e,r){if(e&1&&(a(0,"div",0),y(1,"admin-quick-action-preview-header",1),a(2,"div",2),y(3,"admin-report-item",3),l()()),e&2){let t=m();h("ngStyle",ut(11,Rs,t.marketSnapshotFormat().width+"px")),s(),h("settings",t.settings),s(2),h("data",t.report)("fullView",!0)("hideShareLink",!0)("showDownloadButton",!1)("isShowWeeklyChange",t.isShowWeeklyChange())("isMarketNarrative",t.isShowMarketNarrative())("view",t.marketView())("type",t.selectedType())("isQuickActions",!0)}}var Nr=(()=>{class e{constructor(){this.quickActionsService=g($),this.shareFormats=Pt,this._settings=this.quickActionsService.settings,this._report=this.quickActionsService.selectedReport,this.marketView=this.quickActionsService.marketView,this.selectedType=this.quickActionsService.chartType,this.isShowMarketNarrative=this.quickActionsService.isShowMarketNarrative,this.isShowWeeklyChange=this.quickActionsService.isShowWeeklyChange,this.selectedFormat=x(Pt.square),this.marketSnapshotFormat=f(()=>this.selectedFormat().marketSnapshot),E(()=>{let t=this.quickActionsService.size();this.selectedFormat.set(this.shareFormats[t])})}get settings(){return this._settings()}get report(){return this._report()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-market-snapshot"]],decls:1,vars:1,consts:[["id","quick-market-snapshot",1,"t-w-full","t-mx-auto","t-transition-all",3,"ngStyle"],[3,"settings"],[1,"t-pt-8","t-bg-white"],[1,"t-border","t-block","t-rounded-xl",3,"data","fullView","hideShareLink","showDownloadButton","isShowWeeklyChange","isMarketNarrative","view","type","isQuickActions"]],template:function(i,n){i&1&&C(0,Ns,4,13,"div",0),i&2&&_(n.settings?0:-1)},dependencies:[xn,mt,ce,On,Ue],encapsulation:2})}}return e})();var qs=["parentRef"],Ls=e=>({maxWidth:e});function Is(e,r){if(e&1&&(a(0,"div"),y(1,"admin-quick-action-modern-chart",7),l()),e&2){let t=m(2);h("@scale",void 0),s(),h("primaryColor","#2318FF")("maiNow",t.maiNow())("maiThen",t.maiThen())("maiLabel",t.maiLabel())("disableAnimation",!1)("size",t.isMobile?1.1:1.5)("index",1)("reportName",t.report.displayName)}}function Qs(e,r){if(e&1&&(a(0,"p",12),d(1),l()),e&2){let t=m(3);s(),M(" ",t.maiLabel()," ")}}function Fs(e,r){e&1&&(a(0,"p",13),d(1),l()),e&2&&(s(),M(" ",r," "))}function Vs(e,r){if(e&1&&(a(0,"div",5)(1,"h2",8),d(2),l(),a(3,"p",9),d(4),l(),a(5,"div",10),y(6,"report-market-action-chart",11),l(),C(7,Qs,2,1,"p",12)(8,Fs,2,1,"p",13),l()),e&2){let t,i;m();let n=L(1),o=m();h("@scale",void 0),s(2),M(" ",o.report.displayName," "),s(2),M(" ",o.chartMeta()," "),s(2),h("primaryColor","#"+((t=o.settings==null?null:o.settings.primaryColor)!==null&&t!==void 0?t:"2318FF"))("disableAnimation",!0)("index",1)("maiNow",o.maiNow())("maiThen",o.maiThen())("maiLabel","")("graphScale",o.graphScale())("isMobile",o.isMobile)("parentRef",n),s(),_(o.maiLabel()?7:-1),s(),_((i=o.segmentPriceLine())?8:-1,i)}}function zs(e,r){if(e&1&&(a(0,"p",15),d(1),l()),e&2){let t=m(3);s(),q(t.conditionalText.value().median_market_trend)}}function $s(e,r){e&1&&d(0," Loading... ")}function Hs(e,r){e&1&&(a(0,"p",15),d(1,"Not Found!"),l())}function Us(e,r){if(e&1&&C(0,$s,1,0)(1,Hs,2,0,"p",15),e&2){let t=m(3);_(t.conditionalText.isLoading()?0:1)}}function Bs(e,r){if(e&1&&(a(0,"div",6)(1,"h3",14),d(2,"Market Narrative"),l(),C(3,zs,2,1,"p",15)(4,Us,2,1),l()),e&2){let t=m(2);h("@weekly",void 0),s(3),_(t.conditionalText.value()&&t.conditionalText.value().median_market_trend?3:4)}}function js(e,r){if(e&1&&(a(0,"div",1,0),y(2,"admin-quick-action-preview-header",2),a(3,"div",3)(4,"div",4),C(5,Is,2,9,"div")(6,Vs,9,14,"div",5),l(),C(7,Bs,5,2,"div",6),l()()),e&2){let t=m();h("ngStyle",ut(8,Ls,t.marketActionFormat().width+"px")),s(2),h("settings",t.settings),s(),rt("t-border-t",t.hasBranding())("t-border-base-300",t.hasBranding()),s(2),_(t.marketActionType==="modern"?5:6),s(2),_(t.marketNarrative?7:-1)}}var Ws=21;function Hi(){let e=new Date;return`${e.getMonth()+1}/${e.getDate()}/${e.getFullYear()}`}var qr=(()=>{class e{constructor(){this.quickActionsService=g($),this.marketProfileService=g(Tn),this.apiService=g(et),this.mobileService=g(Ft),this._settings=this.quickActionsService.settings,this._report=this.quickActionsService.selectedReport,this._marketNarrative=this.quickActionsService.showMarketNarrative,this._dataType=this.quickActionsService.dataType,this._selectedMarketSegment=this.quickActionsService.selectedMarketSegment,this._marketActionType=this.quickActionsService.marketActionType,this._isMobile=this.mobileService.isMobile,this.hasBranding=this.quickActionsService.hasBranding,this.graphScale=x(1),this.shareFormats=Pt,this.selectedFormat=x(Pt.square),this.marketActionFormat=f(()=>this.selectedFormat().marketAction),this.selectedSegment=f(()=>kt(this._selectedMarketSegment())),this.chartMeta=f(()=>{let t=this.dataType===100?"Houses":this.dataType===200?"Condos":"Co-Op";return`${this.date()} \xB7 ${t} \xB7 Market Action Index`}),this.segmentPriceLine=f(()=>{let t=this.selectedSegment();if(t.id===0)return null;let i=De(this.report?.tableData,t.quartile);return i?`${t.label}: Median price ${i}`:null}),this.reportKey=f(()=>{let t=this.report,i=this._dataType();return t?`${t.hash}|${i}`:null}),this.segmentMaiData=f(()=>this.getSegmentMaiData(this.report?.chartData,this.selectedSegment().quartile)),this.marketActionData=f(()=>{let t=this.segmentMaiData();if(t)return W(z({},t),{maiLabel:this.marketProfileService.getMaiLabel(t.mai)});if(this.selectedSegment().id!==0)return{date:Hi(),mai:0,maiMonthBefore:0,maiLabel:""};let i=this.report,n=i?.tableData&&i.tableData?.quartile?this.marketProfileService.calcMarketProfileData(i.tableData,i.displayName):null;return{date:Hi(),mai:this.toFiniteNumber(n?.maiNow),maiMonthBefore:this.toFiniteNumber(n?.maiThen),maiLabel:n?.maiLabel??""}}),this.maiNow=f(()=>this.marketActionData().mai),this.maiThen=f(()=>this.marketActionData().maiMonthBefore),this.maiLabel=f(()=>this.marketActionData().maiLabel),this.date=f(()=>this.marketActionData().date),this.conditionalText=X({request:()=>this.reportKey(),loader:({request:t})=>{if(!t)return G(null);let[i,n]=t.split("|");return this.apiService.getConditionalText(i,n)}}),E(()=>{let t=this.conditionalText.value(),i=!!t&&!!t.median_market_trend;this.quickActionsService.isBlockMarketNarrative.set(!i),this.quickActionsService.isShowMarketNarrative.set(i),this.quickActionsService.conditionalText.set(t)}),E(()=>{let t=this.quickActionsService.size();this.selectedFormat.set(this.shareFormats[t]),t==="square"?this.graphScale.set(1.25):t==="landscape"?this.graphScale.set(1.5):this.graphScale.set(1.05)})}get settings(){return this._settings()}get report(){return this._report()}get marketNarrative(){return this._marketNarrative()}get marketActionType(){return this._marketActionType()}get dataType(){return this._dataType()}get isMobile(){return this._isMobile()}formatDate(t){let i=/^(\d{4})-(\d{2})-(\d{2})/.exec(t??"");return i?`${Number(i[2])}/${Number(i[3])}/${i[1]}`:Hi()}getSegmentMaiData(t,i){let n=Array.isArray(t)?t:[],o=n.find(D=>["90","90D"].includes(String(D?.range).toUpperCase()))??n[1],c=o?.quartile?.indexOf(i)??-1,p=o?.date,u=c>=0?o?.mai?.[c]:null;if(!p?.length||!u?.length)return null;let b=this.findLastFiniteIndex(u);if(b<0)return null;let P=this.findClosestPreviousMonthIndex(p,u,b);return{date:this.formatDate(p[b]),mai:Number(u[b]),maiMonthBefore:Number(u[P])}}findLastFiniteIndex(t){for(let i=t.length-1;i>=0;i--)if(t[i]!=null&&Number.isFinite(Number(t[i])))return i;return-1}findClosestPreviousMonthIndex(t,i,n){let o=Date.parse(t[n]);if(!Number.isFinite(o))return this.findPreviousFiniteIndex(i,n);let c=o-Ws*24*60*60*1e3,p=n,u=Number.POSITIVE_INFINITY;for(let b=0;b<n;b++){if(i[b]==null||!Number.isFinite(Number(i[b])))continue;let P=Date.parse(t[b]);if(!Number.isFinite(P))continue;let D=Math.abs(P-c);
37D<u&&(p=b,u=D)}return p}findPreviousFiniteIndex(t,i){for(let n=Math.max(0,i-3);n>=0;n--)if(t[n]!=null&&Number.isFinite(Number(t[n])))return n;return i}toFiniteNumber(t){let i=Number(t);return Number.isFinite(i)?i:0}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-market-action"]],viewQuery:function(i,n){if(i&1&&Te(qs,5),i&2){let o;Me(o=Ae())&&(n.parentRef=o.first)}},decls:1,vars:1,consts:[["parentRef",""],["id","quick-market-action",1,"mai-preview","t-w-full","t-relative","t-mx-auto","t-transition-all",3,"ngStyle"],[3,"settings"],[1,"t-flex","t-flex-col","t-bg-white"],[1,"t-w-full","t-flex","t-justify-center","t-transition-all","t-duration-500"],[1,"mai-content","t-w-full","t-text-center"],["data-market-narrative","",1,"t-p-6","t-pt-8","t-border-t","t-border-t-base-300"],[3,"primaryColor","maiNow","maiThen","maiLabel","disableAnimation","size","index","reportName"],[1,"mai-headline","font-scale","t-m-0","t-font-bold","t-leading-tight","t-text-black"],[1,"mai-meta","font-hanken","t-m-0","t-mt-1","t-text-gray-500"],[1,"t-flex","t-justify-center","t-my-3"],[3,"primaryColor","disableAnimation","index","maiNow","maiThen","maiLabel","graphScale","isMobile","parentRef"],[1,"mai-signal","font-scale","t-m-0","t-font-bold","t-leading-tight","t-text-black"],[1,"mai-segment","font-hanken","t-m-0","t-mt-1","t-text-gray-500"],[1,"font-inter","t-text-[20px]","t-m-0","t-mb-4","t-font-bold"],[1,"t-text-[16px]","font-hanken","t-font-light","t-m-0"]],template:function(i,n){i&1&&C(0,js,8,10,"div",1),i&2&&_(n.settings?0:-1)},dependencies:[ce,$n,In,Ln,Ue],styles:[".helvetica[_ngcontent-%COMP%]{font-family:Helvetica Neue,sans-serif}.mai-preview[_ngcontent-%COMP%]{container-type:inline-size}.mai-content[_ngcontent-%COMP%]{padding:clamp(20px,5.7cqw,28px) clamp(12px,3.8cqw,16px) clamp(20px,4.8cqw,24px)}.mai-headline[_ngcontent-%COMP%]{font-size:clamp(22px,6.67cqw,30px);overflow-wrap:anywhere;text-wrap:balance}.mai-meta[_ngcontent-%COMP%]{font-size:clamp(12px,3.34cqw,14px);white-space:nowrap}.mai-signal[_ngcontent-%COMP%]{font-size:clamp(20px,5.25cqw,24px);text-wrap:balance}.mai-segment[_ngcontent-%COMP%]{font-size:clamp(12px,3.1cqw,13px);text-wrap:balance}@container (max-width: 360px){.mai-meta[_ngcontent-%COMP%]{letter-spacing:-.01em}}"],data:{animation:[At("weekly",[tt(":enter",[O({opacity:0,height:"0px"}),B("350ms ease-out",O({opacity:1,height:"*"}))]),tt(":leave",[O({opacity:1,height:"*"}),B("350ms ease-in",O({opacity:0,height:"0px"}))])]),At("scale",[tt(":enter",[O({opacity:0,transform:"scale(0.1)"}),B("350ms 350ms ease-out",O({opacity:1,transform:"scale(1)"}))]),tt(":leave",[O({opacity:1,transform:"scale(1)",position:"absolute",top:"64px"}),B("350ms ease-in",O({opacity:0,transform:"scale(0.1)"}))])])]}})}}return e})();function Gs(e,r){if(e&1&&U(0,1),e&2){m();let t=L(7);h("ngTemplateOutlet",t)}}function Zs(e,r){e&1&&(a(0,"p",2),d(1,"Select up to 3 markets to create your chart."),l())}function Ks(e,r){e&1&&y(0,"loading")}function Ys(e,r){if(e&1){let t=A();a(0,"div",3)(1,"p"),d(2,"Unable to load the selected markets. Please try again."),l(),a(3,"button",5),v("click",function(){k(t);let n=m();return S(n.comparison.resource.reload())}),d(4,"Retry"),l()()}}function Js(e,r){e&1&&(a(0,"p",4),d(1,"No common data is available for the selected markets and filters."),l())}function Xs(e,r){if(e&1&&(a(0,"p",6),d(1),l()),e&2){let t=m(2);s(),M(" No data for: ",t.comparison.model().missingSeries.join(", "),". ")}}function tc(e,r){if(e&1){let t=A();C(0,Xs,2,1,"p",6),a(1,"div",7)(2,"div",8),y(3,"admin-quick-action-preview-header",9),l(),U(4,1),a(5,"admin-quick-action-report-chart",10),v("selectedHighchart",function(n){k(t);let o=m();return S(o.selectedHighchart=n)})("dateSpanSelected",function(n){k(t);let o=m();return S(o.selectChartRange(n))})("inspectionStarted",function(){k(t);let n=m();return S(n.chartTracking.track("chart_hovered"))}),l()()}if(e&2){let t,i=m(),n=L(7);_(i.comparison.model().missingSeries.length?0:-1),s(),we("max-width",i.SIZE_WIDTH[i.selectedSize]+"px"),s(2),h("settings",i.settings),s(),h("ngTemplateOutlet",n),s(),h("chartSelect",i.page(
37))("charts",i.charts)("chartData",i.chartData)("report",i.report)("primaryColor","#"+((t=i.settings==null?null:i.settings.primaryColor)!==null&&t!==void 0?t:"2318FF"))("sizePreset",i.selectedSize)("SIZE_WIDTH",i.SIZE_WIDTH)("hasTitle",!0)("automaticTitle",i.automaticTitle())("automaticTitleCandidates",i.comparison.titleCandidates())("seriesContext",i.comparison.model().seriesContext)}}function ec(e,r){if(e&1){let t=A();a(0,"div",12)(1,"button",13),v("click",function(){k(t);let n=m(2);return S(n.chartTracking.resetZoom())}),y(2,"i",14),d(3," Reset zoom "),l()()}if(e&2){let t=m(2);we("max-width",t.SIZE_WIDTH[t.selectedSize]+"px"),s(),h("disabled",t.comparison.resource.isLoading())}}function ic(e,r){if(e&1&&C(0,ec,4,3,"div",11),e&2){let t=m();_(t.chartCreatorState.canResetZoom()?0:-1)}}var Lr=(()=>{class e{get report(){return this._report()}get chartData(){return this.comparison.model()?.data}get selectedChart(){return this._selectedChart()}get settings(){return this._settings()}get selectedSize(){return this._selectedSize()}get selectedHighchart(){return this._selectedHighchart()}set selectedHighchart(t){this._selectedHighchart.set(t)}constructor(){this.quickActionsService=g($),this.mobileService=g(Ft),this.apiService=g(et),this.chartCreatorState=g(bt),this.comparison=g(zt),this.chartTracking=g(wt),this.navigation=g(te).getCurrentNavigation(),this.openedTracked=!1,this._selectedChart=this.chartCreatorState.selectedChart,this._settings=this.quickActionsService.settings,this._selectedSize=this.quickActionsService.size,this._report=this.quickActionsService.selectedReport,this._selectedHighchart=this.quickActionsService.selectedHighchart,this._dataType=this.quickActionsService.dataType,this.charts=oe,this.SIZE_WIDTH=Un,this.automaticTitle=this.comparison.title,this.page=f(()=>this.comparison.model()?.selection),this.isMobile=f(()=>this.mobileService.isMobile()),this.reportKey=f(()=>{let t=this.report,i=this._dataType();return t?`${t.hash}|${i}`:null}),this.conditionalText=X({request:()=>this.reportKey(),loader:({request:t})=>{if(!t)return G(null);let[i,n]=t.split("|");return this.apiService.getConditionalText(i,n)}}),E(()=>{if(this.openedTracked||this.quickActionsService.activeSection()!=="chart-creator"||this.comparison.resource.isLoading()||!this.comparison.resource.value())return;this.openedTracked=!0;let t=this.navigation?.extras.state?.chartCreatorEntry,i=this.navigation?.extractedUrl,n=t==="quick_actions_tile"?t:this.navigation?.previousNavigation||i?.fragment||Object.keys(i?.queryParams??{}).length?"deep_link":"direct_url";pt(()=>this.chartTracking.track("chart_creator_opened",{entry_point:n}))}),E(()=>{this.quickActionsService.conditionalText.set(this.conditionalText.value())})}selectChartRange(t){this.chartTracking.setDates(St(t.start),St(t.end),"drag_selection")}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-chart-creator"]],decls:8,vars:2,consts:[["zoomControls",""],[3,"ngTemplateOutlet"],[1,"font-hanken","t-text-gray-500"],["role","alert",1,"font-hanken","t-text-gray-600","t-space-y-4"],["role","status",1,"font-hanken","t-text-gray-500"],["type","button",1,"t-btn","btn-purple-outline",3,"click"],["role","status",1,"font-hanken","t-text-[13px]","t-text-gray-500","t-mb-4"],["id","quick-chart-creator",1,"t-mx-auto","t-transition-all"],[1,"t-mb-4"],[3,"settings"],[3,"selectedHighchart","dateSpanSelected","inspectionStarted","chartSelect","charts","chartData","report","primaryColor","sizePreset","SIZE_WIDTH","hasTitle","automaticTitle","automaticTitleCandidates","seriesContext"],["data-chart-ui-only","",1,"t-flex","t-justify-end","t-mx-auto","t-mb-4",3,"max-width"],["data-chart-ui-only","",1,"t-flex","t-justify-end","t-mx-auto","t-mb-4"],["type","button",1,"t-btn","btn-purple-outline","t-min-h-[44px]","t-h-[44px]","t-px-5","t-text-[16px]","font-hanken",3,"click","disabled"],["aria-hidden","true",1,"fa","fa-search-minus"]],template:function(i,n){i&1&&C(0,Gs,1,1,"ng-container",1)(1,Zs,2,0,"p",2)(2,Ks,1,0,"loading")(3,Ys,5,0,"div",3)(4,Js,2,0,"p",4)(5,tc,6,16)(6,ic,1,1,"ng-template",null,0,Z),i&2&&(_(n.comparison.hasData()?-1:0),s(),_(n.comparison.markets().length?n.comparison.resource.isLoading()?2:n.comparison.failedMarkets().length||n.c
37omparison.resource.error()?3:n.comparison.hasData()?n.chartData?5:-1:4:1))},dependencies:[Mt,Xe,Hn,mt,ce,xt,qt],encapsulation:2})}}return e})();var Ir=()=>({}),sc=()=>[100];function cc(e,r){if(e&1&&(a(0,"div",0),y(1,"report-header",1),a(2,"section")(3,"div",2)(4,"div"),y(5,"report-option-bar",3),l(),a(6,"div",4),y(7,"report-week-summary",5)(8,"report-market-action",6),l(),a(9,"div",4),y(10,"report-profile-table",7),l()(),a(11,"div",8),y(12,"report-chart-frame",9),l(),a(13,"div",10)(14,"div",11),y(15,"report-segments-table",12),l()()()()),e&2){let t=m();s(),h("reportParameters",t.reportParams())("queryParams",J(38,Ir))("tourDone",!0)("resType",100)("hasBeenCaptured",!1)("showSidePanel",!1)("showUserMenu",t.isFreemium())("hideShareButtons",!0)("isAuthorized",!0)("isPreview",!0)("isQuickActions",!0)("primaryColor",t.primaryColor()),s(4),h("resTypes",J(39,sc))("resType",100)("sfhInsufficient",!0)("mfhInsufficient",!1),s(2),h("primaryColor",t.primaryColor())("reportParameters",t.reportParams())("hideLeadCapture",t.reportParams().isFreemium),s(),h("hidden",t.noResults())("primaryColor",t.primaryColor())("conditionalText",t.conditionalText()),s(2),h("tableData",t.tableData())("chartData",t.chartData())("rentalData",t.rentalData())("resType",100)("primaryColor",t.primaryColor())("displayName",t.displayName())("displayNameWithZip",t.displayName())("reportParameters",t.reportParams())("hideLeadCapture",t.reportParams().isFreemium),s(2),h("primaryColor",t.primaryColor())("chartData",t.chartData())("conditionalText",t.conditionalText())("queryParams",J(40,Ir)),s(),h("hidden",t.noResults()),s(2),h("primaryColor",t.primaryColor())("tableData",t.tableData())}}var Qr=(()=>{class e{constructor(){this.isFreemium=T(!1),this.primaryColor=T(null),this.tableData=T(null),this.rentalData=T(null),this.chartData=T(null),this.conditionalText=T(null),this.report=T.required(),this.reportParams=T.required(),this.displayName=f(()=>
37this.report()?.displayName),this.noResults=f(()=>{let t=this.tableData();return!t||t.date==null})}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-report-preview"]],inputs:{isFreemium:[1,"isFreemium"],primaryColor:[1,"primaryColor"],tableData:[1,"tableData"],rentalData:[1,"rentalData"],chartData:[1,"chartData"],conditionalText:[1,"conditionalText"],report:[1,"report"],reportParams:[1,"reportParams"]},decls:1,vars:1,consts:[[1,"relative","t-max-w-[900px]","t-mx-auto"],[3,"reportParameters","queryParams","tourDone","resType","hasBeenCaptured","showSidePanel","showUserMenu","hideShareButtons","isAuthorized","isPreview","isQuickActions","primaryColor"],["id","reportTourFirstStep",1,"row"],[3,"resTypes","resType","sfhInsufficient","mfhInsufficient"],[1,"col-12","col-lg-6"],[3,"primaryColor","reportParameters","hideLeadCapture"],[3,"hidden","primaryColor","conditionalText"],[3,"tableData","chartData","rentalData","resType","primaryColor","displayName","displayNameWithZip","reportParameters","hideLeadCapture"],[1,"row"],[3,"primaryColor","chartData","conditionalText","queryParams"],[1,"row",3,"hidden"],[1,"col-md-12"],[3,"primaryColor","tableData"]],template:function(i,n){i&1&&C(0,cc,16,41,"div",0),i&2&&_(n.reportParams()?0:-1)},dependencies:[Qn,Nn,xt,ci,si,qn,pi,li,di,mi,ai,oi],encapsulation:2})}}return e})();var lc=()=>[Mt,Sn],pc=()=>({pageNumber:2}),mc=e=>({pageNumber:e});function dc(e,r){if(e&1&&y(0,"img",17),e&2){let t=m(2);h("src",t.reportParameters().settings.logoUrl,be)}}function hc(e,r){if(e&1&&y(0,"img",18),e&2){let t=m(2);h("src",t.reportParameters().settings.logoUrl,be)}}function uc(e,r){if(e&1&&(a(0,"div"),d(1),l()),e&2){let t=m(3);s(),Yt(" Presented by ",t.reportParameters().settings.pdfUser.first," ",t.reportParameters().settings.pdfUser.last," ")}}function gc(e,r){if(e&1&&(a(0,"div"),d(1),l()),e&2){let t=m(3);s(),q(t.reportParameters().settings.pdfUser.company)}}function fc(e,r){if(e&1&&(a(0,"div"),d(1),l()),e&2){let t=m(3);s(),q(t.reportParameters().settings.phoneNumber)}}function _c(e,r){if(e&1&&(a(0,"div"),d(1),l()),e&2){let t=m(3);s(),q(t.reportParameters().settings.pdfUser.email)}}function Cc(e,r){if(e&1&&(a(0,"div",19),C(1,uc,2,2,"div")(2,gc,2,1,"div")(3,fc,2,1,"div")(4,_c,2,1,"div"),l()),e&2){let t,i,n,o,c=m(2);s(),_(!((t=c.reportParameters())==null||t.settings==null||t.settings.pdfUser==null)&&t.settings.pdfUser.first&&(!((t=c.reportParameters())==null||t.settings==null||t.settings.pdfUser==null)&&t.settings.pdfUser.last)?1:-1),s(),_(!((i=c.reportParameters())==null||i.settings==null||i.settings.pdfUser==null)&&i.settings.pdfUser.company?2:-1),s(),_(!((n=c.reportParameters())==null||n.settings==null)&&n.settings.phoneNumber?3:-1),s(),_(!((o=c.reportParameters())==null||o.settings==null||o.settings.pdfUser==null)&&o.settings.pdfUser.email?4:-1)}}function xc(e,r){if(e&1&&(a(0,"p",34),d(1),l()),e&2){let t=m(2).$implicit,i=m(2);s(),M(" ",i.chartCaptions()[t[0].caption]," ")}}function yc(e,r){if(e&1&&(a(0,"div",35),y(1,"report-chart",38),l()),e&2){let t=m(2),i=t.$implicit,n=t.$index,o=m(2);s(),h("chartSelect",i[0])("chartData",o.chartData())("primaryColor",o.primaryColor())("target",o.getPageTarget(n,0))}}function vc(e,r){if(e&1&&(a(0,"p",34),d(1),l()),e&2){let t=m(2).$implicit,i=m(2);s(),M(" ",i.chartCaptions()[t[1].caption]," ")}}function kc(e,r){if(e&1&&(a(0,"div",35),y(1,"report-chart",38),l()),e&2){let t=m(2),i=t.$implicit,n=t.$index,o=m(2);s(),h("chartSelect",i[1])("chartData",o.chartData())("primaryColor",o.primaryColor())("target",o.getPageTarget(n,1))}}function Sc(e,r){if(e&1&&(a(0,"div",22)(1,"div",23),U(2,24),a(3,"div",25)(4,"div",32)(5,"h3",33),d(6),l(),C(7,xc,2,1,"p",34)(8,yc,2,4,"div",35),l(),a(9,"div",36)(10,"h3",37),d(11),l(),C(12,vc,2,1,"p",34)(13,kc,2,4,"div",35),l()(),U(14,31),l()()),e&2){let t=m(),i=t.$implicit,n=t.$index,o=m(2),c=L(2),p=L(4);s(2),h("ngTemplateOutlet",c),s(),h("hidden",o.noResults!==!1),s(2),Q("style",o.primaryTextColorStyle(),H),s(),M(" ",i[0].title," "),s(),_(i[0].caption?7:-1),s(),_(o.primaryColor()&&o.chartData()?8:-1),s(2),Q("style",o.primaryTextColorStyle(),H),s(),M(" ",i[
371].title," "),s(),_(i[1].caption?12:-1),s(),_(o.primaryColor()&&o.chartData()?13:-1),s(),h("ngTemplateOutlet",p)("ngTemplateOutletContext",ut(12,mc,n+3))}}function bc(e,r){e&1&&y(0,"div",39)}function wc(e,r){e&1&&(C(0,Sc,15,14)(1,bc,1,0),Yi(2,0,lc,null,1),Ji(0,-1))}function Tc(e,r){if(e&1&&(a(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5),y(4,"img",6),a(5,"div",7),y(6,"img",8),l()(),a(7,"div",9)(8,"div",10)(9,"h1",11),d(10),l(),a(11,"h2",12),d(12),l(),a(13,"div",13)(14,"p",14),d(15),l(),a(16,"p",15),d(17),l()()(),a(18,"div",16),C(19,dc,1,1,"img",17)(20,hc,1,1,"img",18),l(),C(21,Cc,5,4,"div",19),l(),a(22,"div",20),y(23,"div",21),l()()(),a(24,"div",22)(25,"div",23),U(26,24),a(27,"div",25)(28,"div"),y(29,"report-profile-table",26),l(),a(30,"div"),y(31,"report-week-summary",27)(32,"report-market-action",28),l()(),a(33,"div",29)(34,"div"),y(35,"report-segments-table",30),l()(),U(36,31),l()(),ot(37,wc,4,0,null,null,Ve),l()),e&2){let t,i,n=m(),o=L(2),c=L(4);Q("style",n.statusStyle(),H),s(2),Q("style",n.statusStyle(),H),s(3),Q("style",n.colorStyle(),H),s(),Q("style",n.houseColorStyle(),H),s(4),M(" ",(t=n.reportParameters().settings)==null?null:t.name," "),s(2),M(" ",n.reportParameters().displayNameWithZip," "),s(3),M(" REPORT FOR ",n.displayDate," "),s(2),M(" ",n.resTypeLabel()," "),s(2),_(n.reportParameters().settings.themeId===1?19:20),s(2),_((i=n.reportParameters())!=null&&i.settings&&!n.reportParameters().settings.hidePdfPresentedBy?21:-1),s(2),Q("style",n.colorStyle(),H),s(3),h("ngTemplateOutlet",o),s(),h("hidden",n.noResults===!0),s(2),h("tableData",n.tableData())("chartData",n.chartData())("rentalData",n.rentalData())("resType",n.resType())("primaryColor",n.primaryColor())("displayName",n.reportParameters().displayName)("displayNameWithZip",n.reportParameters().displayNameWithZip)("reportParameters",n.reportParameters()),s(2),h("reportParameters",n.reportParameters())("hideDate",!0),s(),h("primaryColor",n.primaryColor())("conditionalText",n.conditionalText())("disableAnimation",!0),s(),h("hidden",n.noResults===!0),s(2),h("primaryColor",n.primaryColor())("tableData",n.tableData()),s(),h("ngTemplateOutlet",c)("ngTemplateOutletContext",J(31,pc)),s(),at(n.reportCharts.pages)}}function Mc(e,r){if(e&1&&(a(0,"small"),d(1),l()),e&2){let t=m(2);Q("style",t.textColorStyle(),H),s(),M(" ",t.reportParameters().settings.subHeader," ")}}function Ac(e,r){if(e&1&&(a(0,"div",40)(1,"div")(2,"div",41)(3,"p",42),d(4),l(),a(5,"h2",43)(6,"strong",44),d(7),l()()(),a(8,"div",45)(9,"h3"),d(10),l(),C(11,Mc,2,2,"small"),l()()()),e&2){let t=m();s(4),M(" ",t.resType()==100?"Single-Family Homes":t.resType()==400?"Co-Ops":"Condos/Townhomes"," "),s(2),Q("style",t.primaryTextColorStyle(),H),s(),M(" ",t.reportParameters().displayNameWithZip," "),s(),Q("style",t.colorStyle(),H),s(),Q("style",t.textColorStyle(),H),s(),M(" ",t.reportParameters().settings.name," "),s(),_(t.reportParameters().settings.subHeader?11:-1)}}function Pc(e,r){if(e&1&&(a(0,"div",46)(1,"p",48),d(2),l(),a(3,"div",49)(4,"small"),d(5),l(),a(6,"div",50),d(7),l()()()),e&2){let t=m().pageNumber,i=m();Q("style",i.colorStyle(),H),s(),Q("style",i.textColorStyle(),H),s(),M(" ",i.todaysDate," "),s(2),Q("style",i.textColorStyle(),H),s(),M(" Powered by Altos Research, Inc. | www.altos.re | Copyright \xA9 ",i.year," Altos Research, Inc. "),s(),Q("style",i.textColorStyle(),H),s(),Yt(" ",t," of ",i.pages," ")}}function Ec(e,r){if(e&1&&(a(0,"div",47)(1,"div",51)(2,"p",48),d(3),l(),a(4,"div",50),d(5),l()()()),e&2){let t=m().pageNumber,i=m();Q("style",i.colorStyle(),H),s(2),Q("style",i.textColorStyle(),H),s(),M(" ",i.todaysDate," "),s(),Q("style",i.textColorStyle(),H),s(),Yt(" ",t," of ",i.pages," ")}}function Oc(e,r){if(e&1&&C(0,Pc,8,8,"div",46)(1,Ec,6,6,"div",47),e&2){let t=m();_(!t.hideCopyright()&&t.reportParameters()?0:-1),s(),_(t.hideCopyright()&&t.reportParameters()?1:-1)}}var Fr=(()=>{class e{constructor(){this.apiService=g(et),this.dataService=g(wn),this.domSanitizer=g(on),this.reportParameters=T.required(),this.chartData=T(null),this.tableData=T(null),this.rentalData=T(null),this.reportHash=T(null),this.conditionalText=T(null),this.primaryColor=T(void 0),this.resType=T(100),this._conditionalQuartileText=x(null),this.noResults=!1,this.todaysDate=new Date().toDateString(),this.displayDate=new Date().toLocaleDateString(),this.year=new Date().getFullYear(),this.chartParams={charts:{price_median:"Median List Price",dom_mean:"Average Days on Market (DOM)",dom_median:"Median Days on Market (DOM)",per_sqft_median:"Price Per Square Foot",price_decreased_percent:"Properties with Price Decrease",price_increased_percent:"Properties with Price Increase",relisted_percent:"Relisted",count:"Inventory",mai:"Market Action Index"},quartiles:[["__ALL"],["1","2","3","4"]],rollingAvg:[["0","1"],["1"]]},this.reportCharts={pages:[[{chart:"price_median",title:"Median List Price",rollingAvgSelection:this.chartParams.rollingAvg[0],quartileSelection:this.chartParams.quartiles[0],caption:"price_median",chartDisableAnimation:!0,chartSize:[850,350]},{chart:"price_median",title:"Segments",rollingAvgSelection:this.chartParams.rollingAvg[1],quartileSelection:this.chartParams.quartiles[1],caption:"price_median_quartile",chartDisableAnimation:!0,chartSize:[850,350]}],[{chart:"per_sqft_median",title:"Price Per Square Foot",rollingAvgSelection:this.chartParams.rollingAvg[0],quartileSelection:this.chartParams.quartiles[0],caption:"per_sqft_median",chartDisableAnimation:!0,chartSize:[850,350]},{chart:"count",title:"Inventory",rollingAvgSelection:this.chartParams.rollingAvg[0],quartileSelection:this.chartParams.quartiles[0],caption:"inventory_trend",chartDisableAnimation:!0,chartSize:[850,350]}],[{chart:"mai",title:"Market Action Index",rollingAvgSelection:this.chartParams.rollingAvg[0],quartileSelection:this.chartParams.quartiles[0],caption:"mai",chartDisableAnimation:!0,chartSize:[850,350]},{chart:"mai",title:"Market Action Segments",rollingAvgSelection:this.chartParams.rollingAvg[1],quartileSelection:this.chartParams.quartiles[1],caption:"mai_quartile",chartDisableAnimation:!0,chartSize:[850,350]}],[{chart:"dom_median",title:"Median Days on Market (DOM)",rollingAvgSelection:this.chartParams.rollingAvg[0],quartileSelection:this.chartParams.quartiles[0],caption:"dom_trend",chartDisableAnimation:!0,chartSize:[850,350]},{chart:"dom_median",title:"Segments",rollingAvgSelection:this.chartParams.rollingAvg[1],quartileSelection:this.chartParams.quartiles[1],caption:"dom_quartile",chartDisableAnimation:!0,chartSize:[850,350]}]]},this.pages=this.reportCharts.pages.length+2,this.conditionalQuartileText=f(()=>this._conditionalQuartileText()),this.hideCopyright=f(()=>!!this.reportParameters()?.settings?.hideCopyrightNotice),this.statusStyle=f(()=>this.reportParameters()?.settings?.paused?this.domSanitizer.bypassSecurityTrustStyle("opacity: 0.05 !important"):""),this.colorStyle=f(()=>{let t=this.reportParameters()?.settings?.primaryColor;return t?this.domSanitizer.bypassSecurityTrustStyle(`background-color: #${t} !important; overflow:hidden; padding-bottom: 5px; padding-left: 10px; padding-right: 10px;`):""}),this.primaryTextColorStyle=f(()=>{let t=this.reportParameters()?.settings?.primaryColor;return t?this.domSanitizer.bypassSecurityTrustStyle(`color: #${t} !important`):""}),this.textColorStyle=f(()=>{let t=this.reportParameters()?.settings?.textColor;return t?this.domSanitizer.bypassSecurityTrustStyle(`color: #${t} !important`):""}),this.houseColorStyle=f(()=>{let t=this.reportParameters()?.settings?.textColor;return t?this.domSanitizer.bypassSecurityTrustStyle(t==="fff"?"filter: invert(.6)":"filter: invert(.2)"):""}),this.resTypeLabel=f(()=>{let t=this.resType();return t===100?"Single-Family Homes":t===400?"Co-Ops":"Condos/Townhomes"}),this.chartCaptions=f(()=>{let t={},i=this.conditionalText();i?.median_price_trend&&(t.price_median=i.median_price_trend),i?.median_per_sqft_trend&&(t.per_sqft_median=i.median_per_sqft_trend),i?.median_market_trend&&(t.mai=i.median_market_trend),i?.dom_trend&&(t.dom_trend=i.dom_trend),i?.inventory_trend&&(t.inventory_trend=i.inventory_trend);let n=this.conditionalQuartileText();return n?.median_price_quartile_trend&&(t.price_median_quartile=n.median_price_quartile_trend),n?.median_market_quartile_trend&&(t.mai_quartile=n.median_market_quartile_trend),n?.dom_quartile_trend&&(t.dom_quartile=n.dom_quartile_trend),t}),this.dataService.currentCalcTableData.pipe(cn()).subscribe(t=>this.calcTableData=t),E(t=>{let i=this.resType(),n=this.reportHash(),o=this.reportParameters();if(n=n??o?.reportHash??o?.report?.hash??o?.params?.reportHash??null,!n){this._conditionalQuartileText.set(null);return}let c=this.apiService.getConditionalQuartileText(n,i).subscribe({next:p=>this._conditionalQuartileText.set(p??null),error:()=>this._conditionalQuartileText.set(null)});t(()=>c.unsubscribe())})}getPageTarget(t,i){return`altos-chart-${t}-${i}`}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-report-full"]],hostAttrs:["ngSkipHydration","true"],inputs:{reportParameters:[1,"reportParameters"],chartData:[1,"chartData"],tableData:[1,"tableData"],rentalData:[1,"rentalData"],reportHash:[1,"reportHash"],conditionalText:[1,"conditionalText"],primaryColor:[1,"primaryColor"],resType:[1,"resType"]},decls:5,vars:1,consts:[["header",""],["footer",""],["id","reportContainer",1,"t-w-full","t-mx-auto","t-max-w-[900px]"],[1,"t-break-after-page"],[1,"t-relative","t-bg-white","t-min-h-[1120px]","t-flex","t-flex-col","page"],[1,"t-relative","t-h-[280px]","t-w-full"],["src","assets/images/light-grey-pattern.jpg","alt","",1,"t-w-full","t-h-full","t-object-cover","t-block"],[1,"t-absolute","t-left-[110px]","t-top-[95px]","t-w-[360
37px]","t-h-[250px]","t-rounded-[28px]","t-flex","t-items-center","t-justify-center"],["src","assets/images/house-graph-icon-dkgrey.png","alt","",1,"t-w-[210px]","t-h-[190px]","t-block"],[1,"t-flex-1","t-flex","t-flex-col","t-items-center","t-text-center","t-px-[60px]"],[1,"t-mt-[120px]"],[1,"t-m-0","t-text-[34px]","t-leading-[1.2]","t-font-bold"],[1,"t-mt-[10px]","t-mb-0","t-text-[30px]","t-leading-[1.2]","t-font-bold"],[1,"t-mt-[22px]"],[1,"t-m-0","t-text-[14px]","t-tracking-[0.08em]","t-uppercase"],[1,"t-mt-[10px]","t-mb-0","t-text-[18px]"],[1,"t-mt-[220px]"],["alt","","height","110","width","110",1,"img-reponsive","img-circle","center",3,"src"],["alt","",1,"img-responsive","img-rect","center",2,"max-height","110px","height","110px",3,"src"],[1,"t-mt-[24px]","t-text-[16px]","t-leading-[1.6]"],[1,"t-px-[15px]"],[1,"t-h-[14px]","t-rounded-full"],[1,"break-after-page","t-p-6"],[1,"page"],[3,"ngTemplateOutlet"],[1,"pt-[20px]",3,"hidden"],[1,"market-profile",3,"tableData","chartData","rentalData","resType","primaryColor","displayName","displayNameWithZip","reportParameters"],[3,"reportParameters","hideDate"],[3,"primaryColor","conditionalText","disableAnimation"],[1,"mt-[16px]",3,"hidden"],[3,"primaryColor","tableData"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"w-full"],[1,"m-0","t-text-[22px]","t-font-semibold"],[1,"mt-[8px]",2,"font-size","15pt"],[1,"mt-[10px]"],[1,"w-full","t-mt-[18px]"],[1,"m-0","t-text-[22px]","t-font-semibold",2,"margin-top","0!important"],[3,"chartSelect","chartData","primaryColor","target"],[1,"t-skeleton","t-h-[100vh]"],[1,"t-w-full","color-border","box","t-relative","t-top-4","t-mb-12"],[1,"type-name"],[1,"text-right",2,"margin-bottom","5px"],[1,"text-right",2,"margin","0"],[1,"title"],[1,"header-title"],["id","tfoot",1,"col-xs-12","footer"],["id","tfoot",1,"col-xs-12","footer-hide-copyright","t-mt-8"],[1,"text-center"],[1,"powered-by",2,"text-align","center"],[1,"pull-right","page-numbers"],[2,"text-align","center"]],template:function(i,n){i&1&&C(0,Tc,39,32,"div",2)(1,Ac,12,7,"ng-template",null,0,Z)(3,Oc,2,2,"ng-template",null,1,Z),i&2&&_(n.reportParameters()?0:-1)},dependencies:[Be,Mt,pi,li,ai,oi,ci,si,di,mi,Xe],styles:['h3[_ngcontent-%COMP%]{font-family:BlairMdITC TT,serif;font-size:18px}@font-face{font-family:OpenSans;src:url(/assets/fonts/subsets/OpenSans-Regular-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Regular.ttf) format("truetype");font-display:swap}@font-face{font-family:OpenSansBold;src:url(/assets/fonts/subsets/OpenSans-Bold-latin.woff2) format("woff2"),url(/assets/fonts/OpenSans-Bold.ttf) format("truetype");font-display:swap}body[_ngcontent-%COMP%]{font-size:16pt;margin-left:10mm;margin-right:10mm}#page[_ngcontent-%COMP%]{margin-bottom:50px}.break-after-page[_ngcontent-%COMP%]{min-height:calc(100vh - 50px)}@page{margin-top:0;margin-bottom:0}.cover-title[_ngcontent-%COMP%]{margin-top:200px;text-align:center}.cover-title[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-family:OpenSansBold;font-size:32px}.date[_ngcontent-%COMP%]{text-align:center;font-family:OpenSans;font-size:22px;margin-top:20px}.presented_by[_ngcontent-%COMP%]{font-family:OpenSans;position:absolute;bottom:150px;font-size:18px;text-align:center;width:90%;left:50%;transform:translate(-50%)}.top-background[_ngcontent-%COMP%]{height:320px;object-fit:cover;object-position:22.5% 10px}.house-frame[_ngcontent-%COMP%]{position:absolute;top:150px;left:100px;padding:40px;border-radius:20px}.house-img[_ngcontent-%COMP%]{width:200px;filter:invert(.6)}.center[_ngcontent-%COMP%]{display:block;margin-left:auto;margin-right:auto}.cover-page[_ngcontent-%COMP%]{position:absolute;bottom:20px;width:97%;-webkit-print-color-adjust:exact;border-radius:20px}.cover-footer-text[_ngcontent-%COMP%]{width:97%;margin-top:5px}.market-profile[_ngcontent-%COMP%]{width:450px;float:right;margin-bottom:0;margin-left:10px}.title[_ngcontent-%COMP%]{margin-top:5px}@media print{ a[href]:after{content:none!important}}.header-title[_ngcontent-%COMP%]{border-radius:150px 0 540px;-webkit-print-color-adjust:exact}.header-title[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{margin-bottom:0;margin-top:10px;font-size:16px}.header-title[_ngcontent-%COMP%] small[_ngcontent-%COMP%]{font-size:14px!important}
37.type-name[_ngcontent-%COMP%]{max-width:60%;float:right;padding-top:5px}.footer[_ngcontent-%COMP%]{padding-top:5px;-webkit-print-color-adjust:exact;border-radius:50px 50px 0 0}.footer[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:inline-block;width:90%;margin:auto;padding-left:50px}.footer[_ngcontent-%COMP%] > .page-numbers[_ngcontent-%COMP%]{margin-right:20px!important;padding-top:20px}.footer-hide-copyright[_ngcontent-%COMP%]{margin-top:-50px;padding-top:5px;-webkit-print-color-adjust:exact;border-radius:50px 50px 0 0}.footer-hide-copyright[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:inline-block;width:90%;margin:auto;padding-left:50px}.footer-hide-copyright[_ngcontent-%COMP%] > .page-numbers[_ngcontent-%COMP%]{margin-right:20px!important;padding-top:0;padding-bottom:5px}.altos-footer-no-copyright[_ngcontent-%COMP%]{padding-left:15px;padding-right:15px}']})}}return e})();function Dc(e,r){if(e&1&&y(0,"admin-quick-action-report-preview",0),e&2){let t,i,n=m(2);h("report",n.report)("tableData",n.report.tableData)("chartData",n.report.chartData)("rentalData",n.report.rentalData)("reportParams",n.reportParams())("conditionalText",(t=n.conditionalText.value())==null?null:t.median_market_trend)("primaryColor",n.primaryHex())("isFreemium",(i=(i=n.accountTypes())==null?null:i.freemium)!==null&&i!==void 0?i:!1)}}function Rc(e,r){if(e&1&&y(0,"admin-quick-action-report-full",1),e&2){let t=m(2);h("reportParameters",t.reportParams())("tableData",t.report.tableData)("chartData",t.report.chartData)("rentalData",t.report.rentalData)("conditionalText",t.conditionalText.value())("primaryColor",t.primaryHex())("reportHash",t.report.hash)("resType",t.dataType)}}function Nc(e,r){if(e&1&&C(0,Dc,1,8,"admin-quick-action-report-preview",0)(1,Rc,1,8,"admin-quick-action-report-full",1),e&2){let t=m();_(t.reportType==="single"?0:1)}}var Vr=(()=>{class e{constructor(){this.quickActionsService=g($),this.apiService=g(et),this.adminDataService=g(Qt),this.mixpanelService=g(dt),this._report=this.quickActionsService.selectedReport,this._dataType=this.quickActionsService.dataType,this._reportType=this.quickActionsService.reportType,this.accountTypes=K(this.adminDataService.getAccountTypes(),{initialValue:{freemium:!0,lite:!1,professional:!1,premium:!1,advanced:!1}}),this.reportHash=f(()=>this.report?.hash),this.reportKey=f(()=>{let t=this.report,i=this._dataType();return t?`${t.hash}|${i}`:null}),this.reportParams=f(()=>this.quickActionsService.reportParams()),this.primaryHex=f(()=>{let t=this.reportParams()?.settings?.primaryColor??"2318FF";return t?.startsWith("#")?t:`#${t}`}),this.conditionalText=X({request:()=>this.reportKey(),loader:({request:t})=>{if(!t)return G(null);let[i,n]=t.split("|");return this.apiService.getConditionalText(i,n)}}),E(()=>{let t=this.reportType;this.report&&t&&this.trackMarketReportViewedTrigger()})}trackMarketReportViewedTrigger(){let t=this.quickActionsService,i={report_type:this.reportType,property_type:t.chartType().toLowerCase(),location_type:t.selectedReport()?.category.toLowerCase()??"",entry_point:"quick_actions",has_branding:t.hasBranding()};this.mixpanelService.onTrackAdmin("QA Market Report Viewed",i)}get report(){return this._report()}get reportType(){return this._reportType()}get dataType(){return this._dataType()}static{this.\u0275fac=function(i){return new(i||e)}}static{this.\u0275cmp=N({type:e,selectors:[["admin-quick-action-market-reports"]],decls:2,vars:1,consts:[[3,"report","tableData","chartData","rentalData","reportParams","conditionalText","primaryColor","isFreemium"],[3,"reportParameters","tableData","chartData","rentalData","conditionalText","primaryColor","reportHash","resType"]],template:function(i,n){i&1&&(a(0,"div"),C(1,Nc,2,1),l()),i&2&&(s(),_(n.report?1:-1))},dependencies:[Qr,Fr],encapsulation:2})}}return e})();var Ou=[{path:"",component:Rr,children:[{path:"market-snapshot",component:Nr,data:{title:"Market Snapshot",description:"Summary of real-time local market conditions."}},{path:"market-action",component:qr,data:{title:"Market Action",description:"Visualize and describe the housing supply and demand balance."}},{path:"chart-creator",component:Lr,data:{title:"Chart Creator",description:Mn}},{path:"market-reports",component:Vr,data:{title:"Market Reports",description:"Generate Altos Market Reports"}}]}];export{Ou as quickActionsRoutes};
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.