PageSourceSearch

https://app.sympl.cm/chunk-YGSTXS2G.js

js sympl.cm collected 2026-10-01 23:48:19 UTC 64,962 bytes, 1 lines download raw bytes

1import{a as Ci}from"./chunk-KI42O7QW.js";import{a as gi}from"./chunk-MFQA3JVP.js";import{a as Ri}from"./chunk-AW3O4TBD.js";import"./chunk-V6G4JYEC.js";import{a as Jn}from"./chunk-N6QQRWPD.js";import"./chunk-AGL64H3R.js";import"./chunk-GVZNU3LL.js";import{a as pi}from"./chunk-WDVW4PLO.js";import{a as Ti,e as Ai,f as ui}from"./chunk-SEUMS3K6.js";import"./chunk-ZOMGWPP2.js";import"./chunk-WKAYZSX3.js";import{a as Ei,b as Si}from"./chunk-QCAN7S3L.js";import"./chunk-UBPW5YWX.js";import"./chunk-YPGEPCCE.js";import{a as mi}from"./chunk-KOEKGIOJ.js";import"./chunk-ZXI4VZGZ.js";import"./chunk-MW32WWIK.js";import"./chunk-COAKN2MX.js";import{a as ci}from"./chunk-JOL524W4.js";import"./chunk-IW2UOT3G.js";import"./chunk-YYMW6PUU.js";import"./chunk-YSE3ND72.js";import"./chunk-J2Z7QPQA.js";import"./chunk-PPHM6GXD.js";import"./chunk-2K7E3S2U.js";import"./chunk-CCMACI33.js";import"./chunk-DO3FGHQD.js";import{k as ii}from"./chunk-JCSESH2J.js";import"./chunk-SYHXPIWY.js";import"./chunk-GLFJMVTU.js";import"./chunk-7E7WVJAW.js";import{a as dt,d as Qe}from"./chunk-UZR6VFPG.js";import"./chunk-PHYKRJFI.js";import"./chunk-JGPCN62Y.js";import"./chunk-BQ5C4YUN.js";import{c as we,d as Ue,f as ze,g as Xe,h as Be,k as Ve,l as Oe}from"./chunk-G2WNBUZW.js";import{a as Vn}from"./chunk-VAVMXMU3.js";import{a as Kn}from"./chunk-OOHCB7D4.js";import"./chunk-ECDTEDEZ.js";import{a as ni}from"./chunk-KPAGQI66.js";import"./chunk-ZDTU7YMQ.js";import{a as Dn}from"./chunk-INJMAYG3.js";import"./chunk-FVG77HMA.js";import{a as Qn,b as Zn}from"./chunk-5P6XQABN.js";import{a as Wn,b as qn,c as jn,f as Yn}from"./chunk-OVGPRL77.js";import"./chunk-APZSKP2S.js";import{a as $n}from"./chunk-53MVBNEN.js";import{f as Yt,h as Qt}from"./chunk-RVTINMFF.js";import{i as di}from"./chunk-VW7JFPAN.js";import{a as ai}from"./chunk-NPUNOIRL.js";import{a as ri,b as _i,c as si}from"./chunk-IUKVZ62K.js";import{c as oi}from"./chunk-FSVMYTLF.js";import{a as ei,d as Ze,e as Ke,f as ti,g as Je}from"./chunk-ZD3CEWXG.js";import{Z as Xn,ba as Bn,t as In,u as Gn}from"./chunk-HXP5L5ZV.js";import"./chunk-R5HHLNRP.js";import"./chunk-EVV2DOEW.js";import"./chunk-4ULU7FGM.js";import"./chunk-JC7MHMTM.js";import{A as wn,B as Un,C as je,F as zn,L as Ye,M as pe,d as st,g as xn,n as Hn,p as Fn,q as kn}from"./chunk-QWF5VYAS.js";import{a as li}from"./chunk-IRENRCFR.js";import{e as te}from"./chunk-BUBGHNDZ.js";import{a as K}from"./chunk-RXDZHKRX.js";import{e as We,f as Mn}from"./chunk-5GS3QR7H.js";import"./chunk-D22K4JI4.js";import"./chunk-OLYVZWCV.js";import{a as On}from"./chunk-IZUO562Y.js";import"./chunk-EPKHUYLQ.js";import"./chunk-X2RCV4LG.js";import"./chunk-QPUYZBAW.js";import"./chunk-5FFKWPA2.js";import{a as ue}from"./chunk-NURIXNLT.js";import"./chunk-TLNRIP4G.js";import"./chunk-ZTHYKD22.js";import"./chunk-5GUWLVV5.js";import"./chunk-QKHSI6KH.js";import"./chunk-WHEHVMAA.js";import{a as _t}from"./chunk-FRP7PEI4.js";import{a as qe}from"./chunk-7GB2H7DU.js";import{Aa as bn,Fa as vn,Ma as Pn,ra as Ln,xa as yn}from"./chunk-MJXFXCGO.js";import{a as hn}from"./chunk-2A2LFZKU.js";import{$b as Cn,Bc as fn,Bd as ke,D as Ie,Db as pn,Eb as gn,I as _n,J as sn,Kc as He,Ob as Ge,Qa as Tn,Sa as An,T as dn,V as En,Vc as Fe,Zb as Rn,aa as Sn,be as Nn,ee as Z,ja as cn,mb as un,q as an,ta as mn,w as rn,yc as xe}from"./chunk-RQ4WSQDN.js";import{c as q,d as j}from"./chunk-5UCOJBJI.js";import{D as ln,G as Ae,c as Zt,d as G,f as me,g as Kt,k as Te,m as Jt,n as en,q as De,t as tn,u as nn,z as on}from"./chunk-H7R3FY4F.js";import{c as ee}from"./chunk-UG7YN4RB.js";import"./chunk-HF2B77MC.js";import{a as Pe,d as ce}from"./chunk-SX2H7FAR.js";import"./chunk-D6ZGPUYW.js";import"./chunk-XMT76HNJ.js";import"./chunk-ZFPQERPS.js";import{b as z}from"./chunk-E7QVDSDT.js";import"./chunk-TSRUDDSM.js";import{Ca as P,Fa as _e,Fb as Vt,Fc as Ot,Gc as $e,Hc as Wt,I as Xt,Jc as D,Kc as R,Lc as B,Mc as I,Ob as ie,P as ve,Qb as m,Sb as T,Ub as de,Vb as V,Wb as O,X as J,Xb as c,Y as Me,Yb as i,Yc as W,Zb as o,Zc as qt,_b as d,cc as b,db as se,dc as v,fa as Bt,g as zt,hb as a,hc as F,id as jt,ka as u,m as ne,oc as _,od as N,pa as C,qa as f,qc as Ee,r as be,rc as Se,sd as H,tc as p,td as M,va as re,vc as E,zb as X}from"./chunk-WSK7M3ME.js";import"./chunk-JECSBBV3.js";import{a as le,b as ae,g as Ut}from"./chunk-XO6N3PVE.js";var vi=Ut(hn());var fi=Ut(hn());var Pi=(l,e)=>e.channelId;function Mi(l,e){if(l&1&&d(0,"img",5),l&2){let t=E();c("src",t.coverImageUrl(),se)("alt",t.rental().name);}}function $i(l,e){if(l&1&&(i(0,"div",6)(1,"span",18),R(2),o()()),l&2){let t=E();a(2),I(" ",t.rental().name.charAt(0).toUpperCase()," ");}}function Di(l,e){if(l&1){let t=F();i(0,"hlm-dropdown-menu")(1,"button",21),p("click",function(r){C(t);let s=E(2);
1return r.stopPropagation(),f(s.editClicked.emit(s.rental()));}),d(2,"ng-icon",22),i(3,"span"),_(4,1),o()(),i(5,"button",21),p("click",function(r){C(t);let s=E(2);return r.stopPropagation(),f(s.deleteClicked.emit(s.rental()));}),d(6,"ng-icon",23),i(7,"span"),_(8,2),o()()();}}function Ii(l,e){if(l&1&&(i(0,"button",19),p("click",function(n){return n.stopPropagation();}),d(1,"ng-icon",20),o(),Vt(2,Di,9,0,"ng-template",null,0,jt)),l&2){let t=Ot(3);c("cdkMenuTriggerFor",t);}}function Gi(l,e){if(l&1&&(i(0,"div",11),d(1,"ng-icon",24),i(2,"span"),R(3),o()()),l&2){let t=E();a(3),B(t.rental().phone);}}function xi(l,e){if(l&1&&(i(0,"div",25),d(1,"img",27),o()),l&2){let t=e.$implicit,n=E(2);c("title",t.friendlyName),a(),c("src",n.getChannelIcon(t.name),se)("alt",t.friendlyName);}}function Hi(l,e){if(l&1&&(i(0,"span",26),R(1),o()),l&2){let t=E(2);a(),I(" +",t.extraChannelCount()," ");}}function Fi(l,e){if(l&1&&(i(0,"div",11),V(1,xi,2,3,"div",25,Pi),m(3,Hi,2,1,"span",26),o()),l&2){let t=E();a(),O(t.visibleChannels()),a(2),T(t.extraCh
1annelCount()>0?3:-1);}}var et=class l{noAddressLabel="No address";rental=M.required();connections=M([]);readonly=M(!1);cardClicked=H();editClicked=H();deleteClicked=H();rentalImagesStore=u(pe);channelsStore=u(In);coverImageUrl=N(()=>{let e=this.rental(),t=Ye(this.rentalImagesStore.coverImageForRental()(e.pkey));return t?t.replace("/upload/","/upload/w_400,h_400,c_fill/"):null;});locationText=N(()=>{let e=this.rental(),t=[];return e.address?.city&&t.push(e.address.city),e.address?.country&&t.push(e.address.country),t.join(", ");});connectedChannels=N(()=>fi.uniqBy(Xn(this.rental().pkey,this.connections(),this.channelsStore.entities()),e=>/airbnb/.test(e.name||"")?"airbnb":e.name));visibleChannels=N(()=>this.connectedChannels().slice(0,3));extraChannelCount=N(()=>Math.max(0,this.connectedChannels().length-this.visibleChannels().length));constructor(){Pn(Gn)();}getChannelIcon(e){return zn(e);}static ɵfac=function(t){return new(t||l)();};static ɵcmp=X({type:l,selectors:[["app-rental-card"]],hostAttrs:[1,"block"],inputs:{rental:[1,"rental"],connections:[1,"connections"],readonly:[1,"readonly"]},outputs:{cardClicked:"cardClicked",editClicked:"editClicked",deleteClicked:"deleteClicked"},features:[W([],[q({lucideBath:Ie,lucideBed:sn,lucideEllipsisVertical:An,lucideMapPin:Rn,lucidePencil:xe,lucidePhone:fn,lucideTrash2:ke})])],decls:26,vars:9,consts:()=>{let e;e="Actions";let t;t="Edit";let n;return n="Delete",[["actionsMenu",""],t,n,[1,"group","cursor-pointer","rounded-[var(--tile-r)]","border","border-(--line)","bg-(--card-bg)","p-3","transition-colors","hover:border-(--ink-300)","h-full",3,"click"],[1,"relative","aspect-square","overflow-hidden","rounded-[var(--tile-r)]","bg-(--canvas)"],[1,"h-full","w-full","object-cover",3,"src","alt"],[1,"flex","h-full","w-full","items-center","justify-center","bg-(--canvas)"],[1,"space-y-1","pt-3"],[1,"flex","items-center","justify-between","gap-2"],[1,"truncate","text-[length:var(--fs-body)]","font-semibold","text-(--ink-900)",3,"title"],[1,"flex","items-center","gap-3","text-xs","text-(--ink-500)"],[1,"flex","items-center","gap-1"],["hlm","","name","lucideMapPin","size","xs",1,"shrink-0"],[1,"truncate"],[1,"flex","items-center","justify-between","text-xs"],[1,"flex","items-center","gap-3","text-(--ink-500)"],["hlm","","name","lucideBed","size","xs"],["hlm","","name","lucideBath","size","xs"],[1,"text-6xl","font-bold","text-(--ink-300)"],["hlmBtn","","variant","surface","size","icon-sm","aria-label",e,1,"-mr-2","shrink-0","border-transparent","bg-transparent","text-(--ink-500)","hover:bg-(--canvas)","hover:text-(--ink-900)",3,"click","cdkMenuTriggerFor"],["hlm","","name","moreVertical","size","base"],["hlmDropdownMenuItem","",3,"click"],["hlm","","name","lucidePencil","hlmMenuIcon",""],["hlm","","name","lucideTrash2","hlmMenuIcon",""],["hlm","","name","lucidePhone","size","xs",1,"shrink-0"],[1,"flex","size-6","items-center","justify-center","overflow-hidden","rounded-full","border","border-(--line)","bg-(--card-bg)","p-1",3,"title"],[1,"flex","size-6","items-center","justify-center","rounded-full","border","border-(--line)","bg-(--canvas)","text-[10px]","font-medium","text-(--ink-500)"],["onerror","this.style.display='none'",1,"size-full","object-contain",3,"src","alt"]];},template:function(t,n){t&1&&(i(0,"div",3),p("click",function(){return n.cardClicked.emit(n.rental());}),i(1,"div",4),m(2,Mi,1,2,"img",5)(3,$i,3,1,"div",6),o(),i(4,"div",7)(5,"div",8)(6,"h3",9),R(7),o(),m(8,Ii,4,1),o(),i(9,"div",10)(10,"div",11),d(11,"ng-icon",12),i(12,"span",13),R(13),o()(),m(14,Gi,4,1,"div",11),o(),i(15,"div",14)(16,"div",15)(17,"div",11),d(18,"ng-icon",16),i(19,"span"),R(20),o()(),i(21,"div",11),d(22,"ng-icon",17),i(23,"span"),R(24),o()()(),m(25,Fi,4,1,"div",11),o()()()),t&2&&(a(2),T(n.coverImageUrl()?2:3),a(4),c("title",n.rental().name),a(),I(" ",n.rental().name," "),a(),T(n.readonly()?-1:8),a(5),B(n.locationText()||n.noAddressLabel),a(),T(n.rental().phone?14:-1),a(6),B(n.rental().bedrooms||0),a(4),B(n.rental().bathrooms||0),a(),T(n.visibleChannels().length?25:-1));},dependencies:[Ti,j,ee,Ai,ui,Z],encapsulation:2,changeDetection:0});};var ki=()=>[],wi=(l,e)=>e.pkey;function Ui(l,e){l&1&&(i(0,"div",1),_(1,0),o());}function zi(l,e){if(l&1){let t=F();i(0,"app-rental-card",4),p("cardClicked",function(r){C(t);let s=E(2);
1return f(s.cardClicked.emit(r));})("editClicked",function(r){C(t);let s=E(2);return f(s.editClicked.emit(r));})("deleteClicked",function(r){C(t);let s=E(2);return f(s.deleteClicked.emit(r));}),o();}if(l&2){let t=e.$implicit,n=E(2);c("rental",t)("connections",n.channelConnections()[t.pkey]??qt(3,ki))("readonly",n.readonly());}}function Xi(l,e){if(l&1&&(i(0,"div",2),V(1,zi,1,4,"app-rental-card",3,wi),o()),l&2){let t=E();a(),O(t.rentals());}}var nt=class l{rentals=M.required();channelConnections=M({});readonly=M(!1);cardClicked=H();editClicked=H();deleteClicked=H();static ɵfac=function(t){return new(t||l)();};static ɵcmp=X({type:l,selectors:[["app-rentals-grid"]],hostAttrs:[1,"block"],inputs:{rentals:[1,"rentals"],channelConnections:[1,"channelConnections"],readonly:[1,"readonly"]},outputs:{cardClicked:"cardClicked",editClicked:"editClicked",deleteClicked:"deleteClicked"},decls:2,vars:1,consts:()=>{let e;return e="No rentals found",[e,[1,"flex","h-64","items-center","justify-center","text-(--ink-500)"],[1,"grid","grid-cols-1","gap-5","sm:grid-cols-2","lg:grid-cols-3","xl:grid-cols-4","2xl:grid-cols-5"],[3,"rental","connections","readonly"],[3,"cardClicked","editClicked","deleteClicked","rental","connections","readonly"]];},template:function(t,n){t&1&&m(0,Ui,2,0,"div",1)(1,Xi,3,0,"div",2),t&2&&T(n.rentals().length===0?0:1);},dependencies:[et],encapsulation:2,changeDetection:0});};var Bi=(l,e)=>e.pkey;function Vi(l,e){if(l&1){let t=F();i(0,"button",14),p("click",function(){C(t);let r=E(2);return f(r.addClicked.emit());}),_(1,1),o();}}function Oi(l,e){if(l&1&&(i(0,"div",8)(1,"app-empty-state",10)(2,"div",11)(3,"a",12),b(4),_(5,0),v(),o(),m(6,Vi,2,0,"button",13),o()()()),l&2){let t=E();a(),c("imageAlt",t.emptyRentalsImageAlt)("title",t.emptyRentalsTitle)("details",t.emptyRentalsDetails),a(2),c("href",t.learnMoreUrl,se),a(3),T(t.readonly()?-1:6);}}function Wi(l,e){if(l&1&&d(0,"img",32),l&2){let t=E().$implicit;c("src",e,se)("alt",t.name);}}function qi(l,e){if(l&1){let t=F();i(0,"div",45)(1,"button",46),p("click",function(r){C(t);let s=E().$implicit,A=E(2);return r.stopPropagation(),f(A.editClicked.emit(s));}),d(2,"ng-icon",47),o(),i(3,"button",48),p("click",function(r){C(t);let s=E().$implicit,A=E(2);return r.stopPropagation(),f(A.deleteClicked.emit(s));}),d(4,"ng-icon",49),o()();}if(l&2){let t=E().$implicit,n=E(2);a(),ie("aria-label",n.editAriaLabel(t.name)),a(2),ie("aria-label",n.deleteAriaLabel(t.name));}}function ji(l,e){if(l&1){let t=F();i(0,"tr",28),p("click",function(r){let s=C(t).$implicit,A=E(2);return f(A.onRowClick(r,s));}),i(1,"td",29)(2,"div",30)(3,"hlm-avatar",31),m(4,Wi,1,2,"img",32),i(5,"span",33),R(6),o()(),i(7,"span",34),R(8),o()()(),i(9,"td",35)(10,"div",36)(11,"div",37),d(12,"ng-icon",38),i(13,"span",39),R(14),o()(),i(15,"div",37),d(16,"ng-icon",40),i(17,"span",39),R(18),o()()()(),i(19,"td",41),R(20),o(),i(21,"td",41),R(22),o(),i(23,"td",41),R(24),o(),i(25,"td",42),p("click",function(r){return r.stopPropagation();}),d(26,"app-ignore-ai-toggle",43),o(),i(27,"td",44),m(28,qi,5,2,"div",45),o()();}if(l&2){let t,n=e.$implicit,r=E(2);a(4),T((t=r.getCoverImage(n))?4:-1,t),a(2),B(r.getInitials(n.name)),a(2),B(n.name),a(6),B(n.bedrooms??0),a(4),B(n.bathrooms??0),a(2),I(" ",n.phone," "),a(2),I(" ",n.address==null?null:n.address.city," "),a(2),I(" ",n.address==null?null:n.address.country," "),a(2),c("itemId",n.pkey)("readonly",r.readonly()),a(2),T(r.readonly()?-1:28);}}function Yi(l,e){if(l&1){let t=F();i(0,"div",9)(1,"table",15)(2,"thead")(3,"tr",16)(4,"th",17)(5,"button",18),p("click",function(){C(t);let r=E();return f(r.sortChange.emit("name"));}),i(6,"span"),_(7,2),o(),d(8,"ng-icon",19),o()(),i(9,"th",20)(10,"button",18),p("click",function(){C(t);let r=E();return f(r.sortChange.emit("description"));}),i(11,"span"),_(12,3),o(),d(13,"ng-icon",19),o()(),i(14,"th",21),_(15,4),o(),i(16,"th",22)(17,"button",18),p("click",function(){C(t);let r=E();return f(r.sortChange.emit("city"));}),i(18,"span"),_(19,5),o(),d(20,"ng-icon",19),o()(),i(21,"th",23)(22,"button",18),p("click",function(){C(t);let r=E();return f(r.sortChange.emit("country"));}),i(23,"span"),_(24,6),o(),d(25,"ng-icon",19),o()(),i(26,"th",24),_(27,7),o(),i(28,"th",25),d(29,"ng-icon",26),o()()(),i(30,"tbody"),V(31,ji,29,11,"tr",27,Bi),o()()();}if(l&2){let t=E();a(8),c("name",t.sortIcon("name")),a(5),c("name",t.sortIcon("description")),a(7),c("name",t.sortIcon("city")),a(5),c("name",t.sortIcon("country")),a(6),O(t.rentals());}}var it=class l{rentals=M.required();sortState=M(null);readonly=M(!1);rowClicked=H();editClicked=H();deleteClicked=H();addClicked=H();channelsToggled=H();sortChange=H();learnMoreUrl=Si(Ei.rentals);emptyRentalsImageAlt="No rentals yet";emptyRentalsTitle="Expand Your Portfolio with Easy Rental Management!";emptyRentalsDetails=[{label:"Get Started:",description:"Jumpstart your Tokeet account by adding your first rental. Click the 'ADD' button above to begin."},{label:"Rental Details:",description:"Once added, easily specify your rental rates, currency, and other essential details to optimize your listings."},{label:"Channel Import:",description:"Enhance efficiency by importing rentals directly from your channels. Visit the Channels section to streamline the process."}];editAriaLabel(e){return"Edit "+e+"";}deleteAriaLabel(e){return"Delete "+e+"";}sortIcon(e){let t=this.sortState();return!t||t.id!==e?"lucideChevronDown":t.direction==="asc"?"lucideArrowUp":"lucideArrowDown";}rentalImagesStore=u(pe);onRowClick(e,t){let n=e.target;n.closest("button")||n.closest("hlm-switch")||this.rowClicked.emit
1(t);}onChannelsToggle(e,t){this.channelsToggled.emit({rental:e,enabled:t});}getCoverImage(e){return Ye(this.rentalImagesStore.coverImageForRental()(e.pkey));}getInitials(e){return e.split(" ").map(t=>t[0]).join("").toUpperCase().slice(0,2);}static ɵfac=function(t){return new(t||l)();};static ɵcmp=X({type:l,selectors:[["app-rentals-table"]],hostAttrs:[1,"block"],inputs:{rentals:[1,"rentals"],sortState:[1,"sortState"],readonly:[1,"readonly"]},outputs:{rowClicked:"rowClicked",editClicked:"editClicked",deleteClicked:"deleteClicked",addClicked:"addClicked",channelsToggled:"channelsToggled",sortChange:"sortChange"},features:[W([],[q({lucideBedDouble:_n,lucideBath:Ie,lucidePencil:xe,lucideMenu:Cn,lucideArrowDown:an,lucideArrowUp:rn,lucideChevronDown:cn,lucideTrash2:ke})])],decls:2,vars:1,consts:()=>{let e;e="Learn More";let t;t="Add Rental";let n;n="Rental";let r;r="Description";let s;s=" Phone ";let A;A="City";let $;$="Country";let g;return g=" Exclude AI ",[e,t,n,r,s,A,$,g,[1,"flex","flex-col","items-center","gap-5","px-7","pb-12","pt-7"],[1,"overflow-x-auto","rounded-[var(--card-r)]","border","border-(--card-bd)","bg-(--card-bg)","shadow-(--card-sh)"],["imageSrc","assets/images/empty_images/image_rentals.svg",3,"imageAlt","title","details"],["emptyStateActions","",1,"flex","justify-center","gap-5"],["hlmBtn","","variant","surface","size","lg","target","_blank","rel","noopener noreferrer",3,"href"],["hlmBtn","","size","lg"],["hlmBtn","","size","lg",3,"click"],[1,"w-full","min-w-[1180px]","table-fixed","border-collapse"],[1,"h-12","border-b","border-(--line)"],[1,"w-[220px]","px-4","text-left","align-middle"],["type","button",1,"flex","items-center","gap-1","whitespace-nowrap","text-[length:var(--fs-meta)]","font-semibold","text-(--ink-500)","hover:text-(--ink-900)",3,"click"],["hlm","","size","xs",1,"text-(--ink-400)",3,"name"],[1,"w-[130px]","px-4","text-left","align-middle"],[1,"w-[150px]","px-4","text-left","align-middle","text-[length:var(--fs-meta)]","font-semibold","text-(--ink-500)","whitespace-nowrap"],[1,"w-[150px]","px-4","text-left","align-middle"],[1,"w-[160px]","px-4","text-left","align-middle"],[1,"w-[120px]","px-4","text-left","align-middle","text-[length:var(--fs-meta)]","font-semibold","text-(--ink-500)","whitespace-nowrap"],[1,"sticky","right-0","z-30","w-[96px]","bg-(--card-bg)","px-3","text-center","align-middle"],["hlm","","name","lucideMenu","size","sm",1,"mr-1","text-(--ink-400)"],[1,"group","h-16","cursor-pointer","border-b","border-(--line-2)","transition","last:border-b-0","hover:bg-(--canvas)"],[1,"group","h-16","cursor-pointer","border-b","border-(--line-2)","transition","last:border-b-0","hover:bg-(--canvas)",3,"click"],[1,"overflow-hidden","px-4","align-middle"],[1,"flex","min-w-0","items-center","gap-1.5"],[1,"size-[26px]","shrink-0","bg-[#ecf6fe]"],["hlmAvatarImage","",3,"src","alt"],["hlmAvatarFallback","",1,"text-[10.5px]","font-semibold","text-[#0b6199]"],[1,"truncate","text-[13px]","font-semibold","leading-[1.45]","text-(--ink-900)"],[1,"px-4","align-middle"],[1,"flex","items-center","gap-4","text-(--ink-500)"],[1,"flex","items-center","gap-1.5"],["hlm","","name","lucideBedDouble","size","16px"],[1,"text-[13px]","leading-[1.45]"],["hlm","","name","lucideBath","size","16px"],[1,"overflow-hidden","px-4","align-middle","text-[13px]","leading-[1.45]","text-(--ink-500)"],[1,"px-4","align-middle",3,"click"],["type","rental",3,"itemId","readonly"],[1,"sticky","right-0","z-10","w-[96px]","bg-(--card-bg)","px-3","text-center","align-middle","shadow-[-1px_0_0_0_var(--line-2)]","group-hover:bg-(--canvas)"],[1,"flex","items-center","justify-center","gap-1"],["type","button",1,"inline-flex","h-8","w-8","shrink-0","items-center","justify-center","rounded-lg","text-(--ink-400)","transition-colors","hover:bg-(--canvas)","hover:text-(--ink-900)",3,"click"],["hlm","","name","lucidePencil","size","16px"],["type","button",1,"inline-flex","h-8","w-8","shrink-0","items-center","justify-center","rounded-lg","text-(--err-fg)","transition-colors","hover:bg-(--err-bg)",3,"click"],["hlm","","name","lucideTrash2","size","16px"]];},template:function(t,n){t&1&&m(0,Oi,7,5,"div",8)(1,Yi,33,4,"div",9),t&2&&T(n.rentals().length===0?0:1);},dependencies:[j,ri,_i,si,ee,Z,Ci,ii],encapsulation:2,changeDetection:0});};function Ki(l,e){if(l&1&&(i(0,"hlm-option",8),R(1),o()),l&2){let t=e.$implicit;c("value",t),a(),B(t);}}function Ji(l,e){l&1&&(i(0,"div",9),_(1,0),o());}var ot=class l{ctrl=M.required();entityIdsCtrl=M.required();type=M.required();placeholder=M("Tags");inline=M(!0);tags=M([]);openedChange=H();destroyRef=u(re);entityTagsStore=u(Qe);searchQuery=P("");selectedTags=P([]);storeTags=N(()=>this.entityTagsStore.allEntityTypeTags(this.type()));availableTags=N(()=>[...dt([...(this.tags()??[]),...this.storeTags()])].sort((t,n)=>t.localeCompare(n,void 0,{sensitivity:"base"})));visibleTags=N(()=>{let e=this.searchQuery().trim().toLowerCase(),t=this.availableTags();return e?t.filter(n=>n.toLowerCase().includes(e)):t;});ngOnInit(){!this.entityTagsStore.isLoaded()&&!this.entityTagsStore.isLoading()&&this.entityTagsStore.loadAllTags({onSuccess:()=>this.updateEntityIds()}),queueMicrotask(()=>{this.ctrl().valueChanges.pipe(J(this.ctrl().value),Pe(this.destroyRef)).subscribe(e=>{this.selectedTags.set((e??[]).filter(t=>typeof t=="string")),this.updateEntityIds();});});}onSearch(e){let t=e.target;this.searchQuery.set(t.value);}onOpenChange(e){e||this.searchQuery.set(""),this.openedChange.emit(e);}updateEntityIds(){let e=this.selectedTags().map(A=>A.trim()).filter(A=>!!A);
1if(e.length===0){this.entityIdsCtrl().setValue([]);return;}let t=new Map(this.storeTags().map(A=>[A.toLowerCase(),A])),n=dt(e.map(A=>t.get(A.toLowerCase())??A)),r=this.entityTagsStore.entitiesWithTags(this.type(),n),s=[...new Set(r.map(A=>A.entity_pkey))].filter(A=>!!A);this.entityIdsCtrl().setValue(s);}static ɵfac=function(t){return new(t||l)();};static ɵcmp=X({type:l,selectors:[["app-entity-filter-tags"]],hostAttrs:[1,"block"],inputs:{ctrl:[1,"ctrl"],entityIdsCtrl:[1,"entityIdsCtrl"],type:[1,"type"],placeholder:[1,"placeholder"],inline:[1,"inline"],tags:[1,"tags"]},outputs:{openedChange:"openedChange"},features:[W([],[q({lucideSearch:Fe})])],decls:12,vars:8,consts:()=>{let e;e="Search...";let t;return t="No tags found",[t,["multiple","",1,"flex-1","min-w-0",3,"openChange","formControl","placeholder"],["variant","borderless",1,"w-full","border-none"],[1,"max-h-96","border","border-(--card-bd)","data-[side=bottom]:mt-(--offset)"],[1,"sticky","top-0","z-10","mb-1","border-b","border-(--line)","bg-popover","p-2"],[1,"flex","h-10","items-center","rounded-[var(--control-radius)]","border","border-(--card-bd)","bg-(--card-bg)","px-4"],["name","lucideSearch","size","sm",1,"mr-2","text-(--ink-400)"],["placeholder",e,1,"min-w-0","flex-1","border-none","bg-transparent","text-[length:var(--fs-body)]","text-(--ink-700)","outline-none","placeholder:text-(--ink-400)",3,"input","click","value"],[3,"value"],[1,"p-3","text-center","text-[length:var(--fs-body)]","text-(--ink-400)"]];},template:function(t,n){t&1&&(i(0,"div")(1,"brn-select",1),p("openChange",function(s){return n.onOpenChange(s);}),i(2,"hlm-select-trigger",2),d(3,"hlm-select-value"),o(),i(4,"hlm-select-content",3)(5,"div",4)(6,"div",5),d(7,"ng-icon",6),i(8,"input",7),p("input",function(s){return n.onSearch(s);})("click",function(s){return s.stopPropagation();}),o()()(),V(9,Ki,2,2,"hlm-option",8,de),m(11,Ji,2,0,"div",9),o()()()),t&2&&(D(n.inl
1ine()?"flex h-10 w-[240px] items-center gap-2.5 rounded-[var(--control-radius)] border border-(--card-bd) bg-(--card-bg) px-2.5 shadow-(--card-sh)":"flex h-10 w-full items-center gap-2.5 rounded-[var(--control-radius)] border border-(--card-bd) bg-(--card-bg) px-2.5 shadow-(--card-sh)"),a(),c("formControl",n.ctrl())("placeholder",n.placeholder()),a(3),$e("--offset",10,"px"),a(4),c("value",n.searchQuery()),a(),O(n.visibleTags()),a(2),T(n.visibleTags().length===0?11:-1));},dependencies:[Ae,me,De,j,Ue,we,ze,Xe,Ve,Be,Oe],encapsulation:2,changeDetection:0});};function hi(){return Ln();}function Li(l){return e=>!e.value||e.value.trim().length<2?ne(null):l.pipe(ve(),be(t=>{let n=e.value.trim().toLowerCase();return t.some(s=>s.name.toLowerCase()===n)?{nameTaken:!0}:null;}));}function yi(l,e){return t=>!t.value||t.value.trim().length<3?ne(null):l.pipe(ve(),be(n=>{let r=`${t.value.trim().toLowerCase()}@${e}`;return n.some(A=>A.email?.toLowerCase()===r)?{emailTaken:!0}:null;}));}function to(l,e){l&1&&(i(0,"hlm-error"),_(1,29),o());}function no(l,e){l&1&&(i(0,"hlm-error"),_(1,30),o());}function io(l,e){l&1&&(i(0,"hlm-error"),_(1,31),o());}function oo(l,e){l&1&&(i(0,"hlm-error"),_(1,32),o());}function lo(l,e){l&1&&(i(0,"hlm-error"),_(1,33),o());}function ao(l,e){l&1&&(i(0,"hlm-error"),_(1,34),o());}function ro(l,e){l&1&&(i(0,"hlm-error"),_(1,35),o());}function _o(l,e){l&1&&(i(0,"hlm-error"),_(1,36),o());}function so(l,e){if(l&1){let t=F();i(0,"button",87),p("click",function(){let r=C(t).$implicit,s=E();return f(s.selectColor(r));}),o();}if(l&2){let t=e.$implicit,n=E();$e("background-color",t),Wt("border-foreground",n.selectedColor()===t)("border-transparent",n.selectedColor()!==t)("ring-2",n.selectedColor()===t)("ring-offset-2",n.selectedColor()===t),ie("aria-label",n.selectColorLabel(t));}}function Eo(l,e){l&1&&(i(0,"hlm-error"),_(1,37),o());}function So(l,e){l&1&&(i(0,"hlm-error"),_(1,38),o());}function co(l,e){l&1&&(i(0,"hlm-error"),_(1,39),o());}function mo(l,e){l&1&&(i(0,"hlm-error"),_(1,40),o());}function To(l,e){l&1&&(i(0,"hlm-error"),_(1,41),o());}function Ao(l,e){l&1&&d(0,"ng-icon",86);}var lt=class l{dialogRef=u(We);rentalsStore=u(je);accountStore=u(oi);dialogService=u(te);fb=u(ln);destroyRef=u(re);amplitude=u(ue);rentals$=new zt([]);allRentals=N(()=>this.rentalsStore.allRentals());subdomain=P("");saving=P(!1);selectedColor=P(st[0]);colors=st;currencies=bn;form=this.fb.group({name:["",[G.required,G.minLength(2),G.maxLength(140),hi()]],phone:["",[G.required]],email:["",[G.required,G.minLength(3),G.pattern("^[\\w\\d\\.]+$")]],currency:["USD",[G.required]],address:[""],city:["",[G.required,G.minLength(2),G.maxLength(50)]],state:["",[G.minLength(2),G.maxLength(50)]],country:[""],countryCode:[""],zip:["",[G.minLength(2),G.maxLength(50)]],gps:[{lat:0,long:0}],nightly:[null],weekend:[null],weekly:[null],monthly:[null],minimum:[1,[G.required,G.min(1)]],maximum:[null],additionalFeeAmount:[null],additionalFeeThreshold:[null],ignoreBDC:[!1]});selectedCurrencyCode=P("USD");defaultCurrencyEffect=_e(()=>{let e=this.accountStore.defaultCurrency();this.form.get("currency")?.dirty||(this.form.patchValue({currency:e},{emitEvent:!1}),this.selectedCurrencyCode.set(e));});accountErrorEffect=_e(()=>{let e=this.accountStore.error();e&&console.error("Failed to load default currency:",e);});rentalsEffect=_e(()=>{this.rentals$.next(this.allRentals());});currencySymbol=N(()=>{let e=this.selectedCurrencyCode();return this.currencies.find(n=>n.code===e)?.symbol||"$";});ngOnInit(){this.loadSubdomain(),this.setupNameAsyncValidator(),this.loadDefaultCurrency(),this.setupNameToEmailSync(),this.setupCurrencySync();}setupCurrencySync(){this.form.get("currency")?.valueChanges.pipe(Pe(this.destroyRef)).subscribe(e=>{e&&this.selectedCurrencyCode.set(e);});}loadSubdomain(){this.rentalsStore.loadSubdomain({onSuccess:()=>{this.subdomain.set(this.rentalsStore.subdomain()),this.setupEmailAsyncValidator();}});}loadDefaultCurrency(){this.accountStore.loadAccountDetail();}setupNameAsyncValidator(){let e=this.form.get("name");e&&(e.addAsyncValidators(Li(this.rentals$.asObservable())),e.updateValueAndValidity());}setupEmailAsyncValidator(){let e=this.form.get("email"),t=this.subdomain();e&&t&&(e.addAsyncValidators(yi(this.rentals$.asObservable(),t)),e.updateValueAndValidity());}setupNameToEmailSync(){this.form.get("name")?.valueChanges.pipe(Pe(this.destroyRef)).subscribe(e=>{if(e){let t=e.trim().toLowerCase().replace(/[^a-zA-Z0-9 ]/g,"").split(/\s+/).join(".");this.form.patchValue({email:t},{emitEvent:!1});}});}onAddressSelected(e){let t=yn(e.countryShort);this.form.patchValue({address:e.formattedAddress||"",city:e.city||"",state:e.state||"",country:t,countryCode:e.countryShort||"",zip:e.postCode||"",gps:{lat:e.gps?.lat||0,long:e.gps?.long||0}});}onCountrySelected(e){this.form.patchValue({country:Array.isArray(e)?"":e?.name||""},{emitEvent:!1});}selectColor(e){this.selectedColor.set(e);}selectColorLabel(e){return"Select color "+e+"";}close(){this.dialogRef.close();}
1save(){if(this.form.markAllAsTouched(),this.form.invalid)return;let e=this.form.getRawValue();if(!e.nightly&&!e.weekly){z.error("You must specify either a nightly or weekly rate.");return;}if(e.minimum&&e.maximum&&e.minimum>e.maximum){z.error("Maximum Stay should not be less than Minimum Stay.");return;}this.checkBillingConfirmation().subscribe(t=>{t&&this.performSave();});}checkBillingConfirmation(){return this.rentals$.pipe(ve(),Me(e=>e.length===0?ne(!0):this.dialogService.open(K,{context:{title:"Billing Confirmation",message:"Adding a new rental may increase your monthly charges. You currently have "+e.length+" rental(s). Do you want to continue?",confirmLabel:"Yes, Add Rental",cancelLabel:"Cancel"}}).closed$.pipe(be(n=>!!n))));}performSave(){this.saving.set(!0),this.amplitude.logEvent("add-rental-manually");let e=this.form.getRawValue(),t=`${e.email}@${this.subdomain()}`,n=e.gps?.lat?{lat:e.gps.lat,long:e.gps.long}:void 0,r={name:e.name||"",phone:e.phone||"",email:t,currency:e.currency||"USD",color:this.selectedColor(),address:{address:e.address||"",city:e.city||"",state:e.state||"",country:e.country||"",country_code:e.countryCode||"",zip:e.zip||""},gps:n||{lat:0,long:0},baserate:{nightly:e.nightly??void 0,weekend:e.weekend??void 0,weekly:e.weekly??void 0,monthly:e.monthly??void 0,minimum:e.minimum??1,maximum:e.maximum??void 0,additionalFeeAmount:e.additionalFeeAmount??void 0,additionalFeeThreshold:e.additionalFeeThreshold??void 0},attributes:{ignore_bdc_obp:e.ignoreBDC}};this.rentalsStore.addRental({payload:r,onSuccess:s=>{this.saving.set(!1),z.success("Rental created successfully"),this.dialogRef.close(s);},onError:s=>{this.saving.set(!1),console.error("Failed to create rental:",s);}});}static ɵfac=function(t){return new(t||l)();};static ɵcmp=X({type:l,selectors:[["app-add-rental-sheet"]],hostAttrs:[1,"flex","flex-col","h-full"],features:[W([],[q({lucideCircleHelp:mn,lucideLoader2:Ge,lucidePlus:He,lucideSearch:Fe,lucideX:Nn})])],decls:157,vars:23,consts:()=>{let e;e="Help";let t;t="Name";let n;n="Phone";let r;r="Sympl Email";let s;s="Select currency";let A;A="Address";let $;$="City";let g;g="State";let h;h="Select country";let k;k="Postal Code";let w;w="Add Rental";let x;x="Rental Information";let U;U="Name";let L;L="Phone";let Y;Y="Sympl Email";let Q;Q="Currency";let Re;Re="Rental Base Rate Details";let Ce;Ce="Nightly";let fe;fe="Weekend Night";let Ne;Ne="Weekly";let he;he="Monthly";let Le;Le="Minimum Stay (nights)";let ye;ye="Maximum Stay (nights)";let y;y="Calendar Colors";let St;St="Rental Location";let ct;ct="Address";let mt;mt="City";let Tt;Tt="State";let At;At="Country";let ut;ut="Postal Code";let pt;pt="Additional Guest Fee";let gt;gt="per person, per night";let Rt;Rt="Guest Count";let Ct;Ct="above this many guests";let ft;ft="Ignore for booking.com";let Nt;Nt=" Ignoring the additional guest fee for Booking.com is only required if the additional guest fee is already being added to your Extranet calendar. To contact Booking.com to have these values set in your Extranet calendar, please click ";let ht;ht="here";let Lt;Lt="Cancel";let yt;yt="Save";let bt;bt="Name is required";let vt;vt="Name cannot contain only numbers";let Pt;Pt="A rental with this name already exists";let Mt;Mt="Phone is required";let $t;$t="Email is required";let Dt;Dt=" Email is not properly formatted. Only use characters a-z, A-Z, 0-9, . or _ ";let It;It="This email address is already in use";let Gt;Gt="Minimum stay is required";let xt;xt="City is required";let Ht;Ht="State must be at least 2 characters";let Ft;Ft="State cannot exceed 50 characters";let kt;kt="Postal code must be at least 2 characters";let wt;return wt="Postal code cannot exceed 50 characters",[w,x,U,L,Y,Q,Re,Ce,fe,Ne,he,Le,ye,y,St,ct,mt,Tt,At,ut,pt,gt,Rt,Ct,ft,Nt,ht,Lt,yt,bt,vt,Pt,Mt,$t,Dt,It,Gt,xt,Ht,Ft,kt,wt,["hlmSheetHeader","",1,"pb-4"],["hlmSheetTitle","",1,"flex","items-center","gap-3"],["href","https://sympl.cm/help/rental-settings/how-do-i-add-and-update-rentals","target","_blank","rel","noopener noreferrer","aria-label",e,1,"ml-auto"],["hlm","","name","lucideCircleHelp","size","sm",1,"text-(--ink-500)","hover:text-(--ink-900)","transition-colors"],["hlmSheetBody","",1,"space-y-5"],[1,"space-y-6",3,"formGroup"],[1,"grid","grid-cols-2","gap-6"],[1,"space-y-6"],[1,"space-y-5"],[1,"text-xs","font-semibold","uppercase","tracking-wide","text-(--ink-500)"],["hlmLabel",""],["hlmInput","","variant","borderless","type","text","formControlName","name","placeholder",t,1,"w-full"],["hlmInput","","variant","borderless","type","tel","formControlName","phone","placeholder",n,1,"w-full"],["hlmInput","","variant","borderless","type","text","formControlName","email","placeholder",r,1,"w-full"],["hlmFieldSuffix","",1,"text-sm","text-(--ink-500)","whitespace-nowrap"],[1,"mt-1"],["customInput","","formControlName","currency","placeholder",s],[1,"grid","grid-cols-2","gap-5"],["hlmInput","","variant","borderless","type","number","formControlName","nightly","min","0",1,"w-full"],["hlmInput","","variant","borderless","type","number","formControlName","weekend","min","0",1,"w-full"],["hlmInput","","variant","borderless","type","number","formControlName","weekly","min","0",1,"w-full"],["hlmInput","","variant","borderless","type","number","formControlName","monthly","min","0",1,"w-full"],["hlmInput","","variant","borderless","type","number","formControlName","minimum","min","1",1,"w-full"],["hlmInput","","variant","borderless","type","number","formControlName","maximum","min","0",1,"w-full"],[1,"flex","flex-wrap","gap-2"],["type","button",1,"size-7","rounded-full","border-2","transition-all",3,"background-color","border-foreground","border-transparent","ring-2","ring-offset-2"],["hlm","","hlmFieldPrefix","","name","lucideSearch","size","sm",1,"self-start"],["customInput","","formControlName","address","placeholder",A,3,"onPlaceSelect"],["hlmInput","","variant","borderless","type","text","formControlName","city","placeholder",$,1,"w-full"],["hlmInput","","variant","borderless","type","text","formControlName","state","placeholder",g,1,"w-full"],[1,"grid","grid-cols-2","gap-3"],["customInput","","formControlName","countryCode","placeholder",h,3,"selectionChange"],["hlmInput","","variant","borderless","type","text","formControlName","zip","placeholder",k,1,"w-full"],["hlmInput","","variant","borderless","type","number","formControlName","additionalFeeAmount","min","0",1,"w-full"],[1,"text-xs","text-(--ink-500)","mt-1"],["hlmInput","","variant","borderless","type","number","formControlName","additionalFeeThreshold","min","0",1,"w-full"],[1,"flex","items-center","gap-2","cursor-pointer"],["formControlName","ignoreBDC"],[1,"text-sm"],[1,"text-xs","text-(--ink-500)"],["href","https://partner.booking.com/en-us
1/help/where-you-can-reach-us","target","_blank",1,"text-primary","hover:underline"],[1,"flex","justify-end","gap-2","pt-4"],["hlmBtn","","variant","surface","type","button",3,"click","disabled"],["hlmBtn","","type","submit",3,"click","disabled"],["hlm","","name","lucideLoader2","size","sm",1,"mr-2","animate-spin"],["type","button",1,"size-7","rounded-full","border-2","transition-all",3,"click"]];},template:function(t,n){if(t&1&&(i(0,"div",42)(1,"h3",43)(2,"span"),_(3,0),o(),i(4,"a",44),d(5,"ng-icon",45),o()()(),i(6,"div",46)(7,"form",47)(8,"div",48)(9,"div",49)(10,"section",50)(11,"h4",51),_(12,1),o(),i(13,"div",49)(14,"div")(15,"hlm-outlined-field")(16,"label",52),_(17,2),o(),d(18,"input",53),m(19,to,2,0,"hlm-error"),m(20,no,2,0,"hlm-error"),m(21,io,2,0,"hlm-error"),o()(),i(22,"div")(23,"hlm-outlined-field")(24,"label",52),_(25,3),o(),d(26,"input",54),m(27,oo,2,0,"hlm-error"),o()(),i(28,"div")(29,"hlm-outlined-field")(30,"label",52),_(31,4),o(),d(32,"input",55),i(33,"span",56),R(34),o(),m(35,lo,2,0,"hlm-error"),m(36,ao,2,0,"hlm-error"),m(37,ro,2,0,"hlm-error"),o()(),i(38,"div")(39,"hlm-outlined-field",57)(40,"label",52),_(41,5),o(),d(42,"app-currency-select",58),o()()()(),i(43,"section",49)(44,"h4",51),b(45),_(46,6),v(),o(),i(47,"div",59)(48,"hlm-outlined-field")(49,"label",52),b(50),_(51,7),v(),R(52),o(),d(53,"input",60),o(),i(54,"hlm-outlined-field")(55,"label",52),b(56),_(57,8),v(),R(58),o(),d(59,"input",61),o(),i(60,"hlm-outlined-field")(61,"label",52),b(62),_(63,9),v(),R(64),o(),d(65,"input",62),o(),i(66,"hlm-outlined-field")(67,"label",52),b(68),_(69,10),v(),R(70),o(),d(71,"input",63),o(),i(72,"div")(73,"hlm-outlined-field")(74,"label",52),_(75,11),o(),d(76,"input",64),m(77,_o,2,0,"hlm-error"),o()(),i(78,"hlm-outlined-field")(79,"label",52),_(80,12),o(),d(81,"input",65),o()()(),i(82,"section",49)(83,"h4",51),_(84,13),o(),i(85,"div",66),V(86,so,1,11,"button",67,de),o()()(),i(88,"div",49)(89,"section",50)(90,"h4",51),_(91,14),o(),i(92,"div",49)(93,"hlm-outlined-field"),d(94,"ng-icon",68),i(95,"label",52),_(96,15),o(),i(97,"app-google-places-input",69),p("onPlaceSelect",function(s){return n.onAddressSelected(s);}),o()(),i(98,"div")(99,"hlm-outlined-field")(100,"label",52),_(101,16),o(),d(102,"input",70),m(103,Eo,2,0,"hlm-error"),o()(),i(104,"div")(105,"hlm-outlined-field")(106,"label",52),_(107,17),o(),d(108,"input",71),m(109,So,2,0,"hlm-error"),m(110,co,2,0,"hlm-error"),o()(),i(111,"div",72)(112,"hlm-outlined-field")(113,"label",52),_(114,18),o(),i(115,"app-country-select",73),p("selectionChange",function(s){return n.onCountrySelected(s);}),o()(),i(116,"hlm-outlined-field")(117,"label",52),_(118,19),o(),d(119,"input",74),m(120,mo,2,0,"hlm-error"),m(121,To,2,0,"hlm-error"),o()()()(),i(122,"section",50)(123,"h4",51),_(124,20),o(),i(125,"div",72)(126,"div")(127,"hlm-outlined-field")(128,"label",52),R(129),o(),d(130,"input",75),o(),i(131,"p",76),_(132,21),o()(),i(133,"div")(134,"hlm-outlined-field")(135,"label",52),_(136,22),o(),d(137,"input",77),o(),i(138,"p",76),_(139,23),o()()(),i(140,"label",78),d(141,"hlm-checkbox",79),i(142,"span",80),_(143,24),o()(),i(144,"p",81),b(145),_(146,25),v(),i(147,"a",82),_(148,26),o(),R(149,". "),o()()()(),i(150,"div",83)(151,"button",84),p("click",function(){return n.close();}),_(152,27),o(),i(153,"button",85),p("click",function(){return n.save();}),m(154,Ao,1,0,"ng-icon",86),i(155,"span"),_(156,28),o()()()()()),t&2){let r,s,A,$,g,h,k,w,x,U,L,Y,Q;a(7),c("formGroup",n.form),a(12),T((r=n.form.get("name"))!=null&&r.touched&&(r=n.form.get("name"))!=null&&r.hasError("required")?19:-1),a(),T((s=n.form.get("name"))!=null&&s.touched&&(s=n.form.get("name"))!=null&&s.hasError("allNumbers")?20:-1),a(),T((A=n.form.get("name"))!=null&&A.touched&&(A=n.form.get("name"))!=null&&A.hasError("nameTaken")?21:-1),a(6),T(($=n.form.get("phone"))!=null&&$.touched&&($=n.form.get("phone"))!=null&&$.hasError("required")?27:-1),a(7),I(" ","@"+n.subdomain()," "),a(),T((g=n.form.get("email"))!=null&&g.touched&&(g=n.form.get("email"))!=null&&g.hasError("required")?35:-1),a(),T((h=n.form.get("email"))!=null&&h.touched&&(h=n.form.get("email"))!=null&&h.hasError("pattern")?36:-1),a(),T((k=n.form.get("email"))!=null&&k.touched&&(k=n.form.get("email"))!=null&&k.hasError("emailTaken")?37:-1),a(15),I(" (",n.currencySymbol(),")"),a(6),I(" (",n.currencySymbol(),")"),a(6),I(" (",n.currencySymbol(),")"),a(6),I(" (",n.currencySymbol(),")"),a(7),T((w=n.form.get("minimum"))!=null&&w.touched&&(w=n.form.get("minimum"))!=null&&w.hasError("required")?77:-1),a(9),O(n.colors),a(17),T((x=n.form.get("city"))!=null&&x.touched&&(x=n.form.get("city"))!=null&&x.hasError("required")?103:-1),a(6),T((U=n.form.get("state"))!=null&&U.touched&&(U=n.form.get("state"))!=null&&U.hasError("minlength")?109:-1),a(),T((L=n.form.get("state"))!=null&&L.touched&&(L=n.form.get("state"))!=null&&L.hasError("maxlength")?110:-1),a(10),T((Y=n.form.get("zip"))!=null&&Y.touched&&(Y=n.form.get("zip"))!=null&&Y.hasError("minlength")?120:-1),a(),T((Q=n.form.get("zip"))!=null&&Q.touched&&(Q=n.form.get("zip"))!=null&&Q.hasError("maxlength")?121:-1),a(8),I("(",n.currencySymbol(),")"),a(22),c("disabled",n.saving()),a(2),c("disabled",n.saving()||n.form.invali
1d),a(),T(n.saving()?154:-1);}},dependencies:[Ae,Jt,Zt,en,me,Kt,on,nn,tn,j,Ri,mi,ci,ee,On,Wn,Yn,qn,jn,Z,Qn,ni,Ze,Ke,ti],encapsulation:2,changeDetection:0});};function uo(l,e){l&1&&(b(0),_(1,15),v());}function po(l,e){if(l&1&&(b(0),_(1,16),v()),l&2){let t=E();a(),Ee(t.tokeetData().holdEvents),Se(1);}}function go(l,e){l&1&&(b(0),_(1,17),v());}function Ro(l,e){if(l&1&&(b(0),_(1,18),v()),l&2){let t=E();a(),Ee(t.tokeetData().bookings),Se(1);}}function Co(l,e){l&1&&(b(0),_(1,19),v());}function fo(l,e){if(l&1&&(b(0),_(1,20),v()),l&2){let t=E();a(),Ee(t.tokeetData().websites),Se(1);}}function No(l,e){l&1&&(b(0),_(1,21),v());}function ho(l,e){if(l&1&&(b(0),_(1,22),v()),l&2){let t=E();a(),Ee(t.webreadyData().websites)(t.webreadyData().images),Se(1);}}function Lo(l,e){l&1&&d(0,"ng-icon",41);}function yo(l,e){l&1&&d(0,"ng-icon",36);}var at=class l{dialogRef=u(We);dialogService=u(te);deleteRentalService=u(Un);authState=u($n);amplitude=u(ue);context=Mn();isHoldDeleted=P(!1);isBookingsDeleted=P(!1);isWebsitesDeleted=P(!1);isWebreadyRentalDeleted=P(!1);isDeletingWholeRental=P(!1);tokeetData=P({loading:!0,holdEvents:0,bookings:0,websites:0});webreadyData=P({loading:!0,rental:!1,websites:0,images:0});isHoldDisabled=N(()=>this.tokeetData().loading||!this.tokeetData().holdEvents||this.isHoldDeleted());isBookingsDisabled=N(()=>this.tokeetData().loading||!this.tokeetData().bookings||this.isBookingsDeleted());isWebsitesDisabled=N(()=>this.tokeetData().loading||!this.tokeetData().websites||this.isWebsitesDeleted());isWebreadyDisabled=N(()=>this.webreadyData().loading||!this.webreadyData().rental||this.isWebreadyRentalDeleted());isAllDeleted=N(()=>{let e=this.tokeetData(),t=this.webreadyData();return!(e.loading||t.loading||e.holdEvents>0&&!this.isHoldDeleted()||e.bookings>0&&!this.isBookingsDeleted()||e.websites>0&&!this.isWebsitesDeleted()||t.rental&&!this.isWebreadyRentalDeleted());});serviceCardClass(e){return"flex items-center gap-3 rounded-[var(--tile-r)] border p-4 transition-colors "+(e?"pointer-events-none border-(--line) bg-(--canvas)":"border-(--line) bg-(--card-bg) hover:border-(--ink-400)");}serviceIconClass(e){return e?"text-(--ink-300)":"text-(--ink-900)";}serviceTitleClass(e){return"text-sm font-medium "+(e?"text-(--err-fg)":"text-(--ink-900)");}wholeRentalCardClass(){return"flex w-full max-w-md items-center gap-3 rounded-[var(--tile-r)] border p-4 text-base font-medium transition-colors "+(this.isAllDeleted()?"border-(--line) bg-(--card-bg) hover:border-(--ink-400)":"pointer-events-none border-(--line) bg-(--canvas)");}ngOnInit(){this.amplitude.logEvent("rental-delete-overlay-view");let e=this.context.rental.pkey;this.deleteRentalService.getTokeetRentalCounts(e).subscribe({next:t=>{this.tokeetData.set({loading:!1,holdEvents:t.events,bookings:t.inquiries+t.bookings,websites:t.websites});},error:()=>{}}),this.deleteRentalService.getWebreadyRental(e).pipe(Me(()=>this.deleteRentalService.getWebreadyRentalAssociated(e))).subscribe({next:t=>{this.webreadyData.set({loading:!1,rental:!0,websites:t.websites?.length||0,images:t.images?.length||0});},error:t=>{t?.status===404&&this.webreadyData.update(n=>ae(le({},n),{loading:!1}));}});}onDeleteHold(){this.amplitude.logEvent("rental-delete-holds"),this.dialogService.open(K,{context:{title:"Delete rental hold events?",message:"This will delete all hold events stored on the selected rental. This action cannot be undone and these items cannot be recovered once this action has been initiated. Are you sure that you want to proceed?",confirmLabel:"Yes, Delete",cancelLabel:"Cancel",variant:"destructive"}}).closed$.subscribe(t=>{t&&this.deleteRentalService.deleteHold(this.context.rental.pkey).subscribe({next:()=>{this.tokeetData.update(n=>ae(le({},n),{holdEvents:0})),this.isHoldDeleted.set(!0),z.success("Hold events deleted successfully.");},error:()=>z.error("Failed to delete hold events.")});});}onDeleteBookings(){this.amplitude.logEvent("rental-delete-bookings"),this.dialogService.open(K,{context:{title:"Delete rental bookings?",message:"This will delete all inquiries and confirmed bookings stored on the selected rental. All associated items other than the guest record will also be removed as a result. These items include Messages, Invoices, Inquiry Notes, and Booking Charges. This action cannot be undone and all deleted items will not be recoverable. Are you sure that you want to proceed?",confirmLabel:"Yes, Delete",cancelLabel:"Cancel",variant:"destructive"}}).closed$.subscribe(t=>{t&&this.deleteRentalService.deleteBookings(this.context.rental.pkey,this.tokeetData().bookings).subscribe({next:()=>{this.tokeetData.update(n=>ae(le({},n),{bookings:0})),this.isBookingsDeleted.set(!0),z.success("Inquiries and bookings deleted successfully.");},error:()=>z.error("Failed to delete bookings.")});});}onDeleteWebsites(){this.amplitude.logEvent("rental-delete-websites"),this.dialogService.open(K,{context:{title:"Remove rental from websites?",message:"This will remove the selected rental from any Sympl websites associated with it currently. Are you sure that you want to proceed?",confirmLabel:"Yes, Remove",cancelLabel:"Cancel",variant:"destructive"}}).closed$.subscribe(t=>{t&&this.deleteRentalService.deleteWebsites(this.context.rental.pkey).subscribe({next:()=>{this.tokeetData.update(n=>ae(le({},n),{websites:0})),this.isWebsitesDeleted.set(!0),z.success("Websites deleted successfully.");},error:()=>z.error("Failed to remove website associations.")});});}onDeleteWebreadyData(){if(this.amplitude.logEvent("rental-delete-webready"),this.webreadyData().websites>0){this.showWebreadyWebsitesWarning();return;}if(this.webreadyData().images>0){this.dialogService.open(pi,{context:{title:"Remove rental from Webready?",body:"This will remove the selected rental from Webready. Are you sure that you want to proceed?",extra:"Delete Images",confirmLabel:"Yes, Remove",cancelLabel:"Cancel"}}).closed$.subscribe(r=>{r?.confirmed&&this.deleteWebreadyRental(r.isChecked);});return;}this.dialogService.open(K,{context:{title:"Remove rental from Webready?",message:"This will remove the selected rental from Webready. Are you sure that you want to proceed?",confirmLabel:"Yes, Remove",cancelLabel:"Cancel",variant:"destructive"}}).closed$.subscribe(n=>{n&&this.deleteWebreadyRental(!1);});}onDelete(){this.amplitude.logEvent("rental-delete-confirm"),this.dialogService.open(K,{context:{title:"Delete this Rental?",message:"This will remove the rental from your rental list and all Sympl calendars. This action cannot be undone. Are you sure that you want to proceed?",confirmLabel:"Yes, Delete",cancelLabel:"Cancel",variant:"destructive"}}).closed$.subscribe(t=>{t&&(this.isDeletingWholeRental.set(!0),this.deleteRentalService.delete(this.context.rental.pkey).subscribe({next:()=>{this.isDeletingWholeRental.set(!1),z.success("Rental deleted successfully."),this.dialogRef.close({deleted:!0,rentalId:this.context.rental.pkey});},error:n=>{this.isDeletingWholeRental.set(!1),z.error("Failed to delete rental.",{description:_t(n)});}}));});}showWebreadyWebsitesWarning(){this.dialogService.open(K,{context:{title:"Warning",message:"You need to manually remove rental from all Webready websites before you can delete it.",confirmLabel:"Login Webready",cancelLabel:"Close"}}).closed$.subscribe(t=>{t&&this.loginWebready();});}deleteWebreadyRental(e){this.deleteRentalService.deleteWebreadyRental(this.context.rental.pkey,e).subscribe({next:()=>{e&&this.webreadyData.update(t=>ae(le({},t),{images:0})),this.isWebreadyRentalDeleted.set(!0),z.success("Rental removed from Webready.");},error:t=>{t.status===409&&this.showWebreadyWebsitesWarning(),z.error("Unable to delete rental from Webready.",{description:_t(t)});}});}loginWebready(){let e=this.authState.token();window.open(`${qe.webreadyUrl}login?token=${e}`,"_blank");}static ɵfac=function(t){return new(t||l)();};static ɵcmp=X({type:l,selectors:[["app-delete-rental-sheet"]],hostAttrs:[1,"flex","flex-col","h-full","px-[60px]"],features:[W([],[q({lucideCalendarX:Sn,lucideCalendarCheck:En,lucideGlobe:un,lucideBuilding:dn,lucideLoader2:Ge})])],decls:81,vars:41,consts:()=>{let e;e="Delete Rental - "+"\uFFFD0\uFFFD"+"";let t;t=" You are attempting to delete a rental. In order to delete a rental from Sympl you must first delete any hold events, inquiries, bookings and website associations before doing so. Please use the options below to complete these tasks. Please note that all associated hold events, bookings, invoices and messages will be purged and will not be recoverable. This will also impact data shown in your reports as these items will no longer be accessible for calculation by the reporting module. ";let n;n=" This rental will be disconnected from all API channels. If the channel connection is no longer valid it should be removed from Sympl. ";let r;r="All rental images and other associated data will be removed.";let s;s="All imported and exported iCal calendars will be deleted.";let A;A="This rental will no longer be displayed on distribution channels like Marriott and HomeToGo.";let $;$="You must remove all bookings, hold events, and website associations related to this rental.";let g;g="This rental will be deactivated in all connected Tokeet and partner applications.";let h;h=" Some of these services can be deleted from your account individually ";let k;k="Hold Events";let w;w="Inquiries & Bookings";let x;x="Websites Associations";let U;U="Rental in Webready";let L;L="Delete Whole Rental";let Y;Y="All services associated with this rental will be deleted";let Q;Q="Loading...";let Re;Re=""+"\uFFFD0\uFFFD"+" Hold Events Created";let Ce;Ce="Loading...";let fe;fe=""+"\uFFFD0\uFFFD"+" Inquiries & Bookings Created";let Ne;Ne="Loading...";let he;he=""+"\uFFFD0\uFFFD"+" Website Associations";let Le;Le="Loading...";let ye;return ye=" Used in "+"\uFFFD0\uFFFD"+" Websites, contains "+"\uFFFD1\uFFFD"+" Images ",[e,t,n,r,s,A,$,g,h,k,w,x,U,L,Y,Q,Re,Ce,fe,Ne,he,Le,ye,["hlmSheetHeader","",1,"!flex-row","!items-center","!justify-between"],["hlmSheetTitle","",1,"!text-left","truncate"],["hlmSheetClose",""],[1,"flex-1","overflow-y-auto","py-4"],[1,"rounded-[var(--tile-r)]","border","border-(--line)","bg-(--canvas)","p-4","text-sm","text-(--ink-500)"],[1,"mt-3","list-decimal","space-y-1","pl-5","leading-relaxed"],[1,"mt-6"],[1,"text-sm","font-medium","text-(--ink-900)"],[1,"mt-4","grid","grid-cols-2","gap-4"],["hlm","","name","lucideCalendarX","size","lg"],[1,"flex-1","min-w-0"],[1,"text-xs","text-(--ink-400)"],["type","button",1,"text-destructive","hover:text-red-700",3,"click","disabled"],["hlm","","name","trash","size","sm"],["hlm","","name","lucideCalendarCheck","size","lg"],["hlm","","name","lucideGlobe","size","lg"],[1,"mt-8","flex","justify-center"],["hlm","","name","lucideBuilding","size","lg"],["hlm","","name","lucideLoader2","size","sm",1,"animate-spin"]];},template:function(t,n){t&1&&(i(0,"div",23)(1,"h3",24),_(2,0),o(),d(3,"button",25),o(),i(4,"div",26)(5,"div",27)(6,"p"),_(7,1),o(),i(8,"ol",28)(9,"li"),_(10,2),o(),i(11,"li"),_(12,3),o(),i(13,"li"),_(14,4),o(),i(15,"li"),_(16,5),o(),i(17,"li"),_(18,6),o(),i(19,"li"),_(20,7),o()()(),i(21,"div",29)(22,"p",30),_(23,8),o(),i(24,"div",31)(25,"div"),d(26,"ng-icon",32),i(27,"div",33)(28,"div"),b(29),_(30,9),v(),o(),i(31,"div",34),m(32,uo,2,0,"ng-container")(33,po,2,1,"ng-container"),o()(),i(34,"button",35),p("click",function(){return n.onDeleteHold();}),d(35,"ng-icon",36),o()(),i(36,"div"),d(37,"ng-icon",37),i(38,"div",33)(39,"div"),b(40),_(41,10),v(),o(),i(42,"div",34),m(43,go,2,0,"ng-container")(44,Ro,2,1,"ng-container"),o()(),i(45,"button",35),p("click",function(){return n.onDeleteBookings();}),d(46,"ng-icon",36),o()(),i(47,"div"),d(48,"ng-icon",38),i(49,"div",33)(50,"div"),b(51),_(52,11),v(),o(),i(53,"div",34),m(54,Co,2,0,"ng-container")(55,fo,2,1,"ng-container"),o()(),i(56,"button",35),p("click",function(){return n.onDeleteWebsites();}),d(57,"ng-icon",36),o()(),i(58,"div"),d(59,"ng-icon",38),i(60,"div",33)(61,"div"),b(62),_(63,12),v(),o(),i(64,"div",34),m(65,No,2,0,"ng-container")(66,ho,2,2,"ng-container"),o()(),i(67,"button",35),p("click",function(){return n.onDeleteWebreadyData();}),d(68,"ng-icon",36),o()()(),i(69,"div",39)(70,"div"),d(71,"ng-icon",40),i(72,"div",33)(73,"div"),b(74),_(75,13),v(),o(),i(76,"div",34),_(77,14),o()(),i(78,"button",35),p("click",function(){return n.onDelete();}),m(79,Lo,1,0,"ng-icon",41)(80,yo,1,0,"ng-icon",36),o()()()()()),t&2&&(a(2),Ee(n.context.rental.name),Se(2),a(23),D(n.serviceCardClass(n.isHoldDisabled())),a(),D(n.serviceIconClass(n.isHoldDisabled())),a(2),D(n.serviceTitleClass(n.isHoldDisabled())),a(4),T(n.tokeetData().loading?32:33),a(2),c("disabled",n.isHoldDisabled()),a(2),D(n.serviceCardClass(n.isBookingsDisabled())),a(),D(n.serviceIconClass(n.isBookingsDisabled())),a(2),D(n.serviceTitleClass(n.isBookingsDisabled())),a(4),T(n.tokeetData().loading?43:44),a(2),c("disabled",n.isBookingsDisabled()),a(2),D(n.serviceCardClass(n.isWebsitesDisabled())),a(),D(n.serviceIconClass(n.isWebsitesDisabled())),a(2),D(n.serviceTitleClass(n.isWebsitesDisabled())),a(4),T(n.tokeetData().loading?54:55),a(2),c("disabled",n.isWebsitesDisabled()),a(2),D(n.serviceCardClass(n.isWebreadyDisabled())),a(),D(n.serviceIconClass(n.isWebreadyDisabled())),a(2),D(n.serviceTitleClass(n.isWebreadyDisabled())),a(4),T(n.webreadyData().loading?65:66),a(2),c("disabled",n.isWebreadyDisabled()),a(3),D(n.wholeRentalCardClass()),a(),D(n.serviceIconClass(!n.isAllDeleted())),a(2),D(n.serviceTitleClass(!n.isAllDeleted())),a(5),c("disabled",!n.isAllDeleted()||n.isDeletingWholeRental()),a(),T(n.isDeletingWholeRental()?79:80));}
1,dependencies:[j,Z,ei,Ze,Ke],encapsulation:2,changeDetection:0});};var rt=class l{dialogService=u(te);sheetService=u(Je);open(e){return kn(e)||Fn(e)?(this.dialogService.open(Vn,{context:{title:"Warning",message:"You cannot delete a parent rental or main unit.",buttonLabel:"OK"}}),ne(null)):this.sheetService.open(at,{context:{rental:e},contentClass:"w-[800px] sm:max-w-none",side:"right"}).closed$;}static ɵfac=function(t){return new(t||l)();};static ɵprov=Bt({token:l,factory:l.ɵfac,providedIn:"root"});};function bo(l,e){if(l&1){let t=F();i(0,"button",29),p("click",function(){C(t);let r=E(2);return f(r.openAddRentalSheet());}),i(1,"span"),_(2,5),o()();}}function vo(l,e){if(l&1){let t=F();i(0,"button",27),p("click",function(){C(t);let r=E();return f(r.openExportDialog());}),i(1,"span"),_(2,4),o()(),m(3,bo,3,0,"button",28);}if(l&2){let t=E();a(3),T(t.hasReachedMaxRentals()?-1:3);}}function Po(l,e){if(l&1&&(i(0,"div",12),R(1),o()),l&2){let t=E();a(),I(" ",t.maxRentalsAlertMessage()," ");}}function Mo(l,e){if(l&1&&(i(0,"hlm-option",18),R(1),o()),l&2){let t=e.$implicit;c("value",t),a(),B(t);}}function $o(l,e){l&1&&(i(0,"div",25),d(1,"app-page-loader",30),o());}function Do(l,e){if(l&1&&(i(0,"div",26),R(1),o()),l&2){let t=E();a(),I(" ",t.error()," ");}}function Io(l,e){if(l&1){let t=F();i(0,"app-rentals-table",33),p("rowClicked",function(r){C(t);let s=E(2);return f(s.onRowClick(r));})("editClicked",function(r){C(t);let s=E(2);return f(s.onEdit(r));})("deleteClicked",function(r){C(t);let s=E(2);return f(s.onDelete(r));})("sortChange",function(r){C(t);let s=E(2);return f(s.tableSort.toggle(r));})("addClicked",function(){C(t);let r=E(2);return f(r.openAddRentalSheet());}),o();}if(l&2){let t=E(2);c("rentals",t.filteredRentals())("sortState",t.tableSort.state())("readonly",t.isReadonly());}}function Go(l,e){if(l&1){let t=F();i(0,"app-rentals-grid",34),p("cardClicked",function(r){C(t);let s=E(2);return f(s.onRowClick(r));})("editClicked",function(r){C(t);let s=E(2);return f(s.onEdit(r));})("deleteClicked",function(r){C(t);let s=E(2);return f(s.onDelete(r));}),o();}if(l&2){let t=E(2);c("rentals",t.filteredRentals())("channelConnections",t.channelConnectionsByRental())("readonly",t.isReadonly());}}function xo(l,e){if(l&1&&m(0,Io,1,3,"app-rentals-table",31)(1,Go,1,3,"app-rentals-grid",32),l&2){let t=E();T(t.filteredRentals().length===0||t.viewMode()==="table"?0:1);}}var bi=class l{DataEntityType=vn;RentalStatus=xn;gridViewLabel="Grid view";tableViewLabel="Table view";maxRentalsAlertMessage=N(()=>"You have more than "+this.maxRentals+" rentals in your Account. Please use Migrate option to migarte to AdvanceCM");maxRentals=qe.symplMaxRentals??5;router=u(Qt);route=u(Yt);destroyRef=u(re);connectionsService=u(Bn);rentalsStore=u(je);rentalsService=u(wn);rentalImagesStore=u(pe);entityTagsStore=u(Qe);dialogService=u(te);sheetService=u(Je);rentalDeleteFlow=u(rt);subscriptionGateService=u(Jn);permissions=u(Dn);amplitude=u(ue);loading=N(()=>!this.rentalsStore.isLoaded());error=P(null);rentals=N(()=>this.rentalsStore.allRentals());viewMode=P("table");tableSort=di({storageKey:"rentals-table-sort"});channelConnectionsByRental=P({});hasReachedMaxRentals=N(()=>this.rentals().length>=this.maxRentals);hasExceededMaxRentals=N(()=>this.rentals().length>this.maxRentals);isReadonly=N(()=>this.permissions.isReadonly());searchControl=new Te("",{nonNullable:!0});cityFilterControl=new Te([],{nonNullable:!0});tagFilterControl=new Te([],{nonNullable:!0});taggedRentalIdsControl=new Te([],{nonNullable:!0});statusFilterControl=new Te(null);searchTerm=ce(this.searchControl.valueChanges.pipe(Xt(300),J("")),{initialValue:""});selectedCities=ce(this.cityFilterControl.valueChanges.pipe(J([])),{initialValue:[]});selectedTags=ce(this.tagFilterControl.valueChanges.pipe(J([])),{initialValue:[]});selectedTaggedRentalIds=ce(this.taggedRentalIdsControl.valueChanges.pipe(J([])),{initialValue:[]});selectedStatus=ce(this.statusFilterControl.valueChanges.pipe(J(null)),{initialValue:null});cityOptions=N(()=>{let e=this.rentals().map(t=>String(t.address?.city||"").trim()).filter(t=>!!t);return[...new Set(e)].sort((t,n)=>t.localeCompare(n,void 0,{sensitivity:"base"}));});tagOptions=N(()=>Hn(this.rentals()));filteredRentals=N(()=>{let e=this.searchTerm().toLowerCase().trim(),t=new Set(this.selectedCities().map(g=>g.toLowerCase())),n=new Set(this.selectedTags().map(g=>g.toLowerCase())),r=new Set(this.selectedTaggedRentalIds()),s=this.selectedStatus(),A=this.rentals(),$=!e&&t.size===0&&n.size===0&&r.size===0&&!s?A:A.filter(g=>{let h=String(g.address?.city||"").toLowerCase().trim(),k=(g.tags??[]).map(x=>String(x).toLowerCase());if(!(!e||g.name.toLowerCase().includes(e)||h.includes(e)||g.address?.country?.toLowerCase().includes(e)||g.phone?.toString().includes(e))||t.size>0&&!t.has(h))return!1;if(n.size>0){let x=k.some(L=>n.has(L)),U=r.has(g.pkey);if(!x&&!U)return!1;}return!(s&&g.status!==s);});return this.tableSort.sort($,(g,h)=>this.getSortValue(g,h));});rentalsDataEffect=_e(()=>{let e=this.rentals();if(e.length===0){this.channelConnectionsByRental.set({});return;}this.rentalImagesStore.loadCoverImages({rentalIds:e.map(t=>t.pkey)}),this.connectionsService.all({onSuccess:t=>{this.channelConnectionsByRental.set((0,vi.groupBy)(t,n=>n.rental_id));},onError:t=>{console.error("Failed to load channel connections:",t),this.channelConnectionsByRental.set({});}});});getSortValue(e,t){switch(t){case"name":return e.name??"";case"city":return String(e.address?.city??"");case"country":return String(e.address?.country??"");
1case"description":return(e.bedrooms??0)+(e.bathrooms??0);default:return"";}}ngOnInit(){this.amplitude.logEvent("rentals-view"),!this.entityTagsStore.isLoaded()&&!this.entityTagsStore.isLoading()&&this.entityTagsStore.loadAllTags();}clearSearch(){this.amplitude.logEvent("rentals-search"),this.searchControl.reset();}setViewMode(e){this.viewMode.set(e);}openAddRentalSheet(){this.isReadonly()||(this.amplitude.logEvent("rentals-add"),this.subscriptionGateService.ensureAddRentalAccess(this.rentals().length).subscribe(e=>{if(!e)return;this.sheetService.open(lt,{contentClass:"w-2/3",side:"right"}).closed$.subscribe();}));}openExportDialog(){this.isReadonly()||(this.amplitude.logEvent("rentals-download"),import("./chunk-J74NFBUS.js").then(({ExportRentalsDialogComponent:e})=>{this.dialogService.open(e,{context:{rentals:this.filteredRentals()}});}));}onRowClick(e){this.router.navigate(["/rentals",e.pkey]);}onEdit(e){this.isReadonly()||(this.amplitude.logEvent("rentals-edit"),this.router.navigate(["/rentals",e.pkey,"basic-info"]));}onDelete(e){this.isReadonly()||(this.amplitude.logEvent("rentals-delete"),this.rentalDeleteFlow.open(e).subscribe(t=>{t?.deleted&&this.rentalsStore.loadRentals({withoutRates:!0});}));}static ɵfac=function(t){return new(t||l)();};static ɵcmp=X({type:l,selectors:[["app-rentals-page"]],hostAttrs:[1,"block","p-6"],features:[W([],[q({lucideLayoutGrid:pn,lucideLayoutList:gn,lucideDownload:Tn,lucidePlus:He})])],decls:34,vars:18,consts:()=>{let e;e="Rental List";let t;t="Search";let n;n="Cities";let r;r="Tags";let s;s="All";let A;A=" Rental Status ";let $;$="All";let g;g="Ready";let h;h="Not Ready";let k;k="Download";let w;w="Add rental";let x;x="Export";let U;return U="Add Rental",[A,$,g,h,x,U,["title",e,1,"mb-6",3,"showBackButton"],["pageHeaderIcons","","articleId","9pm28bm90i"],["pageHeaderActions",""],["hlmBtn","","variant","surface","size","icon",1,"border-(--card-bd)","text-(--ink-500)","hover:border-(--ink-300)","hover:bg-(--canvas)","hover:text-(--ink-900)",3,"click","hlmTooltip"],["hlm","","size","sm",3,"name"],[1,"flex","flex-col","gap-5"],["role","alert",1,"rounded-[var(--tile-r)]","border","border-(--err-bg)","bg-(--err-bg)","px-4","py-3","text-[length:var(--fs-label)]","text-(--err-fg)"],[1,"flex","flex-wrap","items-center","gap-2"],["variant","filled","placeholder",t,1,"w-full","sm:w-[200px]",3,"valueChange","cleared","value"],[1,"flex","h-10","w-[240px]","items-center","gap-2.5","rounded-[10px]","border","border-(--card-bd)","bg-(--card-bg)","px-2.5"],["multiple","","placeholder",n,1,"flex-1","min-w-0",3,"formControl"],["variant","borderless",1,"w-full","border-none"],[3,"value"],["placeholder",r,3,"tags","ctrl","entityIdsCtrl","type","inline"],[1,"flex","h-10","items-center","gap-3","rounded-[10px]","border","border-(--card-bd)","bg-(--card-bg)","px-3"],[1,"whitespace-nowrap","text-[length:var(--fs-label)]","font-medium","text-(--ink-500)"],["placeholder",s,3,"formControl"],["variant","borderless",1,"h-auto","border-none","p-0","text-[length:var(--fs-label)]","font-semibold","text-(--ink-900)"],[1,"min-w-[9rem]"],[1,"flex","h-64","items-center","justify-center","rounded-[var(--card-r)]","border","border-(--card-bd)","bg-(--card-bg)","shadow-(--card-sh)"],[1,"flex","h-64","items-center","justify-center","rounded-[var(--card-r)]","border","border-(--card-bd)","bg-(--card-bg)","text-(--err-fg)","shadow-(--card-sh)"],["hlmBtn","","variant","surface","aria-label",k,3,"click"],["hlmBtn","","aria-label",w],["hlmBtn","","aria-label",w,3,"click"],["size","lg"],[3,"rentals","sortState","readonly"],[3,"rentals","channelConnections","readonly"],[3,"rowClicked","editClicked","deleteClicked","sortChange","addClicked","rentals","sortState","readonly"],[3,"cardClicked","editClicked","deleteClicked","rentals","channelConnections","readonly"]];},template:function(t,n){t&1&&(i(0,"app-page-header",6),d(1,"app-help-icons",7),b(2,8),i(3,"button",9),p("click",function(){return n.setViewMode(n.viewMode()==="table"?"grid":"table");}),d(4,"ng-icon",10),o(),m(5,vo,4,1),v(),o(),i(6,"div",11),m(7,Po,2,1,"div",12),i(8,"div",13)(9,"hlm-search-input",14),p("valueChange",function(s){return n.searchControl.setValue(s);})("cleared",function(){return n.clearSearch();}),o(),i(10,"div",15)(11,"brn-select",16)(12,"hlm-select-trigger",17),d(13,"hlm-select-value"),o(),i(14,"hlm-select-content"),V(15,Mo,2,2,"hlm-option",18,de),o()()(),d(17,"app-entity-filter-tags",19),i(18,"div",20)(19,"span",21),_(20,0),o(),i(21,"brn-select",22)(22,"hlm-select-trigger",23),d(23,"hlm-select-value"),o(),i(24,"hlm-select-content",24)(25,"hlm-option",18),_(26,1),o(),i(27,"hlm-option",18),_(28,2),o(),i(29,"hlm-option",18),_(30,3),o()()()()(),m(31,$o,2,0,"div",25)(32,Do,2,1,"div",26)(33,xo,2,1),o()),t&2&&(c("showBackButton",!1),a(3),c("hlmTooltip",n.viewMode()==="table"?n.gridViewLabel:n.tableViewLabel),ie("aria-label",n.viewMode()==="table"?n.gridViewLabel:n.tableViewLabel),a(),c("name",n.viewMode()==="table"?"lucideLayoutGrid":"lucideLayoutList"),a(),T(n.isReadonly()?-1:5),a(2),T(n.hasExceededMaxRentals()?7:-1),a(2),c("value",n.searchControl.value),a(2),c("formControl",n.cityFilterControl),a(4),O(n.cityOptions()),a(2),c("tags",n.tagOptions())("ctrl",n.tagFilterControl)("entityIdsCtrl",n.taggedRentalIdsControl)("type",n.DataEntityType.Rental)("inline",!0),a(4),c("formControl",n.statusFilterControl),a(4),c("value",null),a(2),c("value",n.RentalStatus.READY),a(2),c("value",n.RentalStatus.NOT_READY),a(2),T(n.loading()?3
11:n.error()?32:33));},dependencies:[Ae,me,De,j,Ue,we,ze,gi,ai,nt,it,Zn,ee,Z,Xe,Ve,Be,Oe,li,Kn,ot],encapsulation:2,changeDetection:0});};export{bi as RentalsPageComponent};/**i18n:d8a016f29a2176cd812bc05ea24c5a0062b07c41e1d9ecf7f4690d1a67273969*/

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.