1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/LandlordFormWizard-SaPQvMkH.js","assets/runtime-dom.esm-bundler-CJm7QP-X.js","assets/app-zmkjmCEo.js","assets/vue.runtime.esm-bundler-BEvBYxZF.js","assets/app-DH54kATn.css","assets/useRequirementForm-eYRNTmNt.js","assets/_plugin-vue_export-helper-DlAUqK2U.js","assets/useRequirementForm-BPrg0cqV.css","assets/mapbox-gl-DSz7U4XD.js","assets/mapbox-gl-Dv_zA2cU.css","assets/useMarketContext-sifTEuws.js","assets/useDarkMode-KhUMhsg6.js","assets/Address-oJYHRU2S.js","assets/ValidationTick-UTOx94wG.js","assets/ValidationTick-DxZVq2ny.css","assets/useFieldValidation-Bv5nkqhz.js","assets/Address-CinBfcN-.css","assets/FacingInput-B-k3NfqG.js","assets/FacingInput-CT26mpZC.css","assets/NnnCamProportionalShare-BYaIQsca.js","assets/UseTypeTreePicker-DCZqb5ck.js","assets/UseTypeTreePicker-Gz36Emnr.css","assets/NnnCamProportionalShare-e99Rjyjc.css","assets/BuildoutCondition-B74yAoz5.js","assets/BuildoutCondition-DhUTisRr.css","assets/KitFloors-Cq-aF_Dq.js","assets/chevron-right-NeBCr8tV.js","assets/chevron-down-CUIRddy-.js","assets/x-nwAth_va.js","assets/plus-BQy32KmW.js","assets/minus-Czr8u_L4.js","assets/KitFloors-CsXt0Cho.css","assets/vuedraggable.umd-FXLJ8Dtl.js","assets/index-oE38lWeI.js","assets/upload-JFGOZJ0J.js","assets/rotate-ccw-nmS9E6oH.js","assets/info-B3-gikqK.js","assets/rotate-cw-Do49Ginb.js","assets/check-FVJuUoDO.js","assets/trash-2-BY8eEJcV.js","assets/RentCalculator-B-_rk0fE.js","assets/RentCalculator-BUuELQjH.css","assets/TeamMembersInput-D3B6ZUFi.js","assets/search-BXJDo_NW.js","assets/TeamMembersInput-Bt3jexFk.css","assets/LiteLockedTeamMembersButton-BJ-lq5Xe.js","assets/useLiteMode-NrAJtMCW.js","assets/liteUpgradeStore-C8EK4zxi.js","assets/lock-I-L6DcWB.js","assets/LiteLockedTeamMembersButton-wmcft9Ao.css","assets/savedAvailabilitiesStore-BCJItia7.js","assets/floorPlanRegenStore-DPnajeNi.js","assets/homeMarketScope-DM-pmgSf.js","assets/LandlordFormWizard-DCeAkrgP.css","assets/ShareToggle-DhPWCG66.css","assets/CreatePropertyModal-Dw8Hk7e_.js","assets/flyerUrls-D7ud3i52.js","assets/MapWithPolygonDrawing-CkcKOJwO.js","assets/useMarketExamples-CeSy0naI.js","assets/MapboxMap-DZjTHyAR.js","assets/mapbox-gl-draw-BbhK9W9D.js","assets/mapbox-gl-draw-DjM7mR0C.css","assets/pen-tool-BSbhHGAC.js","assets/MapboxMap-ZXxjwVJR.css","assets/SavedAvailsFilterRow.vue_vue_type_script_setup_true_lang-CaOHmudq.js","assets/user-check-BpNHxj42.js","assets/globe-IiqdwD3H.js","assets/building-2-B255upjb.js","assets/LlCardComponent-DHpz2vdU.js","assets/useInitials-C0AQeawK.js","assets/circle-check-big-CMIXS8Re.js","assets/UsersIcon-BjHT-OFx.js","assets/LlCardComponent-BsLsjlSH.css","assets/hexagon-S_8KR85O.js","assets/ellipsis-D60X9R1U.js","assets/pencil-ZCRCwIrT.js","assets/MapWithPolygonDrawing-DdiZFYTz.css","assets/SavedAvailCriteriaFilterPanel-CBULZBOD.js","assets/NeighborhoodSelect-BrHZ56BA.js","assets/leaflet-src-B4pkMBNN.js","assets/map-pin-B0ST9iOd.js","assets/NeighborhoodSelect-CsdGzIKu.css","assets/leaflet-CG6DamIu.css","assets/TenantLeaseStructure-BBfBrGSO.js","assets/RangeSlider-ChzUMea4.js","assets/RangeSlider-rRboN3Jg.css","assets/TenantLeaseStructure-CkfOzPfh.css","assets/thumbs-down-kGOf4JOV.js","assets/ruler-BnOVKyDv.js","assets/circle-dollar-sign-D9LFTD1a.js","assets/wrench-CzV27joc.js","assets/SavedAvailCriteriaFilterPanel-B7qNKyX-.css","assets/FlyerImportPanel-CGNkv4SR.js","assets/flyerImportResults-CoL818KE.js","assets/DialogContent.vue_vue_type_script_setup_true_lang-BJktKyjM.js","assets/index-BKdsjCI7.js","assets/DialogTitle.vue_vue_type_script_setup_true_lang-DnWzyHUK.js","assets/loader-circle-BOtRqPpE.js","assets/log-out-C_bFO61t.js","assets/file-text-DWlISPAU.js","assets/link-CcVG4ezA.js","assets/cloud-upload-BOKKb2ix.js","assets/circle-alert-DvHIOpSy.js","assets/FlyerImportPanel-DOQJ9024.css","assets/AiTenantSearch-B5Qy4dAo.js","assets/marked.esm-DKjyhwJX.js","assets/purify.es-BaNf_EpD.js","assets/LandlordReqDetails-G2IBQgdw.js","assets/FieldInspectorModal-CDnY0VIw.js","assets/useForwardPropsEmits-CxTdraTl.js","assets/RovingFocusItem-CRj7rVtF.js","assets/LocationSection-4Q4lmzIV.js","assets/LocationSection-C2D3ZDXL.css","assets/propertyDisplayFieldGroups-CmJElNe9.js","assets/fieldFormatters-0CcS0g52.js","assets/clock-Dz2x9KrA.js","assets/arrow-right-B4xeLuw8.js","assets/save-CPp77MWx.js","assets/landmark-CGNrl9vU.js","assets/arrow-up-right-18EJK1ox.js","assets/book-open-BbIgd3J1.js","assets/FieldInspectorModal-B92axWNc.
1css","assets/FieldInspectorV2-BwgSy0hJ.js","assets/user-search-BMr0sTnC.js","assets/alarm-clock-s3UUSIiJ.js","assets/archive-CTE6FC5C.js","assets/arrow-down-left-9Q9VJprL.js","assets/arrow-down-up-DWnYe3cY.js","assets/messages-square-_YlmF6sV.js","assets/arrow-left-right-BmsmGyuo.js","assets/arrow-left-C2iqKchq.js","assets/arrow-right-left-CcouAxvj.js","assets/audio-lines-CINLW0wS.js","assets/badge-check-B7iEJ6rp.js","assets/chevrons-right-left-Kxpit0TP.js","assets/bell-off-ic0ec-WC.js","assets/bell-ring-D8yOGDD3.js","assets/utensils-DuFuYQEB.js","assets/bookmark-B242vBKa.js","assets/box-CGKkQMfi.js","assets/pen-line-C200XhjD.js","assets/briefcase-BvH9lAVg.js","assets/bug-Cm5uPdDX.js","assets/building-qAKWyATM.js","assets/mail-plus-BUp8IrON.js","assets/paintbrush-DUmvJkmQ.js","assets/calendar-DCnFpcO8.js","assets/share-BUyB9jlo.js","assets/chart-column-CQ338bM7.js","assets/check-check-BDmRdhvn.js","assets/chevron-left-GxYkUNBa.js","assets/group-6FrmBxfM.js","assets/chevron-up-DAT5fZvF.js","assets/thumbs-up-4Hbc3LWd.js","assets/circle-check-B0ld3BEm.js","assets/circle-help-CyyZtlKF.js","assets/circle-minus-BPXgnNzu.js","assets/circle-x-CZij5k9Z.js","assets/circle-CN_KRoyc.js","assets/wine-Dn9IvkT7.js","assets/megaphone-BxCiMxHj.js","assets/coins-CeCZL7Un.js","assets/columns-3-BVhMyP2Y.js","assets/compass-Yi85lcBg.js","assets/copy-check-DE5doY76.js","assets/corner-down-right-GBWfSkvC.js","assets/corner-up-right-4suulEbK.js","assets/credit-card-CPn4PpXS.js","assets/database-Do22Icq2.js","assets/download-NA90tx4Y.js","assets/earth-CKqPsZCA.js","assets/eye-off-NKCPaJTr.js","assets/shield-question-DHHVLRhu.js","assets/file-chart-column-increasing-Cb9zaDXf.js","assets/tram-front-ChHEaF3n.js","assets/house-DCQ4ef-9.js","assets/file-down-CR_imAfw.js","assets/table-2-BayhTrB6.js","assets/file-search-CI3yDfN6.js","assets/file-spreadsheet-CL13ZEdv.js","assets/file-CPwlXExA.js","assets/filter-CYEZ4Vj2.js","assets/flask-conical-BeM2xlhs.js","assets/waypoints-BjE4WwIh.js","assets/folder-open-D7q9PXNb.js","assets/folder-plus-BY5U8OwC.js","assets/footprints-DrVQ9TW0.js","assets/forward-D_1feuDb.js","assets/gift-DftWgGH1.js","assets/target-BNqfBmFd.js","assets/graduation-cap-Ddk946Ij.js","assets/grip-vertical-BQ-i8WTi.js","assets/message-circle-question-BxVstUJg.js","assets/heart-Df6LWFL6.js","assets/history-11YzWSj1.js","assets/image-up-UOM-ggyg.js","assets/image-CTezqit5.js","assets/layers-CtVJR6cB.js","assets/layout-dashboard-DddoW83K.js","assets/trash-D2vmYsZv.js","assets/list-filter-DwXgg23Q.js","assets/list-D41nWEwl.js","assets/locate-fixed-CeHOtHDp.js","assets/lock-keyhole-Du0pTijK.js","assets/mail-check-BvBE24Mm.js","assets/mail-question-DdF-X8Dc.js","assets/message-square-reply-Clovt9PD.js","assets/mail-x-DmgIfD6g.js","assets/mails-BNbNZ98t.js","assets/map-pinned-BmecD8kd.js","assets/maximize-2-rpXJRggt.js","assets/message-circle-CudSy1U1.js","assets/message-square-text-CrMpbAlo.js","assets/mic-CcTHiDA3.js","assets/minimize-2-D2SKyA2V.js","assets/sun-Vxe-aMzX.js","assets/moon-ByCxtZ0R.js","assets/mouse-pointer-2-DWag8QAD.js","assets/navigation-CKWhnMCz.js","assets/notebook-pen-DE6l99wZ.js","assets/palette-B7uz0F7A.js","assets/paperclip-BhFGPc9Q.js","assets/pause-DfKlB1m3.js","assets/paw-print-BX3efg5P.js","assets/pen-Bi-Y6D3z.js","assets/phone-BpTPUFtQ.js","assets/pin-CLMz4MmD.js","assets/play-_Au_uqGm.js","assets/unplug-CrKddqhx.js","assets/printer-BWBBL74J.js","assets/quote-D6q8JJdR.js","assets/refresh-ccw-_RMVv2Hy.js","assets/refresh-cw-DuENTqDR.js","assets/rocket-6ecDvobK.js","assets/scissors-B_3P4Jvw.js","assets/search-x--ooGvX-B.js","assets/settings-2-COoVgdgR.js","assets/settings-CLlNKjh2.js","assets/shapes-KbUGTZBE.js","assets/shield-alert-Dd7vd8IB.js","assets/shield-check-3noZbUO0.js","assets/trees-m-96WbnV.js","assets/skip-forward-BeTTTr2k.js","assets/star-vr2Nk3Wc.js","assets/stethoscope-BDdYFcFp.js","assets/store-TWREmPZa.js","assets/table-properties-IHP8u95G.js","assets/tag-8ruGibRY.js","assets/toggle-left-BnlT42nr.js","assets/toggle-right-RbUzGAG8.js","assets/undo-2-Dpq9fvxA.js","assets/unlink-Dg0YEyuN.js","assets/user-minus-DN7VD5K0.js","assets/user-round-search-DnQqfRq9.js","assets/user-x-Ct7BUOVL.js","assets/user-BqzrwYTf.js","assets/users-round-CLvJT8ci.js","assets/volume-x-3VGmuT6n.js","assets/wand-sparkles-Du8rZ-0T.js","assets/wifi-off-DApgiyyW.js","assets/FieldInspectorV2-DW7Od8NE.css","assets/importResolution-C2aBG4Bw.js","assets/CrmContactChip.vue_vue_type_script_setup_true_lang-DrloivuK.js","assets/useContactDrawer-N9kwz5Z3.js","assets/DemographicsPanel-DNiPBBD8.js","assets/TooltipProvider.vue_vue_type_script_setup_true_lang-DPWlAP_h.js","assets/CityRelativeBar-N0Ss4s9o.js","assets/CityRelativeBar-C5lWGPoj.css","assets/DemographicsPanel-C_6L6jVH.css","assets/EmailComposer-DljlSpJF.js","assets/LiteEmailHandoffPanel-DXzz14za.js","assets/EmailSignature-D8iFO5st.js","assets/EmailSignature-Ctd-_RwU.css","assets/ReplyBody.vue_vue_type_style_index_0_lang-u1Q6JOHm.js","assets/ReplyBody-BSSBoTeu.css","assets/XMarkIcon-9DjHk_wL.js","assets/PlusIcon-B42jluFS.js","assets/ArrowPathIcon-DaH-bfqm.js","assets/InformationCircleIcon-kgtYV5ft.js","assets/ArrowLeftIcon-qHfk5rTN.js","assets/PaperAirplaneIcon-BH_QXWXN.js","assets/EmailComposer-DFvOcnVf.css","assets/dialog-TRNYWAU_.js","assets/transition-b99CYUvP.js","assets/PencilSquareIcon-CAVo7Khd.js","assets/ChevronDownIcon-CUXldO0b.js","assets/CheckCircleIcon-Ca7zbmdq.js","assets/SparklesIcon-DGWuJ4FF.js","assets/navigationCleanup-k9GxEfm4.js","assets/PencilIcon-LwkDTMmQ.js","assets/GlobeAltIcon-BezW6LvA.js","assets/DocumentTextIcon-I1l8v-t8.js","assets/TrashIcon-4oeYgpHp.js","assets/BuildingOfficeIcon-CzPL2Bge.js","assets/CalendarIcon-CeJAqUkX.js","assets/MultiFlyerProgressPanel-uUTR9fKs.js","assets/index-h2zh0s5F.js","assets/MultiFlyerProgressPanel-B3Ylp4Co.css","assets/CompCard-DM3z5W14.js","assets/TenantBookSearchLink.vue_vue_type_script_setup_true_lang-B18a05lD.js","assets/addressDisplay-a67cvzwz.js","assets/useTenantLogoResolver-CHIte3WD.js","assets/tenantLogoCache--HpE6JuX.js","assets/tenantLogoRequestBroker-BftEUVSp.js","assets/CompCard-B1yDkcQV.css","assets/ShareToggle-DBTgKlvj.js","assets/MoveToTenantModal.vue_vue_type_script_setup_true_lang-Vu-4E
1BBz.js","assets/AddToTourbookModal.vue_vue_type_script_setup_true_lang-DQXs1L_W.js","assets/LogoSuggestions-B5fNRmJA.js","assets/LogoSuggestions-B1s3_XQs.css","assets/ListingOwnershipBar-Dfr_yCZa.js","assets/ListingOwnershipBar-CumQUQSx.css","assets/tenantWorkspacePropertyRemoval-BEXiLB7d.js","assets/AddSitesPanel-Bleou8CE.js","assets/SearchInputWithFields.vue_vue_type_script_setup_true_lang-BII21I3P.js","assets/InfiniteScrollStatus.vue_vue_type_script_setup_true_lang-Da_YnTs7.js","assets/mapUtils-DvmRFWom.js","assets/AddSitesPanel-B6LN5Xtl.css","assets/LogoBgPickerModal.vue_vue_type_script_setup_true_lang-CujHp_D4.js","assets/creditCostHint-Dq8rXbXU.js","assets/Switch-B5gtR8sA.js","assets/DialogFooter.vue_vue_type_script_setup_true_lang-RUXkKh5s.js","assets/MinusCircleIcon-Bk9XlLl3.js","assets/ArrowTopRightOnSquareIcon-DJhUFN3m.js","assets/ChevronLeftIcon-DiBSieDq.js","assets/ChevronRightIcon-CbGxidy8.js","assets/UserIcon-dOJGqfFg.js","assets/ExclamationTriangleIcon-DehMT6KK.js","assets/LandlordReqDetails-gAEFTdkh.css","assets/ChatChart-DZ3ucL9-.js","assets/ChatChart-DCGxE_ii.css","assets/useAiSearchTutorial-DvjznCiT.js","assets/aiTenantSearchStore-X7gTEWOE.js","assets/AiSearchPillChip-Bc5YXh2R.js","assets/AiSearchPillChip-BvhWDSew.css","assets/useAiSearchTutorial-CyQA9TBG.css","assets/ConstraintDiff.vue_vue_type_script_setup_true_lang-D-q-IJwZ.js","assets/AiSearchCriteriaChips-BNctQL4E.js","assets/AiSearchCriteriaChips-DVbTrZEw.css","assets/matchedSpaceCard-DDGNMF_o.js","assets/AiTenantSearch-Dwvgz5bF.css","assets/MoveToTenantModal-DVWN75Xx.js","assets/AddToTourbookModal-Bfu5wkL3.js"])))=>i.map(i=>d[i]); 2import{d as ni,o as m,c as A,F as ye,u as f,i as g,k as V,t as J,j as P,b as O,f as Se,I as Nt,r as pt,T as ps,g as h,a as v,h as bs,H as Co,D as Vt,n as K,p as q,z as oe,E as Ro,q as ls,w as ht,s as Po,O as Pe,_ as Ee}from"./runtime-dom.esm-bundler-CJm7QP-X.js";import{b as Eo,c as Fo}from"./flyerImportResults-CoL818KE.js";import{_ as To}from"./AppLayout.vue_vue_type_script_setup_true_lang-BZ3b0kf4.js";import{P as Lo}from"./PageHeader-VnlYhJu9.js";import{_ as us}from"./InfiniteScrollStatus.vue_vue_type_script_setup_true_lang-Da_YnTs7.js";import{L as ds}from"./LlCardComponent-DHpz2vdU.js";import{C as Bo}from"./CardSkeleton-BYX8GfoX.js";import{u as $o,_ as Do}from"./SavedAvailsFilterRow.vue_vue_type_script_setup_true_lang-CaOHmudq.js";import{u as No}from"./useMarketContext-sifTEuws.js";import{S as Vo,r as Oo,i as ys,G as zo,f as r,a as et,j as Ho,h as Uo,T as Jo,u as Wo,_ as cs}from"./app-zmkjmCEo.js";/* empty css */import{g as jo}from"./navigationCleanup-k9GxEfm4.js";import{p as Go}from"./mapUtils-DvmRFWom.js";import{u as Qo}from"./savedAvailabilitiesStore-BCJItia7.js";import{u as Yo}from"./floorPlanRegenStore-DPnajeNi.js";import{u as Xo}from"./MultiFlyerProgressPanel-uUTR9fKs.js";import{u as Ko}from"./useLiteMode-NrAJtMCW.js";import{_ as Zo}from"./AiSearchOmnibox.vue_vue_type_script_setup_true_lang-BQq5VhQ4.js";import{u as _s,i as qo}from"./AiSearchPillChip-Bc5YXh2R.js";import{_ as er,S as tr,A as ar,u as ir,z as sr,h as nr}from"./useAiSearchTutorial-DvjznCiT.js";import{E as or}from"./eye-off-NKCPaJTr.js";import{L as _a}from"./loader-circle-BOtRqPpE.js";import{B as rr}from"./utensils-DuFuYQEB.js";import{A as lr}from"./arrow-left-C2iqKchq.js";import{X as ii}from"./x-nwAth_va.js";import{U as ur}from"./undo-2-Dpq9fvxA.js";import{_ as dr}from"./AiSearchFilterRail.vue_vue_type_script_setup_true_lang-DbWNinPg.js";import{C as ti}from"./check-FVJuUoDO.js";import{M as cr}from"./minus-Czr8u_L4.js";import{_ as ws}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{m as vr}from"./matchedSpaceCard-DDGNMF_o.js";import{a as gr}from"./homeMarketScope-DM-pmgSf.js";import{B as fr}from"./book-open-BbIgd3J1.js";import{L as vs}from"./lock-I-L6DcWB.js";import{a as mr,c as hr}from"./thumbs-down-kGOf4JOV.js";import{F as pr}from"./filter-CYEZ4Vj2.js";import{R as br}from"./refresh-cw-DuENTqDR.js";import"./index-BKdsjCI7.js";import"./Input.vue_vue_type_script_setup_true_lang-kagTUIEv.js";import"./Toaster-BMHT8SLv.js";import"./useForwardPropsEmits-CxTdraTl.js";import"./index-h2zh0s5F.js";import"./DialogContent.vue_vue_type_script_setup_true_lang-BJktKyjM.js";import"./DialogTitle.vue_vue_type_script_setup_true_lang-DnWzyHUK.js";import"./DialogFooter.vue_vue_type_script_setup_true_lang-RUXkKh5s.js";import"./useContactDrawer-N9kwz5Z3.js";import"./Button.vue_vue_type_script_setup_true_lang-BlprGaCV.js";import"./companyBrain-B3frcGtL.js";import"./useDirectoryDrawers-C2EcfjjE.js";import"./creditStyle-DmqN3nJG.js";import"./coins-CeCZL7Un.js";import"./message-circle-question-BxVstUJg.js";import"./arrow-right-B4xeLuw8.js";import"./user-search-BMr0sTnC.js";import"./pen-line-C200XhjD.js";import"./file-text-DWlISPAU.js";import"./building-2-B255upjb.js";import"./palette-B7uz0F7A.js";import"./wand-sparkles-Du8rZ-0T.js";import"./rocket-6ecDvobK.js";import"./navigation-CKWhnMCz.js";import"./compass-Yi85lcBg.js";import"./ruler-BnOVKyDv.js";import"./layers-CtVJR6cB.js";import"./layout-dashboard-DddoW83K.js";import"./map-pin-B0ST9iOd.js";import"./search-BXJDo_NW.js";import"./shield-alert-Dd7vd8IB.js";import"./liteUpgradeStore-C8EK4zxi.js";import"./building-qAKWyATM.js";import"./chart-column-CQ338bM7.js";import"./TooltipProvider.vue_vue_type_script_setup_true_lang-DPWlAP_h.js";import"./useInitials-C0AQeawK.js";import"./DropdownMenuTrigger.vue_vue_type_script_setup_true_lang-CDKKx2C6.js";import"./settings-CLlNKjh2.js";import"./log-out-C_bFO61t.js";import"./thumbs-up-4Hbc3LWd.js";import"./SheetContent.vue_vue_type_script_setup_true_lang-BJJM9RT8.js";import"./chevron-down-CUIRddy-.js";import"./chevron-right-NeBCr8tV.js";import"./settings-2-COoVgdgR.js";import"./circle-check-B0ld3BEm.js";import"./AppLogo-5ysqpZuF.js";import"./croaker_logo_notext_dark-CxNx2zn3.js";import"./CreditAmount-CGU4y8IS.js";import"./creditCostHint-Dq8rXbXU.js";import"./message-square-text-CrMpbAlo.js";import"./lock-keyhole-Du0pTijK.js";import"./file-chart-column-increasing-Cb9zaDXf.js";import"./messages-square-_YlmF6sV.js";import"./circle-help-CyyZtlKF.js";import"./ClientThreadPanel-DapOlV9K.js";import"./ListingChatCard.vue_vue_type_script_setup_true_lang-AZtWzSdO.js";import"./arrow-up-right-18EJK1ox.js";import"./store-TWREmPZa.js";import"./pencil-ZCRCwIrT.js";import"./circle-alert-DvHIOpSy.js";
2import"./trash-2-BY8eEJcV.js";import"./message-circle-CudSy1U1.js";import"./plus-BQy32KmW.js";import"./maximize-2-rpXJRggt.js";import"./ImpersonationBanner.vue_vue_type_script_setup_true_lang-DQQn71IM.js";import"./info-B3-gikqK.js";import"./pipelineStages-D5uFtOok.js";import"./landmark-CGNrl9vU.js";import"./chevron-left-GxYkUNBa.js";import"./history-11YzWSj1.js";import"./globe-IiqdwD3H.js";import"./phone-BpTPUFtQ.js";import"./rotate-ccw-nmS9E6oH.js";import"./ellipsis-D60X9R1U.js";import"./useMarketExamples-CeSy0naI.js";import"./target-BNqfBmFd.js";import"./brandCategoryLabel-D7L37GVf.js";import"./TeamMembersInput-D3B6ZUFi.js";import"./Textarea-CiNHRhAq.js";import"./briefcase-BvH9lAVg.js";import"./useTenantLogoResolver-CHIte3WD.js";import"./tenantLogoCache--HpE6JuX.js";import"./tenantLogoRequestBroker-BftEUVSp.js";import"./SearchInputWithFields.vue_vue_type_script_setup_true_lang-BII21I3P.js";import"./upload-JFGOZJ0J.js";import"./circle-check-big-CMIXS8Re.js";import"./UsersIcon-BjHT-OFx.js";import"./user-check-BpNHxj42.js";import"./vue.runtime.esm-bundler-BEvBYxZF.js";import"./clock-Dz2x9KrA.js";import"./AiSearchMarketSelect.vue_vue_type_script_setup_true_lang-CGP3iwge.js";import"./marked.esm-DKjyhwJX.js";import"./purify.es-BaNf_EpD.js";import"./audio-lines-CINLW0wS.js";import"./play-_Au_uqGm.js";import"./volume-x-3VGmuT6n.js";import"./mic-CcTHiDA3.js";import"./arrow-left-right-BmsmGyuo.js";import"./list-filter-DwXgg23Q.js";import"./aiTenantSearchStore-X7gTEWOE.js";import"./LogoSuggestions-B5fNRmJA.js";import"./graduation-cap-Ddk946Ij.js";import"./stethoscope-BDdYFcFp.js";import"./AiSearchCriteriaChips-BNctQL4E.js";function yr(p,l){const _=p.availabilities.findIndex(x=>x.id===l.id);if(l.in_primary_inventory===!1){_!==-1&&p.removeAvailabilityById(l.id);return}_!==-1?p.updateAvailability(_,l):p.addAvailability(l)}function _r(){let p=!1;return{reset(){p=!1},noteIntent(l){p=l},take({automatic:l,evidence:_,available:x}){return x?l&&_&&!p?!1:(p=!1,!0):(p=!1,!1)}}}const oi=1e-6,gs=1.75;function wr(p,l=gs){const _=Number.isFinite(l)?Math.max(1,l):gs,L=Math.max(0,p.north-p.south)*(_-1)/2;if(p.east<p.west)return{west:-180,south:Math.max(-90,p.south-L),east:180,north:Math.min(90,p.north+L)};const G=Math.max(0,p.east-p.west)*(_-1)/2;return{west:Math.max(-180,p.west-G),south:Math.max(-90,p.south-L),east:Math.min(180,p.east+G),north:Math.min(90,p.north+L)}}function kr(p,l,_=oi){return l.west>=p.west-_&&l.south>=p.south-_&&l.east<=p.east+_&&l.north<=p.north+_}function Sr(p,l,_=!0){return!_||!l?!1:p?!kr(p,l):!0}function xr(p,l,_=oi){return p?Math.abs(p.west-l.west)>=_||Math.abs(p.south-l.south)>=_||Math.abs(p.east-l.east)>=_||Math.abs(p.north-l.north)>=_:!0}function Ar({mapFilterEnabled:p,embeddedSessionActive:l,isUser:_,currentBounds:x,nextBounds:L,epsilon:E=oi}){return!p||l||!_||!L?!1:xr(x,L,E)}function fs({mapFilterEnabled:p,hasStoredMapBounds:l,hasUserInteractedWithMap:_,currentPage:x,scrollTop:L}){return p&&!l&&!_&&x<=1&&L<=0}const Ir=512,fa=85.051129,Mr=.03;function Cr(p,l,_,x){if(!Array.isArray(p)||p.length!==2)return null;const[L,E]=p;if(!Number.isFinite(L)||!Number.isFinite(E)||!Number.isFinite(l)||!(_>0)||!(x>0))return null;const G=Ir*Math.pow(2,l),_e=Math.max(-fa,Math.min(fa,E))*Math.PI/180,we=(L+180)/360*G,ge=(1-Math.log(Math.tan(_e)+1/Math.cos(_e))/Math.PI)/2*G,z=ae=>ae/G*360-180,Q=ae=>{const le=Math.PI-2*Math.PI*ae/G;return 180/Math.PI*Math.atan(.5*(Math.exp(le)-Math.exp(-le)))};return{west:Math.max(-180,z(we-_/2)),east:Math.min(180,z(we+_/2)),north:Math.min(fa,Q(ge-x/2)),south:Math.max(-fa,Q(ge+x/2))}}function Rr(p,l,_=Mr){if(!p||!l)return!1;const x=Math.abs(l.east-l.west),L=Math.abs(l.north-l.south);return!(x>0)||!(L>0)?!1:Math.abs(p.west-l.west)<=_*x&&Math.abs(p.east-l.east)<=_*x&&Math.abs(p.north-l.north)<=_*L&&Math.abs(p.south-l.south)<=_*L}class Pr{constructor(l={}){this.entries=new Map,this.inFlight=new Map,this.generation=0,this.ttlMs=l.ttlMs??45e3,this.maxEntries=l.maxEntries??12,this.now=l.now??(()=>Date.now())}load(l,_){const x=this.entries.get(l);if(x&&this.now()-x.at<this.ttlMs)return this.entries.delete(l),this.entries.set(l,x),Promise.resolve(x.data);x&&this.entries.delete(l);const L=this.inFlight.get(l);if(L)return L;const E=this.generation,G=_().then(ve=>(E===this.generation&&this.remember(l,ve),ve)).finally(()=>{this.inFlight.delete(l)});return this.inFlight.set(l,G),G}clear(){this.generation+=1,this.entries.clear(),this.inFlight.clear()}remember(l,_){for(this.entries.delete(l),this.entries.set(l,{at:this.now(),data:_});this.entries.size>this.maxEntries;){const x=this.entries.keys().next().value;if(typeof x!="string")break;this.entries.delete(x)}}}
2function Er(p){if(!Array.isArray(p))return!1;for(let l=p.length-1;l>=0;l-=1){const _=p[l];if((_==null?void 0:_.role)!=="assistant")continue;const x=_.metadata_json;if(!((x==null?void 0:x.message_type)==="follow_up"||(x==null?void 0:x.message_type)==="results_ready"))return!!(x!=null&&x.search_execution_error)}return!1}function Fr(p,l){return l?p>0?"Update failed · previous results":"Search failed":`${p.toLocaleString()} ${p===1?"match":"matches"}`}const Tr={class:"flex items-center gap-2.5 flex-1 min-w-0 h-11"},Lr={class:"truncate"},Br={class:"relative flex h-2 w-2 flex-shrink-0"},$r={key:0,class:"animate-ping absolute inline-flex h-full w-full rounded-full bg-purple-400 opacity-75"},Dr={class:"text-sm font-semibold text-gray-800 dark:text-gray-100 flex-shrink-0 tabular-nums"},Nr={key:2,class:"relative flex-shrink-0"},Vr=["title"],Or=["title"],zr=["disabled","onClick"],Hr={class:"flex items-center gap-2 flex-shrink-0"},Ur=["disabled","title"],Jr={class:"hidden lg:inline"},Wr=["title","aria-label"],jr={class:"hidden lg:inline"},Gr=ni({__name:"AiSearchStrip",setup(p){const l=_s(),{toast:_}=ys(),x=h(null),L=h(!1),E=v(()=>l.tenantScope.value),G=v(()=>{var S;return((S=E.value)==null?void 0:S.tenantName)||"tenant"}),ve=v(()=>{var S;return(S=E.value)!=null&&S.tenantName?`Site search for ${E.value.tenantName}`:"Site search"}),_e=v(()=>Er(l.store.messages)),we=v(()=>{if(l.thinking.value)return"Searchingâ¦";if(l.removingChipId.value)return"Updatingâ¦";const S=Number(l.store.resultCount||0);return Fr(S,_e.value)}),ge=v(()=>(l.store.results||[]).filter(S=>!!(S!=null&&S.lease_signal_kind)).length),z=v(()=>(l.rankingRows.value??[]).length>0),Q=v(()=>l.store.hiddenResults||[]),ae=h(!1),le=h(null),Ve=h({});function ue(){var M;if(ae.value){ae.value=!1;return}const S=(M=le.value)==null?void 0:M.getBoundingClientRect();S&&(Ve.value={position:"fixed",top:`${Math.round(S.bottom+6)}px`,left:`${Math.round(Math.max(8,Math.min(S.left,window.innerWidth-296)))}px`,zIndex:1300}),ae.value=!0}async function xe(S){try{await l.restoreResult({saved_avail_id:S==null?void 0:S.saved_avail_id})}catch{_({title:"Could not restore the result",description:l.store.error||"Please try again.",variant:"destructive"})}Q.value.length||(ae.value=!1)}const de=v(()=>{const S=l.store.searchDescription;return typeof S=="string"&&S.trim()?S.trim().slice(0,80):"AI Site Search"});function Oe(){L.value=!0}async function n(){const S=E.value;if(!S)return;const M=new FormData;M.append("tenant_id",String(S.tenantId)),S.tenantReqId&&M.append("tenant_req_id",String(S.tenantReqId)),S.crmRevision&&M.append("crm_revision",String(S.crmRevision));try{await l.finalize(M)}catch{Ae();return}_({title:S.tenantReqId?"Site search updated":`Saved to ${G.value}`,description:"Matches will keep updating in the workspace."}),ke()}function fe(){ke()}function ke(){var M;const S=((M=E.value)==null?void 0:M.returnUrl)||"/tenants";l.exit(),l.tenantScope.value=null,Oo.visit(S)}function Fe(S,M){var I,T,D;const Y=Array.isArray(M==null?void 0:M.tenantNames)&&M.tenantNames.length>0?M.tenantNames:Array.isArray(S==null?void 0:S.targets)?S.targets.map(B=>B==null?void 0:B.tenant_name).filter(Boolean):[],Te=Number((S==null?void 0:S.tenant_count)||Y.length||0),at=(M==null?void 0:M.tenantName)||((T=(I=S==null?void 0:S.tenant_req)==null?void 0:I.tenant)==null?void 0:T.name)||((D=S==null?void 0:S.tenant_req)==null?void 0:D.tenant_name)||null;_({title:Te>1?`Saved to ${Te} tenants`:at?`Saved to ${at}`:"Saved to tenant",description:Te>1?"The site search is now in each tenant workspace, where matches will keep updating.":"Find it in My Tenants â matches will keep updating in the workspace."}),l.exit()}function Ae(){_({title:"Could not save the search",description:l.store.error||"Please try again.",variant:"destructive"})}return(S,M)=>(m(),A(ye,null,[f(l).active.value?(m(),A("div",{key:0,ref_key:"stripRef",ref:x,class:"contents"},[g("div",Tr,[g("button",{type:"button",class:"inline-flex items-center gap-1 text-[10.5px] font-bold uppercase tracking-wider text-purple-600 dark:text-purple-400 hover:text-purple-800 dark:hover:text-purple-300 transition-colors flex-shrink-0 truncate max-w-[40vw]",title:"AI search is active â click to open the conversation (the search bar is the chat)",onClick:M[0]||(M[0]=Y=>f(l).popoverOpen.value=!0)},[V(f(Vo),{class:"w-3 h-3 flex-shrink-0"}),g("span",Lr,J(ve.value),1)]),g("span",Br,[f(l).thinking.value||f(l).removingChipId.value?(m(),A("span",$r)):P("",!0),M[6]||(M[6]=g("span",{class:"relative inline-flex rounded-full h-2 w-2 bg-purple-500"},null,-1))]),g("span",Dr,J(we.value),1),ge.value>
20&&!f(l).thinking.value?(m(),A("button",{key:0,type:"button",class:"text-[11.5px] text-gray-400 dark:text-gray-500 flex-shrink-0 tabular-nums rounded px-0.5 hover:text-gray-700 dark:hover:text-gray-200 hover:underline decoration-dotted underline-offset-2 transition-colors",title:"Removed from their source or flagged as possibly leased â shown last. Click to jump there.",onClick:M[1]||(M[1]=Y=>f(l).setAsideJump.value++)},"· "+J(ge.value)+" set aside",1)):P("",!0),f(l).thinking.value?P("",!0):(m(),O(er,{key:1,compact:"","graded-active":z.value,class:"flex-shrink-0"},null,8,["graded-active"])),Q.value.length?(m(),A("div",Nr,[g("button",{ref_key:"hiddenBtn",ref:le,type:"button",class:"inline-flex items-center gap-1 h-6 rounded-full border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800 px-2 text-[11.5px] font-medium text-gray-500 dark:text-gray-300 hover:border-purple-300 hover:text-purple-700 transition-colors tabular-nums",title:`${Q.value.length} hidden â click to restore`,onClick:ue},[V(f(or),{class:"w-3 h-3"}),Se(" "+J(Q.value.length)+" hidden ",1)],8,Vr),(m(),O(ps,{to:"body"},[ae.value?(m(),A("div",{key:0,class:"fixed inset-0 z-[1299]",onClick:M[2]||(M[2]=Y=>ae.value=!1)})):P("",!0),ae.value?(m(),A("div",{key:1,style:Nt(Ve.value),class:"rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-900 shadow-lg p-1.5 w-72",role:"menu"},[M[8]||(M[8]=g("div",{class:"px-2 pt-1.5 pb-1 text-[11px] text-gray-400"},"Hidden from this search",-1)),(m(!0),A(ye,null,pt(Q.value,Y=>(m(),A("div",{key:Y.saved_avail_id,class:"flex items-center gap-2 min-h-[34px] px-2 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800"},[g("span",{class:"flex-1 min-w-0 truncate text-[12.5px] text-gray-800 dark:text-gray-100",title:Y.address||""},J(Y.address||`#${Y.saved_avail_id}`),9,Or),g("button",{type:"button",class:"inline-flex items-center gap-1 text-[11px] font-semibold text-purple-600 hover:text-purple-800 dark:text-purple-300",disabled:f(l).store.isSubmittingFeedback,onClick:Te=>xe(Y)},[V(f(ur),{class:"w-3 h-3"}),M[7]||(M[7]=Se(" Restore ",-1))],8,zr)]))),128))],4)):P("",!0)]))])):P("",!0)]),g("div",Hr,[g("button",{type:"button",class:"inline-flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium text-white bg-gradient-to-r from-emerald-500 to-green-600 hover:from-emerald-600 hover:to-green-700 shadow-lg shadow-emerald-500/25 hover:shadow-emerald-500/40 transform hover:scale-105 transition-all duration-200 active:scale-95 disabled:opacity-50 disabled:hover:scale-100 whitespace-nowrap",disabled:_e.value||!f(l).store.resultCount||f(l).thinking.value||f(l).store.isFinalizing,title:E.value?`Save this search to ${G.value}'s workspace`:"Save this search to a tenant",onClick:M[3]||(M[3]=Y=>E.value?n():Oe())},[f(l).store.isFinalizing?(m(),O(f(_a),{key:0,class:"w-4 h-4 animate-spin"})):(m(),O(f(rr),{key:1,class:"w-4 h-4"})),g("span",Jr,J(E.value?`Save to ${G.value}`:"Save to Tenant"),1)],8,Ur),g("button",{type:"button",class:"inline-flex items-center gap-2 px-4 py-2.5 rounded-xl text-sm font-medium bg-gray-100 hover:bg-red-50 dark:bg-card dark:hover:bg-red-900/20 text-gray-700 dark:text-foreground hover:text-red-600 dark:hover:text-red-400 border border-gray-200 dark:border-border hover:border-red-300 transition-all duration-200 hover:scale-105 active:scale-95 whitespace-nowrap",title:E.value?"Back to the workspace â the search stays resumable from its pill":"End the AI search and return to browsing","aria-label":E.value?"Back to workspace":"End AI search",onClick:M[4]||(M[4]=Y=>E.value?fe():f(l).exit())},[E.value?(m(),O(f(lr),{key:0,class:"w-4 h-4"})):(m(),O(f(ii),{key:1,class:"w-4 h-4"})),g("span",jr,J(E.value?"Back to workspace":"End search"),1)],8,Wr)])],512)):P("",!0),V(tr,{open:L.value,"onUpdate:open":M[5]||(M[5]=Y=>L.value=Y),"default-requirement-name":de.value,onFinalized:Fe,onError:Ae},null,8,["open","default-requirement-name"])],64))}});function si(p,l){if((p.receipt_kind??p.receiptKind)==="numeric_preference"){const _=l==null?void 0:l.credit;return typeof _!="number"||!Number.isFinite(_)?"unknown":_>=1?"confirmed":"not_confirmed"}return l==="verified"||l==="claimed"?"confirmed":l==="refuted"||l==="unchecked"?"n
2ot_confirmed":"unknown"}const Qr={key:0},Yr=["aria-label"],Xr={class:"truncate text-[10.5px] font-semibold tabular-nums text-violet-700 dark:text-violet-200"},Kr={class:"truncate tabular-nums"},Zr={key:0,class:"flex-1"},qr={key:1,class:"rounded-full bg-violet-100 dark:bg-violet-500/25 px-1.5 text-[10px] font-bold tabular-nums text-violet-700 dark:text-violet-200"},el={class:"min-h-0 overflow-hidden"},tl={key:0,class:"mb-1 px-1.5 text-[10px] italic leading-snug text-gray-400 dark:text-gray-500"},al={class:"space-y-0.5"},il=["title","onClick"],sl={class:"min-w-0 flex-1"},nl={key:0,class:"ml-5 mr-1 mb-1"},ol={key:0,class:"flex items-center gap-1.5 py-1 text-[10.5px] text-gray-400"},rl=["innerHTML"],ll={key:1,class:"text-[9.5px] italic text-gray-400 dark:text-gray-500"},ul={key:2,class:"py-1 text-[10.5px] text-gray-400"},ms=288,dl=240,ma=10,cl=ni({__name:"PreferenceFitBadge",props:{rows:{},payload:{},fetchReceipts:{type:Function}},setup(p){const l=p,_=h(!1),x=h(!1),L=h(null),E=h(null),G=h(!1),ve=h(null),_e=h({});let we=null,ge=0;function z(){var B;const I=(B=ve.value)==null?void 0:B.getBoundingClientRect();if(!I)return;if(!x.value){_e.value={top:`${Math.round(I.top)}px`,left:`${Math.round(I.left)}px`,width:`${Math.round(I.width)}px`};return}const T=Math.min(Math.max(8,I.left),window.innerWidth-ms-8),D=Math.min(I.bottom+6,window.innerHeight-120);_e.value={top:`${Math.round(D)}px`,left:`${Math.round(T)}px`,width:`${ms}px`}}function Q(){we&&(clearTimeout(we),we=null)}function ae(I,T){var B,ze;const D=[(B=ve.value)==null?void 0:B.getBoundingClientRect(),(ze=document.querySelector("[data-fit-overlay]"))==null?void 0:ze.getBoundingClientRect()].filter(Boolean);return D.length?I>=Math.min(...D.map(me=>me.left))-ma&&I<=Math.max(...D.map(me=>me.right))+ma&&T>=Math.min(...D.map(me=>me.top))-ma&&T<=Math.max(...D.map(me=>me.bottom))+ma:!1}function le(I){_.value&&(ae(I.clientX,I.clientY)?Q():xe())}async function Ve(){if(Q(),_.value)return;_.value=!0,x.value=!1,await q(),z(),ge+=1;const I=ge,T=()=>{ge!==I||!_.value||(x.value=!0,z())};requestAnimationFrame(()=>requestAnimationFrame(T)),setTimeout(T,120),window.addEventListener("mousemove",le,{passive:!0})}function ue(){Q(),window.removeEventListener("mousemove",le),ge+=1,_.value=!1,x.value=!1,L.value=null,E.value=null}function xe(){Q(),we=setTimeout(ue,dl)}function de(){_.value?ue():Ve()}function Oe(){_.value&&ue()}function n(I){I.key==="Escape"&&_.value&&ue()}function fe(I){var D,B;if(!_.value)return;const T=I.target;T&&((D=ve.value)!=null&&D.contains(T)||(B=document.querySelector("[data-fit-overlay]"))!=null&&B.contains(T))||ue()}bs(()=>{window.addEventListener("scroll",Oe,!0),window.addEventListener("resize",Oe),window.addEventListener("keydown",n),window.addEventListener("pointerdown",fe,!0)}),Co(()=>{Q(),window.removeEventListener("mousemove",le),window.removeEventListener("scroll",Oe,!0),window.removeEventListener("resize",Oe),window.removeEventListener("keydown",n),window.removeEventListener("pointerdown",fe,!0)});const ke=v(()=>{var I;return((I=l.payload)==null?void 0:I.checks)??{}});function Fe(I){return si(I,ke.value[I.key])==="confirmed"}const Ae=v(()=>l.rows.filter(Fe)),S=v(()=>Ae.value.length>0),M=v(()=>{var I;return l.rows.length===1?((I=l.rows[0])==null?void 0:I.label)??"":`${Ae.value.length}/${l.rows.length} fit`});function Y(I){var D;const T=ke.value[I.key];if(I.receipt_kind==="numeric_preference"){const B=si(I,T);return B==="confirmed"?"Within your preference â from listing data":B==="not_confirmed"?"Outside your preference â still eligible":"Listing value unknown"}switch(T){case"verified":return I.receipt_kind==="flyer_snippet"?"Verified on the flyer":"From the listingâs own data";case"claimed":return"Mentioned in the flyer";case"refuted":return I.receipt_kind==="flyer_snippet"?"Flyer text matched, but the pages donât back it up":"The listingâs own data says otherwise";case"unchecked":return"Not found";default:return(D=l.payload)!=null&&D.no_flyer?"No flyer on file to read":"Unknown here"}}const Te=v(()=>`Preferences this listing confirms: ${Ae.value.length} of ${l.rows.length}`);async function at(I){var B;if(I.receipt_kind==="numeric_preference")return;if(L.value===I.key){L.value=null,E.value=null;return}L.value=I.key,E.value=null;const T=ke.value[I.key];if(I.receipt_kind!=="flyer_snippet"||!["verified","claimed","refuted"].includes(T))return;const D=(B=l.payload)==null?void 0:B.hash;if(D){G.value=!0;try{E.value=await l.fetchReceipts(I.key,D)}finally{G.value=!1}}}return(I,T)=>{var D;return S.value?(m(),A("div",Qr,[g("button",{ref_key:"badgeBtn",ref:ve,type:"button",class:"pointer-events-auto inline-flex max-w-[160px] items-center gap-1 rounded-full border border-violet-200 dark:border-violet-700/50 bg-vi
2olet-50/95 dark:bg-violet-900/40 px-2 py-0.5 shadow-sm transition-colors hover:border-violet-400 dark:hover:border-violet-500","aria-label":Te.value,"data-testid":"preference-fit-badge",onMouseenter:Ve,onFocus:Ve,onClick:Vt(de,["stop"])},[V(f(ti),{class:"h-3 w-3 flex-shrink-0 text-violet-600 dark:text-violet-300","stroke-width":"3"}),g("span",Xr,J(M.value),1)],40,Yr),(m(),O(ps,{to:"body"},[_.value?(m(),A("div",{key:0,"data-fit-overlay":"",style:Nt(_e.value),class:K(["fixed z-[1300] overflow-hidden border backdrop-blur-xl transition-[top,left,width,border-radius,background-color,box-shadow,border-color] duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)]",x.value?"rounded-xl border-violet-200/80 dark:border-violet-700/40 bg-white/95 dark:bg-gray-900/95 shadow-2xl shadow-violet-500/10":"rounded-full border-violet-200 dark:border-violet-700/50 bg-violet-50/95 dark:bg-violet-900/40 shadow-sm"]),onClick:T[0]||(T[0]=Vt(()=>{},["stop"]))},[g("div",{class:K(["flex items-center gap-1 whitespace-nowrap font-semibold transition-all duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)]",x.value?"px-3 pt-2.5 pb-1 text-xs text-violet-800 dark:text-violet-200":"px-2 py-0.5 text-[10.5px] text-violet-700 dark:text-violet-200"])},[V(f(ti),{class:"h-3 w-3 flex-shrink-0 text-violet-600 dark:text-violet-300","stroke-width":"3"}),g("span",Kr,J(x.value?"Preferences":M.value),1),x.value?(m(),A("span",Zr)):P("",!0),x.value?(m(),A("span",qr,J(Ae.value.length)+"/"+J(p.rows.length),1)):P("",!0)],2),g("div",{class:K(["grid transition-[grid-template-rows] duration-[450ms] ease-[cubic-bezier(0.32,0.72,0,1)]",x.value?"grid-rows-[1fr]":"grid-rows-[0fr]"])},[g("div",el,[g("div",{class:K(["px-2.5 pb-2.5 pt-0.5 transition-all duration-300",x.value?"opacity-100 translate-y-0 delay-100":"opacity-0 translate-y-1"])},[(D=p.payload)!=null&&D.no_flyer?(m(),A("p",tl,"No flyer on file â only what the listingâs own data can confirm is checked.")):P("",!0),g("div",al,[(m(!0),A(ye,null,pt(p.rows,B=>(m(),A("div",{key:B.key},[g("button",{type:"button",class:"flex w-full items-start gap-2 rounded-md px-1.5 py-1 text-left transition-colors hover:bg-violet-50 dark:hover:bg-violet-500/10",title:Y(B),onClick:Vt(ze=>at(B),["stop"])},[Fe(B)?(m(),O(f(ti),{key:0,class:"mt-0.5 h-3 w-3 flex-shrink-0 text-violet-600 dark:text-violet-300","stroke-width":"3"})):(m(),O(f(cr),{key:1,class:"mt-0.5 h-3 w-3 flex-shrink-0 text-gray-300 dark:text-gray-600"})),g("span",sl,[g("span",{class:K(["block text-[11.5px] leading-snug",Fe(B)?"text-gray-800 dark:text-gray-100":"text-gray-400 dark:text-gray-500"])},J(B.label),3),g("span",{class:K(["block text-[10px]",Fe(B)?"text-violet-600 dark:text-violet-300":"text-gray-400 dark:text-gray-500"])},J(Y(B)),3)])],8,il),L.value===B.key?(m(),A("div",nl,[G.value?(m(),A("div",ol,[V(f(_a),{class:"h-3 w-3 animate-spin"}),T[1]||(T[1]=Se(" Reading the flyer⦠",-1))])):E.value?(m(),A(ye,{key:1},[E.value.verification?(m(),A("div",{key:0,class:K(["mb-1 rounded-md px-2 py-1 text-[10.5px]",E.value.verification.verdict==="yes"?"bg-emerald-50 dark:bg-emerald-900/25 text-emerald-700 dark:text-emerald-300":E.value.verification.verdict==="no"?"bg-gray-100 dark:bg-gray-700/60 text-gray-500 dark:text-gray-400":"bg-amber-50 dark:bg-amber-900/25 text-amber-700 dark:text-amber-300"])},J(E.value.verification.evidence||E.value.verification.verdict),3)):P("",!0),(m(!0),A(ye,null,pt((E.value.snippets||[]).slice(0,2),(ze,me)=>(m(),A("div",{key:me,class:"rubric-snippet mb-1 rounded-md bg-gray-50 dark:bg-gray-900/50 px-2 py-1 text-[10.5px] leading-snug text-gray-600 dark:text-gray-300",innerHTML:ze.snippet},null,8,rl))),128)),!E.value.verification&&(E.value.snippets||[]).length?(m(),A("p",ll,"phrase match in the flyer text â not yet page-verified")):P("",!0)],64)):(m(),A("p",ul,"No receipt available."))])):P("",!0)]))),128))])],2)])],2)],6)):P("",!0)]))])):P("",!0)}}}),vl=ws(cl,[["__scopeId","data-v-00e565c3"]]),gl={id:"app-content",class:"pt-3 pb-2 transition duration-300"},fl={class:"container"},ml={class:"mb-3 flex gap-6 min-h-[33px]"},hl={class:"w-2/6 flex items-center justify-center gap-2"},pl=["aria-pressed","title"],bl={key:0,class:"absolute -right-0.5 -top-0.5 h-2.5 w-2.5 rounded-full bg-blue-500 ring-2 ring-gray-50 dark:ring-gray-900",title:"Filtering to the visible map area"},yl=["aria-pressed","title"],_l={key:0,class:"ml-0.5 inline-flex h-4 min-w-4 items-center justify-center rounded-full bg-emerald-500 px-1 text-[10px] font-black text-white"},wl={key:0,class:"flex h-[32px] items-center gap-1 rounded-full border border-blue-200 bg-blue-50 pl-2.5 pr-1 text-xs font-semibold text-blue-600 dar
2k:border-blue-700/50 dark:bg-blue-900/30 dark:text-blue-300 flex-shrink-0"},kl={class:"flex gap-6"},Sl={key:0,class:"mb-3 flex items-center justify-between gap-3 rounded-xl border border-amber-300 bg-amber-50 px-4 py-2.5 text-sm text-amber-800 dark:border-amber-700/50 dark:bg-amber-900/30 dark:text-amber-200"},xl={class:"flex items-center gap-2 min-w-0"},Al=["disabled"],Il={key:0,class:"browse-refresh-status",role:"status","aria-live":"polite"},Ml={key:1,class:"responsive-card-grid",style:{padding:"0"}},Cl={key:0,class:"set-aside-divider","data-testid":"set-aside-divider",role:"separator","aria-label":"Set aside"},Rl={class:"set-aside-divider__label"},Pl={key:1,class:"grid-filler","aria-hidden":"true"},El=["data-req-id","onMouseenter","onMouseleave"],Fl=["title","onClick"],Tl=["onClick"],Ll={class:"absolute top-2 left-2 z-10 flex items-center gap-1.5"},Bl={key:3,class:"browse-empty-state"},$l={class:"browse-empty-title"},Dl={class:"browse-empty-copy"},Nl={key:1,class:"pagination-bar"},Vl={key:0,class:"absolute bottom-3 left-1/2 -translate-x-1/2 z-20 flex items-center gap-1.5 rounded-full bg-white/90 dark:bg-gray-900/90 border border-gray-200 dark:border-gray-700 px-3 py-1.5 text-[11px] font-semibold text-gray-600 dark:text-gray-300 shadow-md backdrop-blur-sm pointer-events-none"},Ol={class:"group relative"},zl={key:4,class:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-[1000]"},Hl={class:"bg-white dark:bg-card p-8 rounded-xl shadow-xl w-[500px] max-w-[90vw]"},Ul={class:"mb-6"},Jl={class:"text-xl font-semibold text-gray-900 dark:text-foreground mb-2"},Wl={class:"text-sm text-gray-600 dark:text-muted-foreground"},jl={class:"flex justify-end gap-3"},Gl=300,Ql=180,Yl=260,ha=16,hs=3,pa=36,Xl=40,Kl=5,Zl=1e4,ql=1200*60*1e3,eu=12,tu=1,au=120*1e3,tt="savedavails_active_jobs",ba="savedavails_progress_state",ya="savedavails_job_timestamps",ai="savedavails_job_filenames",iu=2,su=ni({__name:"SavedAvails",props:{aiScope:{default:null}},setup(p){const l=Pe(()=>Ee(()=>import("./LandlordFormWizard-SaPQvMkH.js").then(e=>e.a),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54]))),_=Pe(()=>Ee(()=>import("./CreatePropertyModal-Dw8Hk7e_.js"),__vite__mapDeps([55,1,2,3,4,56]))),x=Pe(()=>Ee(()=>import("./MapWithPolygonDrawing-CkcKOJwO.js"),__vite__mapDeps([57,1,58,10,2,3,4,59,8,9,60,61,11,62,39,6,63,64,52,65,27,38,66,48,67,68,51,69,70,71,72,73,74,75,28,76]))),L=Pe(()=>Ee(()=>import("./SavedAvailCriteriaFilterPanel-CBULZBOD.js"),__vite__mapDeps([77,1,20,2,3,4,6,21,78,79,10,11,62,80,15,81,82,14,83,84,33,85,86,17,13,18,87,35,88,89,90,91]))),E=Pe(()=>Ee(()=>import("./FlyerImportPanel-CGNkv4SR.js"),__vite__mapDeps([92,1,2,3,4,56,93,94,95,28,96,97,98,99,100,101,102,38,6,103]))),G=Pe(()=>Ee(()=>import("./AiTenantSearch-B5Qy4dAo.js"),__vite__mapDeps([104,1,105,106,2,3,4,68,51,6,69,70,71,72,107,108,19,13,14,17,18,15,20,21,22,42,43,28,44,109,110,111,12,10,16,112,113,114,40,41,23,24,45,46,47,48,49,75,99,115,116,26,97,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,65,132,133,134,135,136,137,138,139,140,141,142,67,143,144,145,146,147,148,149,38,27,150,151,152,153,102,154,89,155,156,157,158,159,160,101,161,162,163,164,165,166,167,25,29,30,31,168,169,170,74,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,66,190,191,192,193,73,194,195,196,36,197,198,87,199,100,200,201,202,203,98,204,205,206,207,208,80,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,62,224,225,226,227,228,229,230,231,232,233,35,37,88,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,39,250,251,34,252,253,254,255,256,257,258,259,90,260,94,95,96,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,0,5,7,8,9,11,32,33,50,52,53,54,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,93,313,57,58,59,60,61,63,64,76,314,315,316,317,92,56,103,318,319,320,321,322,323,324,325,326,327,328,329,330,331,332,333,334,335,336,337,338,339,340]))),ve=Pe(()=>Ee(()=>import("./MoveToTenantModal-DVWN75Xx.js"),__vite__mapDeps([341,306,1,2,3,4,51]))),_e=Pe(()=>Ee(()=>import("./LandlordReqDetails-G2IBQgdw.js").then(e=>e.b),__vite__mapDeps([107,1,108,2,3,4,68,51,6,69,70,71,72,19,13,14,17,18,15,20,21,22,42,43,28,44,109,110,111,12,10,16,112,113,114,40,41,23,24,45,46,47,48,49,75,99,115,116,26,97,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,65,132,133,134,135,136,137,138,139,140,141,142,67,143,144,145,146,147,148,149,38,27,150,151,152,153,102,154,89,155,156,157,158,159,160,101,161,162,163,164,165,166,167,25,29,30,31,168,169,170,74,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,66,190,191,192,193,73,194,195,196,36,197,198,87,199,100,200,201,202,203,98,204,205,206,207,208,80,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,62,224,225,226,227,228,229,230,231,232,233,35,37,88,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,39,250,251,34,252,253,254,255,256,257,258,259,90,260,94,95,96,261,262,263,264,265,266,267,268,269,270,271,106,272,273,274,275,276,277,278,279,28
20,281,282,283,284,285,286,287,0,5,7,8,9,11,32,33,50,52,53,54,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,93,313,57,58,59,60,61,63,64,76,314,315,316,317,92,56,103,318,319,320,321,322,323,324,325,326,327,328]))),we=Pe(()=>Ee(()=>import("./AddToTourbookModal-Bfu5wkL3.js"),__vite__mapDeps([342,307,1,2,3,4,308,6,309,50,51,52]))),ge=Pe(()=>Ee(()=>import("./LandlordReqDetails-G2IBQgdw.js").then(e=>e.c),__vite__mapDeps([107,1,108,2,3,4,68,51,6,69,70,71,72,19,13,14,17,18,15,20,21,22,42,43,28,44,109,110,111,12,10,16,112,113,114,40,41,23,24,45,46,47,48,49,75,99,115,116,26,97,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,65,132,133,134,135,136,137,138,139,140,141,142,67,143,144,145,146,147,148,149,38,27,150,151,152,153,102,154,89,155,156,157,158,159,160,101,161,162,163,164,165,166,167,25,29,30,31,168,169,170,74,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,66,190,191,192,193,73,194,195,196,36,197,198,87,199,100,200,201,202,203,98,204,205,206,207,208,80,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,62,224,225,226,227,228,229,230,231,232,233,35,37,88,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,39,250,251,34,252,253,254,255,256,257,258,259,90,260,94,95,96,261,262,263,264,265,266,267,268,269,270,271,106,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,0,5,7,8,9,11,32,33,50,52,53,54,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,93,313,57,58,59,60,61,63,64,76,314,315,316,317,92,56,103,318,319,320,321,322,323,324,325,326,327,328]))),{toast:z}=ys(),{liteMode:Q,openLiteUpgrade:ae}=Ko(),le={address:1,neighborhood:1,prohibited_uses:6,nyc_subway_station_ids:1,subway_radius:1,time_on_market_at_upload:1,time_on_market:1,images:1,frontage:2,frontage_length:2,has_outdoor_space:2,outdoor_space:2,outdoor_space_sf:2,outdoor_sf:2,has_sidewalk_seating:2,sidewalk_seating:2,is_outdoor:2,ampage:2,is_corner_location:2,total_usable_space:2,floors:2,floor_levels:2,asking_rent:3,asking_rent_psf:3,rent_per_annum:3,asking_key_money_amount:3,asking_key_money:3,asking_key_money_psf:3,lease_out:3,offers_out:3,deal_lands_at:3,previous_current_tenant:4,previous_tenant:4,current_tenant:4,possession:4,possession_type:4,possession_time_from_signing:4,possession_time_unit:4,possession_date:4,lease_type:4,lease_type_category:4,lease_structure:4,currently_occupied_lease_expiry:4,occupancy_status:4,ventilation:5,ventilation_status:5,ventilation_type:5,liquor_license:5,liquor_license_time:5,gas:5,hvac:5,showers_in_place:5,ada_bathrooms:5,property_highlights:6,associated_users:6,brokerage_name:6,broker_contacts:6,landlord_name:6};function Ve(e){if(!e)return 1;if(e.startsWith("floors")||e.startsWith("floor_levels"))return le.floors;if(!le[e]){if(e.startsWith("possession")||e.startsWith("lease"))return 4;if(e.startsWith("asking_rent")||e.includes("rent"))return 3;if(e.startsWith("ventilation")||e.startsWith("hvac")||e.startsWith("gas")||e.startsWith("liquor"))return 5;if(e.startsWith("broker")||e.startsWith("brokerage")||e.startsWith("property_highlights")||e.startsWith("associated_users")||e.startsWith("landlord")||e.startsWith("prohibited_uses"))return 6}return le[e]||1}const ue=h(null),xe=h(1),de=h(0),Oe=h([{title:"Saved Availabilities",href:"/saved-availabilities"}]),n=Qo(),fe=zo(),ke=Xo();Yo();const{activeMarketSlug:Fe,availableMarkets:Ae,marketMapCenter:S,marketMapZoom:M}=No();{const e=new Set((Ae.value||[]).map(a=>a.slug)),t=n.activeMarketSlug;(!t||!e.has(t))&&n.setActiveMarketSlug(Fe.value)}oe(Fe,e=>{n.setActiveMarketSlug(e)}),oe(()=>n.activeMarketSlug,(e,t)=>{var o,u;if(!e||!t||e===t)return;const a=(Ae.value||[]).find(s=>s.slug===e),i=(u=(o=T.value)==null?void 0:o.mapboxMapRef)==null?void 0:u.map;!(a!=null&&a.map_center)||!(i!=null&&i.flyTo)||i.flyTo({center:a.map_center,zoom:Number(a.map_zoom||a.default_zoom||11),essential:!0})});const{hasActivePolygons:Y,activeSavedAreaIds:Te,getAllActivePolygonCoordinates:at,deactivateAllPolygons:I}=$o(),T=h(null);n.ensureFilterDefaults();const D=h(localStorage.getItem("theme")||"light"),B=e=>{e.key==="theme"&&(D.value=e.newValue)};window.addEventListener("storage",B);const ze=v(()=>n.currentScope),me=v({get:()=>n.currentSort,set:e=>{n.setSort(e),Z(!0,{includeMarkers:!1})}}),ri=v({get:()=>n.prioritizePendingChanges,set:e=>{n.setPrioritizePendingChanges(e),Z(!0,{includeMarkers:!1})}}),li=v({get:()=>n.completeFirst,set:e=>{n.$patch({completeFirst:!!e}),Z(!0,{includeMarkers:!1})}}),ui=v({get:()=>n.removedLast,set:e=>{n.$patch({removedLast:!!e}),Z(!0,{includeMarkers:!1})}}),wa=v({get:()=>n.criteriaFilters,set:e=>{n.setCriteriaFilters(e),bt()}}),di=v(()=>n.activeCriteriaFilterCount);function ks(e){if(typeof e!="string")return e;try{return JSON.parse(e)}catch{return null}}function Ss(e){if(!Array.isArray(e)||e.length<2)return null;const t=Number(e[0]),a=Number(e[1]);return!Number.isFinite(t)||!Number.isFinite(a)?null:[t,a]}function xs(e){if(e.length===0)return e;const t=e[0],a=e[e.length-1];return t[0]===a[0]&&t[1]===a[1]?e:[...e,[t[0],t[1]]]}function ka(e){return Array.isArray(e)?e.map(t=>Array.isArray(t)?xs(t.map(Ss).filter(a=>!!a)):[]).filter(t=>t.length>=4):[]}function Ot(e){const t=ks(e);if(!t)return[];if(Array.isArray(t))return t.flatMap(a=>Ot(a));if(t.type==="Feature")return Ot(t.geometry);if(t.type==="FeatureCollection"&&Array.isArray(t.features))return t.features.flatMap(a=>Ot(a));if(t.type==="Polygon"){const a=ka(t.coordinates);return a.length>0?[a]:[]}if(t.type==="MultiPolygon"&&Array.isArray(t.coordinates))return t.coordinates.map(a=>ka(a)).filter(a=>a.length>0);if(Array.isArray(t.coordinates)){const a=ka(t.coordinates);return a.length>0?[a]:[]}return[]}const Sa=v(()=>{var e;return Ot((e=wa.value)==null?void 0:e.geo_polygon).map((t,a)=>({id:`criteria-area-${a}`,latLngs:t,options:{color:"#059669",fillColor:"#10b981",fillOpacity:.18,weight:3}}))}),As=v(()=>Sa.value.length>0),Is=v(()=>{let e=1/0,t=1/0,a=-1/0,i=-1/0;return Sa.value.forEach(o=>
2{o.latLngs.forEach(u=>{u.forEach(([s,d])=>{e=Math.min(e,s),t=Math.min(t,d),a=Math.max(a,s),i=Math.max(i,d)})})}),[e,t,a,i].every(Number.isFinite)?{west:e,south:t,east:a,north:i}:null});function ci(e=0){q(()=>{requestAnimationFrame(()=>{var i,o;const t=(i=T.value)==null?void 0:i.mapboxMapRef,a=Is.value;if(t!=null&&t.layersInitialized&&((o=t==null?void 0:t.map)!=null&&o.fitBounds)&&a){t.map.fitBounds([[a.west,a.south],[a.east,a.north]],{padding:48,maxZoom:15,duration:600});return}e<12&&setTimeout(()=>ci(e+1),100)})})}let Le=null,zt=0;const it=h(!1);function bt(){Le&&clearTimeout(Le);const e=++zt;it.value=!0,Le=setTimeout(async()=>{try{await Z(!0)}finally{e===zt&&(it.value=!1)}},Gl)}async function Ms(e){Le&&(clearTimeout(Le),Le=null);const t=e||"";n.searchQuery!==t&&n.setSearchQuery(t);const a=++zt;it.value=!0;try{await Z(!0)}finally{a===zt&&(it.value=!1)}}function Cs(e){r.debug("[SavedAvails] Polygon created",{name:e.name}),fi()}function vi(){const e=at();if(!e.length)return null;let t=1/0,a=1/0,i=-1/0,o=-1/0;return e.forEach(u=>{u.forEach(([s,d])=>{t=Math.min(t,s),a=Math.min(a,d),i=Math.max(i,s),o=Math.max(o,d)})}),[t,a,i,o].every(Number.isFinite)?{west:t,south:a,east:i,north:o}:null}function gi(){const e=vi();e?n.setPolygonBounds(e):n.clearPolygonBounds(),n.setSavedAreaIds(Te.value)}oe(Te,e=>{const t=n.savedAreaIds||[];(e.length!==t.length||e.some((i,o)=>i!==t[o]))&&n.setSavedAreaIds(e)},{deep:!0});function fi(){const e=n.savedAreaIds.length>0;gi();const t=n.savedAreaIds.length>0;!e&&t&&se.value&&(se.value=!1,n.setMapBounds(null)),t&&Rs(),bt()}function Rs(){var a,i,o,u,s;const e=vi(),t=((i=(a=T.value)==null?void 0:a.mapboxMapRef)==null?void 0:i.map)??((s=(u=(o=T.value)==null?void 0:o.mapboxMapRef)==null?void 0:u.value)==null?void 0:s.map);if(!(!e||!t))try{t.fitBounds([[e.west,e.south],[e.east,e.north]],{padding:40,duration:600,maxZoom:15})}catch{}}function Ps(){I(),n.clearPolygonBounds(),n.clearSavedAreaIds(),bt()}const Be=h(new Set),Ht=h(new Set),xa=new Set,Es=v(()=>Ht.value.size>0),yt=h(!0),Fs=v(()=>(Mt.value>1?Mt.value:3)*6),ie=v(()=>n.filteredAvailabilities),_t=v(()=>n.isLoading||Es.value),Ts=v(()=>n.fetchError);function Ls(){Z(!0)}const Aa=v(()=>({currentPage:n.currentPage,perPage:n.perPage,total:n.total,lastPage:n.lastPage})),mi=p,He=Wo(),hi=v(()=>{var e,t;return!!((t=(e=He.props)==null?void 0:e.featureFlags)!=null&&t.saved_map_areas)}),$e=h(!1),b=h(null),Ut=h([]),Ia=h(null),W=h(!1),Ma=h(null),st=h(!1),Jt=h(null),De=v({get:()=>n.searchQuery,set:e=>{n.setSearchQuery(e),bt()}}),pi=v({get:()=>n.searchFields,set:e=>{n.setSearchFields(e),n.searchQuery&&bt()}}),k=_s(),Ie=v(()=>{var e,t;return!!((t=(e=He.props)==null?void 0:e.featureFlags)!=null&&t.embedded_ai_search)}),bi=v(()=>{var e,t;return!!((t=(e=He.props)==null?void 0:e.featureFlags)!=null&&t.address_search)});function yi(){return n.buildFilterParams()}const Bs=v(()=>{var e,t;return!!((t=(e=He.props)==null?void 0:e.featureFlags)!=null&&t.ai_search_flyer_semantic_filter)}),$s=v(()=>{var e,t;return!!((t=(e=He.props)==null?void 0:e.featureFlags)!=null&&t.checkable_facts)}),wt=ir();function Ds(e){wt.close(),q(()=>{var t,a;return(a=(t=St.value)==null?void 0:t.runQuery)==null?void 0:a.call(t,e)})}const Ns=v(()=>{var e,t;return!!((t=(e=He.props)==null?void 0:e.featureFlags)!=null&&t.unified_property_create)}),Ye=h(!1),Wt=h(null),Ue=h(null),kt=h(!1);function Vs(){Wt.value=null,Ue.value=null,kt.value=!1,jt.value=null,Ye.value=!0}function Ca(){Ye.value=!1,jt.value=null}function Os({role:e}={}){Ye.value=!1,kt.value=e==="listing",ts()}function zs({formData:e,meta:t,role:a,sourceText:i}){Ye.value=!1,b.value=null,Wt.value=e,Ue.value=t,_i.value=i||"",kt.value=a==="listing",$e.value=!0}const _i=h(""),jt=h(null);function Hs(e){var t,a,i;$e.value=!1,jt.value={text:_i.value,parseResult:{success:!0,form_data:e.formData,off_market:((t=Ue.value)==null?void 0:t.off_market)||{detected:!1},clarifications:[],validation_issues:((a=Ue.value)==null?void 0:a.validation_issues)||[],ai_filled_count:((i=Ue.value)==null?void 0:i.ai_filled_count)||0,existing:null},shareWithOrg:e.shareWithOrg,offMarket:e.offMarket},Ye.value=!0}function Us(e){var t;if(Ca(),e!=null&&e.id){const a=(t=re.value)==null?void 0:t.find(i=>i.id===e.id);a&&(b.value=a,W.value=!0)}}async function Js(e){var t;if(Ca(),await We(),e!=null&&e.id){const a=(t=re.value)==null?void 0:t.find(i=>i.id===e.id||i.saved_avail_id===e.id);a&&(b.value=a,W.value=!0)}}const F=v(()=>Ie.value&&k.active.value),Ws=v(()=>{var e;return((e=k.rubric)==null?void 0:e.value)??null}),wi=v(()=>[...k.rankingRows.value??[],...k.rankingContextRows.value??[]].map(e=>({key:e.key,label:e.label,receipt_kind:e.receiptKind}))),js=v(()=>F.value&&k.thinking.value&&(k.store.results||[]).length===0);let ki="";function Gs(e){try{return JSON.stringify((e||[]).map(t=>(t==null?void 0:t.coordinates)??(t==null?void 0:t.latLngs)??t))}catch{return""}}async function Qs(e){if(!F.value)return;const t=Gs(e);t!==ki&&(ki=t,await k.applyDrawnPolygons(Array.isArray(e)?e:[]))}const Ra=v(()=>F.value?Number(k.store.resultCount||0):Aa.value.total),Si=v(()=>F.value?!!k.store.resultsHasMore:!n.totalIsExact),St=h(null),Pa=h(null),Ys=v(()=>Pa.value),Gt=v(()=>it.value||!!n.isLoading),xi=v(()=>Ie.value&&Gt.value&&!yt.value&&!F.value),Xs=v(()=>{const e=De.value.trim();return e?`Searching "${e.length>34?`${e.slice(0,31)}...`:e}"...`:"Refreshing results..."}),Ks=v(()=>!F.value&&!Gt.value&&!yt.value&&re.value.length===0),Ea=v(()=>F.value&&!k.thinking.value&&!!k.store.zeroResult&&(k.store.results||[]).length===0),Zs=v(()=>yt.value||js.value||!F.value&&Gt.value&&re.value.length===0),qs=v(()=>{const e=De.value.trim();return e?`No results for "${e.length>46?`${e.slice(0,43)}...`:e}". Try a different search or remove filters.`:"Try adjusting the active filters."}),en=v(()=>{var e;return Ea.value?((e=k.store.zeroResult)==null?void 0:e.title)||"
2No matching spaces":"No matching availabilities"}),tn=v(()=>Ea.value?sr(k.store.zeroResult,{suggestions:k.suggestions.value,pending:nr(k.store.messages)}):qs.value),an=v(()=>{var e;return De.value?Number(((e=Aa.value)==null?void 0:e.total)??0):null}),sn=v(()=>{if(!Ie.value)return[];const e=new Set;for(const t of n.filteredAvailabilities||[])t!=null&&t.address&&e.add(String(t.address).toLowerCase()),t!=null&&t.neighborhood&&e.add(String(t.neighborhood).toLowerCase());return[...e]});async function nn(){var t,a,i,o;const e=mi.aiScope;if(e){if(k.tenantScope.value={tenantId:Number(e.tenant_id),tenantName:e.tenant_name||null,tenantReqId:e.tenant_req_id?Number(e.tenant_req_id):null,crmRevision:e.crm_revision||null,returnUrl:`/tenants/${Number(e.tenant_id)}`},e.session_id)try{await k.resumeSession(Number(e.session_id));return}catch{}if(e.query){(a=(t=St.value)==null?void 0:t.runQuery)==null||a.call(t,e.query);return}(o=(i=St.value)==null?void 0:i.focusInput)==null||o.call(i)}}function Ai(){var e,t;Ie.value?(t=(e=St.value)==null?void 0:e.focusInput)==null||t.call(e):na.value=!0}function Qt(e){const t=Number((e==null?void 0:e.saved_avail_id)??(e==null?void 0:e.id));return Number.isFinite(t)&&k.lockedIds.value.has(t)}oe(()=>k.store.results,async(e,t)=>{var u,s,d,c;if(!F.value)return;const a=Array.isArray(e)?e:[],i=Array.isArray(t)?t:[];!(i.length>0&&a.length>i.length&&String(((u=a[0])==null?void 0:u.id)??"")===String(((s=i[0])==null?void 0:s.id)??"")&&String(((d=a[i.length-1])==null?void 0:d.id)??"")===String(((c=i[i.length-1])==null?void 0:c.id)??""))&&X.value&&(X.value.scrollTop=0),await q(),ot(),qe()}),oe(()=>[F.value,k.thinking.value,k.removingChipId.value,k.store.resultCount,k.constraints.value,k.chips.value.length],()=>{F.value&&!k.thinking.value&&!k.removingChipId.value&&k.refreshImpact()},{immediate:!0}),oe(F,async e=>{e&&Me.value==="filter"&&(Me.value="map"),e||(await q(),ot(),qe())});const he=h(!1),H=h([]),Ne=h(null),Me=h("map"),Xe=v(()=>Me.value==="map"),xt=v(()=>Me.value==="filter"),Fa=v(()=>Me.value!==null),Ii=v(()=>Fa.value?Ql:Yl);function Ta(){Wa.value=Ja.value,ja.value=Li.value}oe(W,e=>{e&&Ta()});function on(){Xe.value?Me.value=null:(Ta(),Me.value="map")}function rn(){Ta(),Me.value="map"}function ln(){Me.value=xt.value?null:"filter"}oe(Me,()=>{q(()=>{Xa(),requestAnimationFrame(()=>{ot(),qe()})})}),oe([Xe,As],([e,t])=>{const a=se.value&&!!Ja.value;e&&t&&!a&&ci()});const X=h(null),Mi=h(null),nt=h(!1),La=v(()=>F.value?!!k.store.isLoadingMoreResults:nt.value),At=v(()=>F.value?!!k.store.resultsHasMore:n.currentPage<n.lastPage),It=v(()=>At.value&&!La.value),Ce=v(()=>{var e;return F.value&&((e=k.semanticFilter.value)==null?void 0:e.status)==="applied"}),Yt=_r(),Ba=()=>It.value&&(!F.value||!(k.store.isAgentResponding||k.store.isSearching||k.store.isSortChanging||k.store.isUndoing));oe(()=>{var e;return[(e=k.store.session)==null?void 0:e.id,k.store.resultContextVersion,Ce.value]},()=>Yt.reset(),{flush:"sync"});function $a(){if(!Ce.value)return;Yt.noteIntent(Ba());const e=X.value;e&&e.scrollHeight-e.scrollTop-e.clientHeight<300&&Ze("automatic")}function un(e){e.isTrusted&&e.deltaY>0&&$a()}let Xt=null;function dn(e){var t;Xt=((t=e.touches[0])==null?void 0:t.clientY)??null}function cn(e){var a;const t=((a=e.touches[0])==null?void 0:a.clientY)??null;e.isTrusted&&t!==null&&Xt!==null&&t<Xt&&$a(),Xt=t}function vn(e){var t;!e.isTrusted||e.repeat||(t=e.target)!=null&&t.closest('input, textarea, select, button, a, [contenteditable="true"]')||["ArrowDown","PageDown","End"," "].includes(e.key)&&$a()}function gn(e){e.isTrusted&&e.target===X.value&&Ce.value&&Yt.noteIntent(Ba())}const Ci=h(0),Ri=h(0),Mt=h(1),Kt=h(200);function Da(){return Kt.value+ha}function ot(){const e=X.value;if(!e)return;Ci.value=e.scrollTop||0,Ri.value=e.clientHeight||0,Mt.value=sa();const t=getComputedStyle(e).getPropertyValue("--card-row-height"),a=parseFloat(t);!Number.isNaN(a)&&a>0&&(Kt.value=a)}const rt=v(()=>{const e=Math.max(1,Mt.value||1),t=re.value||[],a=t.length,i=F.value?t.findIndex(R=>!!(R!=null&&R.lease_signal_kind)):-1,o=i>=0,u=o?i:a,s=o?a-i:0,d=Math.ceil(u/e),c=Math.ceil(s/e),w=d+(o?1:0)+c;return{cols:e,items:t,liveCount:u,tailCount:s,liveRows:d,tailRows:c,hasDivider:o,rows:w,dividerRow:o?d:-1}});function Na(e){const{hasDivider:t,dividerRow:a}=rt.value,i=Da();return!t||e<=a?e*i:a*i+pa+ha+(e-a-1)*i}function Pi(e){const{hasDivider:t,dividerRow:a,rows:i}=rt.value,o=Da();if(i<=0)return 0;let u;return!t||e<a*o?u=Math.floor(e/o):e<a*o+pa+ha?u=a:u=a+1+Math.floor((e-a*o-pa-ha)/o),Math.min(i-1,Math.max(0,u))}const fn=v(()=>rt.value.rows),mn=v(()=>{const{rows:e,hasDivider:t,dividerRow:a}=rt.value;if(e<=0)return 0;const i=e-1,o=t&&i===a?pa:Kt.value;return Na(i)+o}),Va=v(()=>{const e=fn.value;if(e<=0)return{startRow:0,endRow:0};const t=Math.max(0,Ci.value),a=Math.max(600,Ri.value),i=Math.max(0,Pi(t)-hs),o=Math.min(e,Pi(t+a)+1+hs);return{startRow:i,endRow:o}}),Zt=v(()=>{const{cols:e,items:t,liveCount:a,hasDivider:i,dividerRow:o,rows:u}=rt.value,{startRow:s}=Va.value,c=Math.min(u,Math.max(Va.value.endRow,s+Math.ceil(12/e))),w=[],R=[];let $=-1;for(let y=s;y<c;y++){if(i&&y===o){w.push({kind:"divider",key:"set-aside-divider"});continue}const N=i&&y>o,C=N?y-o-1:y,U=(N?a:0)+C*e,ee=N?t.length:a;for(let ce=0;ce<e;ce++){const ne=U+ce;if(ne<ee){const be=t[ne];$<0&&($=ne),w.push({kind:"card",req:be,key:`ai-${be.id}`}),R.push(be)}else!N&&i&&w.push({kind:"filler",key:`filler-${ne}`})}}return $=Math.max(0,$),{startIndex:$,endIndex:$+R.length,items:R,cells:w}}),hn=v(()=>Na(Va.value.startRow));oe(()=>k.setAsideJump.value,()=>
2{const{hasDivider:e,dividerRow:t}=rt.value,a=X.value;!e||!a||a.scrollTo({top:Math.max(0,Na(t)-12),behavior:"smooth"})});let qt=0;function pn(){const e=X.value;return e?e.scrollHeight>e.clientHeight+Xl:!1}function Ei(){return!F.value&&qt<Kl&&n.currentPage<n.lastPage&&!pn()}const Fi=new Set;let Ct=null;function Oa(){Ct&&clearTimeout(Ct),Ct=setTimeout(()=>{bn()},250)}async function bn(){try{const e=(ie.value||[]).filter(t=>!!(t!=null&&t.is_new)).map(t=>(t==null?void 0:t.id)??(t==null?void 0:t.saved_avail_id)).filter(t=>t!=null).filter(t=>!Fi.has(t));if(!e.length)return;e.forEach(t=>Fi.add(t)),await et.post(route("savedavails.bulkMarkViewed"),{saved_avail_ids:e})}catch{}}const Ti=v(()=>ze.value==="shared"),yn=v(()=>dt.value.length?dt.value.every(e=>e.shared):!1);function _n(e){n.setCurrentScope(e),Z(!0)}function wn(e){n.setShowAllMarkets(e),Z(!0)}const kn=v(()=>Be.value.size>0),Rt=h([]),za=h(!1),Ha=new Pr;let ea=null,Re=null,lt=null,ta=0;async function Ua(e){var s,d,c;const t=e??Ke.value??n.mapBounds??Bi();if(!t)return;const a=wr(t),i=new URLSearchParams({scope:n.currentScope,source:(((s=n.selectedSources)==null?void 0:s.length)||0)===0?"all":n.selectedSources.join(","),statuses:(((d=n.selectedStatuses)==null?void 0:d.length)||0)===0?"all":n.selectedStatuses.join(",")});n.aiFloorplanOnly&&i.set("has_ai_floorplan","1"),n.showLeasedSpaces&&i.set("include_leased","1"),n.activeMarketSlug&&i.set("market",n.activeMarketSlug),gr(i,!!n.showAllMarkets),n.searchQuery&&(i.set("search",n.searchQuery),((c=n.searchFields)==null?void 0:c.length)>0&&i.set("search_fields",n.searchFields.join(","))),i.set("bounds_west",String(a.west)),i.set("bounds_south",String(a.south)),i.set("bounds_east",String(a.east)),i.set("bounds_north",String(a.north)),n.polygonBounds&&(i.set("polygon_bounds_west",String(n.polygonBounds.west)),i.set("polygon_bounds_south",String(n.polygonBounds.south)),i.set("polygon_bounds_east",String(n.polygonBounds.east)),i.set("polygon_bounds_north",String(n.polygonBounds.north))),n.savedAreaIds.length>0?i.set("saved_area_ids",n.savedAreaIds.join(",")):n.polygonGeoJson&&i.set("polygon_geojson",n.polygonGeoJson),n.appendCriteriaParams(i);const o=i.toString();Re&<!==o&&Re.abort();const u=++ta;za.value=!0;try{const w=await Ha.load(o,async()=>{var y;const R=new AbortController;Re=R,lt=o;const $=await et.get(`/savedavails/markers?${o}`,{signal:R.signal});return Array.isArray((y=$.data)==null?void 0:y.data)?$.data.data:[]});if(u!==ta)return;Rt.value=w,ea=a,r.info("[SavedAvails] Markers fetched",{"ð Total markers from API":Rt.value.length,"ð Request params":o})}catch(w){if((w==null?void 0:w.name)==="CanceledError"||(w==null?void 0:w.code)==="ERR_CANCELED"||u!==ta)return;console.error("[SavedAvails] Error fetching markers:",w),Rt.value=[]}finally{u===ta&&(za.value=!1),lt===o&&(Re=null,lt=null)}}const Sn=v(()=>(Rt.value||[]).map(e=>{const t=Go(e.coordinates);if(!t)return null;const a=[t[1],t[0]];return{id:e.id,latLng:a,meta:{savedAvailId:e.id},type:"savedAvail",color:e.is_shared_with_me?"#10b981":"#3b82f6"}}).filter(e=>!!e)),se=h(!0),Ke=h(null),Ja=h(null),Li=h(null),Wa=h(null),ja=h(null),Pt=h(!1);let pe=null,ut=!1;function xn(e){if(!(e!=null&&e.bounds))return;Ke.value=e.bounds,Array.isArray(e.center)&&(Ja.value=e.center),typeof e.zoom=="number"&&(Li.value=e.zoom),e.isUser&&(Pt.value=!0);const t=Ar({mapFilterEnabled:se.value,embeddedSessionActive:F.value,isUser:!!e.isUser,currentBounds:n.mapBounds,nextBounds:e.bounds}),a=Sr(ea,e.bounds,e.isUser);!t&&!a||(pe&&clearTimeout(pe),pe=setTimeout(async()=>{const i=[];a&&i.push(Ua(e.bounds)),t&&se.value&&(n.setMapBounds(e.bounds),i.push(Z(!0,{includeMarkers:!1}))),await Promise.allSettled(i)},200))}function Bi(){var a,i;if(Ke.value)return Ke.value;const e=(i=(a=T.value)==null?void 0:a.mapboxMapRef)==null?void 0:i.map;if(!(e!=null&&e.getBounds))return null;const t=e.getBounds();return{west:t.getWest(),south:t.getSouth(),east:t.getEast(),north:t.getNorth()}}function An(){if(se.value=!se.value,!se.value)pe&&(clearTimeout(pe),pe=null),n.clearMapBounds(),Z(!0,{includeMarkers:!1});else{const e=Bi();e?(n.setMapBounds(e),Z(!0,{includeMarkers:!1})):r.debug("[SavedAvails] Map filter enabled but map bounds not available yet; waiting for viewport update")}}function In(){se.value=!1,Pt.value=!1,pe&&(clearTimeout(pe),pe=null),n.clearMapBounds(),Z(!0,{includeMarkers:!1})}function Ga(){var i,o,u;const e=((i=X.value)==null?void 0:i.scrollTop)??0;if(!fs({mapFilterEnabled:se.value,hasStoredMapBounds:!!n.mapBounds,hasUserInteractedWithMap:Pt.value,currentPage:Number(n.currentPage||1),scrollTop:e}))return!1;const a=(o=T.value)==null?void 0:o.mapboxMapRef;if(a!=null&&a.layersInitialized&&((u=a==null?void 0:a.map)!=null&&u.getBounds)){const s=a.map.getBounds(),d={west:s.getWest(),south:s.get
2South(),east:s.getEast(),north:s.getNorth()};return Ke.value=d,n.setMapBounds(d),!0}return!1}let aa=null;function Mn(){var o;const e=((o=X.value)==null?void 0:o.scrollTop)??0;if(!fs({mapFilterEnabled:se.value,hasStoredMapBounds:!!n.mapBounds,hasUserInteractedWithMap:Pt.value,currentPage:Number(n.currentPage||1),scrollTop:e})||!Xe.value)return!1;const a=Pa.value,i=Cr(Wa.value||S.value,ja.value??M.value,(a==null?void 0:a.clientWidth)??0,(a==null?void 0:a.clientHeight)??0);return i?(aa=i,Ke.value=i,n.setMapBounds(i),r.debug("[SavedAvails] Seeded initial map bounds from projected viewport",i),!0):!1}function $i(e=0){var s,d;if(ut||!aa)return;const t=(s=T.value)==null?void 0:s.mapboxMapRef;if(!(t!=null&&t.layersInitialized&&((d=t==null?void 0:t.map)!=null&&d.getBounds))){e<60&&setTimeout(()=>$i(e+1),150);return}const a=aa;if(aa=null,Pt.value||!n.mapBounds)return;const i=t.map.getBounds(),o={west:i.getWest(),south:i.getSouth(),east:i.getEast(),north:i.getNorth()},u=Rr(a,o);if(r.debug("[SavedAvails] Reconciled seeded map bounds with the live map",{seed:a,actual:o,matched:u}),Ke.value=o,u){n.mapBounds={...o};return}n.setMapBounds(o),Z(!0)}async function Cn(e=1200){const a=Date.now()+e;for(;!ut&&Date.now()<a;){if(Ga())return!0;await new Promise(i=>setTimeout(i,75))}return Ga()}function Di(e=0){if(!ut){if(Ga()){Z(!0);return}e<25&&setTimeout(()=>Di(e+1),150)}}const Rn=e=>{Ne.value=e.id,On(e.id)},Pn=e=>{Ne.value===e.id&&(Ne.value=null)},En=async e=>{var a;if(he.value)return;const t=((a=e.meta)==null?void 0:a.savedAvailId)??e.id;if(t)try{const i=re.value.find(o=>String((o==null?void 0:o.id)??(o==null?void 0:o.saved_avail_id))===String(t));await Tt(i??{id:t,saved_avail_id:t,images:[]})}catch(i){console.error("[SavedAvails] Failed to open marker details:",i)}},Ni=e=>{Ne.value=e},Vi=e=>{Ne.value===e&&(Ne.value=null)},dt=v(()=>ie.value.filter(e=>H.value.includes(e.id))),Fn=v(()=>dt.value.filter(e=>e.can_delete===!1)),Oi=v(()=>dt.value.some(e=>e.role==="listing")),Tn=v(()=>Oi.value?`Delete ${H.value.length} ${H.value.length===1?"property":"properties"}, including listing workspace data?`:`Confirm deletion of ${H.value.length} ${H.value.length===1?"card":"cards"}?`),Ln=v(()=>Oi.value?"This action cannot be undone. Any selected listings will be permanently removed from org inventory and their listing workspace data will also be deleted.":`This action cannot be undone. The selected ${H.value.length===1?"property":"properties"} will be permanently removed from your availabilities.`),re=v(()=>{if(F.value){const e=(k.store.results||[]).filter(a=>!k.isRejected(a)),t=e.filter(a=>!(a!=null&&a.lease_signal_kind));return t.length===e.length?e:[...t,...e.filter(a=>!!(a!=null&&a.lease_signal_kind))]}return n.filteredAvailabilities}),Bn=v(()=>F.value?re.value.filter(e=>!!(e!=null&&e.lease_signal_kind)).length:0),Z=async(e=!1,t={})=>{const a=n.perPage||12;qt=0,X.value&&(X.value.scrollTop=0);const i=t.includeMarkers!==!1;await n.fetchAvailabilities(e,1,a,!1),i&&Ua(),r.log("Requirements with images:",ie.value.map(c=>({id:c.id,imageCount:c.images?c.images.length:0,hasCurrentImageIndex:c.currentImageIndex!==void 0}))),Oa(),await q(),ot(),qe();const o=n.availabilities.length,u=re.value.length,s=Zt.value.items.length,d=n.total;r.info("[SavedAvails] Card counts",{"ð¢ API total":d,"ð¦ Store count":o,"ð After client filter":u,"ðï¸ Virtual visible":s,"ð Current page":n.currentPage,"ð Last page":n.lastPage,"ð Per page":n.perPage,"ðºï¸ Has polygon filter":Y.value,"ðï¸ Criteria filters":n.criteriaFilters,"ð Search query":n.searchQuery||"(none)","ð·ï¸ Scope":n.currentScope,"ð Sources":n.selectedSources,"ð Statuses":n.selectedStatuses}),o>0&&u<o&&r.debug("[SavedAvails] Card visibility mismatch detected",{apiTotal:d,storeCount:o,filteredCount:u,virtualCount:s,hasActivePolygons:Y.value,perPage:n.perPage,currentPage:n.currentPage,lastPage:n.lastPage,message:"Client-side filtering is reducing visible cards. Check polygon filters."}),Ei()&&(qt+=1,Ze())};let zi=0,ct=null;function $n(){var a,i;const e=new Set;for(const o of Zt.value.items||[]){const u=Number((o==null?void 0:o.id)??(o==null?void 0:o.saved_avail_id));Number.isFinite(u)&&u>0&&e.add(u)}const t=Number(((a=b.value)==null?void 0:a.id)??((i=b.value)==null?void 0:i.saved_avail_id));return Number.isFinite(t)&&t>0&&e.add(t),Array.from(e)}function Dn(){if(!n.lastFetchTime)return null;const e=n.lastFetchTime instanceof Date?n.lastFetchTime.getTime():new Date(n.lastFetchTime).getTime();return Number.isFinite(e)?Date.now()-e:null}async function Qa(e){if(typeof document<"u"&&document.visibilityState==="hidden"||yt.value||n.isLoading)return;const t=Date.now();if(ct||t-zi<Zl)return ct??Promise.resolve();zi=t;const a=Dn(),i=a===null||a>=ql,o=i?$n():[];return r.debug("[SavedAvails] Resume refresh triggered",{trigger:e,lastFetchAgeMs:a,markerRefresh:!0,signedImageRefresh:i,refreshIdsCount:o.length}),ct=(async()=>{var s,d;const u=[Ua()];if(i&&o.length>0&&u.push(n.forceRefreshAvailabilities(o)),await Promise.allSettled(u),W.value&&((s=b.value)!=null&&s.id)){const c=Number(b.value.id),w=n.availabilities.find(R=>R.id===c);w&&(b.value={...w,currentImageIndex:((d=b.value)==null?void 0:d.currentImageIndex)??w.currentImageIndex??0})}})().finally(()=>{ct=null}),ct}function Hi(){typeof document<"u"&&document.visibilityState==="visible"&&Qa("visibilitychange")}function Ui(){Qa("focus")}function Ji(){Qa("pageshow")}function Nn(e){if(!De.value)return null;const t=e.matched_fields;if(!t||!t.length)return null;const a=De.value.toLowerCase(),i={},o={address:()=>e.address,neighborhood:()=>e.neighborhood,brokerage_name:()=>e.brokerage_name,landlord_name:()=>e.landlord_name,cross_streets:()=>e.cross_streets,original_filename:()=>e.original_filename,total_usable_space:()=>e.total_usable_space?`${e.total_usable_space} SF`:null,rent_per_annum:()=>e.rent_per_annum&&e.rent_per_annum!=="hidden"?String(e.rent_per_annum):null,space_name:()=>{var u,s;return(s=(u=e.spaces)==null?void 0:u[0])==null?void 0:s.name},space_address:()=>{var u,s;return(s=(u=e.spaces)==null?void 0:u[0])==null?void 0:s.address},broker_contacts:()=>
2{if(!Array.isArray(e.broker_contacts))return null;const u=e.broker_contacts.map(s=>s.name).filter(Boolean).slice(0,2);return u.length>0?u.join(", "):null},property_highlights:()=>Array.isArray(e.property_highlights)?e.property_highlights.slice(0,2).join(", "):null,nearby_landmarks_or_tenants:()=>Array.isArray(e.nearby_landmarks_or_tenants)?e.nearby_landmarks_or_tenants.slice(0,2).join(", "):null};for(const u of t){const s=o[u];if(s){const d=s();d&&(i[u]=Vn(String(d),a))}}return Object.keys(i).length>0?i:null}function Vn(e,t){if(!t||!e)return e;const a=new RegExp(`(${t})`,"gi");return e.replace(a,"<mark>$1</mark>")}const On=async e=>{const t=X.value;if(!t)return;const a=document.querySelector(`[data-req-id="${e}"]`);if(a){a.scrollIntoView({behavior:"smooth",block:"nearest"});return}const o=(re.value||[]).findIndex(c=>String((c==null?void 0:c.id)??(c==null?void 0:c.saved_avail_id))===String(e));if(o===-1)return;const u=Math.max(1,Mt.value||sa()),d=Math.floor(o/u)*Da();t.scrollTo({top:d,behavior:"smooth"}),await q()};async function Wi(e,t={}){var s,d,c,w,R,$;if(!e)return null;const a=e.id??e.saved_avail_id;if(!a)return e;if(Je.has(a))return r.log("[SavedAvails] ð ensureFullImages skipped - actively receiving images for",a),e;const i=e.image_count??(((s=e.images)==null?void 0:s.length)||0),u=(Array.isArray(e.images)?e.images.filter(y=>!y.isLoading&&y.type!=="placeholder"):[]).length;if(e.images_loaded||u>=i||xa.has(a))return e;xa.add(a);try{const y=await et.get(`/savedavails/${a}/images`),N=Array.isArray((d=y.data)==null?void 0:d.images)?y.data.images:[],C={images:N,image_count:typeof((c=y.data)==null?void 0:c.image_count)=="number"?y.data.image_count:N.length,images_loaded:((w=y.data)==null?void 0:w.images_loaded)??!0};if(Je.has(a))return r.log("[SavedAvails] ð ensureFullImages: started receiving images during fetch, preserving local state"),e;const U=n.availabilities.findIndex(ee=>ee.id===a);if(U!==-1&&n.updateAvailability(U,C),t.updateSelected&&((R=b.value)==null?void 0:R.id)===a){const ee=(($=b.value)==null?void 0:$.currentImageIndex)||0;b.value={...b.value,...C,currentImageIndex:ee<N.length?ee:0},r.log("[SavedAvails] ð ensureFullImages updated gallery from /images",{imageCount:N.length})}return{...e,...C}}catch(y){return console.error("Failed to load full images for saved availability:",a,y),e}finally{xa.delete(a)}}async function ji(e,t){var a;try{await Wi(e,{updateSelected:W.value&&((a=b.value)==null?void 0:a.id)===((e==null?void 0:e.id)??(e==null?void 0:e.saved_avail_id))})}catch(i){console.error("Error handling card image request:",i)}finally{typeof t=="function"&&t()}}let vt=null;async function Gi(e){var c;const t=performance.now(),a=fe.userId,i=fe.azureTenantId;if(!a){console.warn("[SavedAvails] Cannot process notification - current user ID not loaded");return}const o=e.savedAvailId||((c=e.savedAvail)==null?void 0:c.id)||e.id,u=e.userId&&e.userId==a,s=e.azureTenantId&&i&&e.azureTenantId===i,d=n.availabilities.some(w=>w.id===o);if(!u&&!s&&!d){r.log("[SavedAvails] Ignoring update for avail not accessible to current user:",{savedAvailId:o,dataUserId:e.userId,currentUserId:a,dataTenantId:e.azureTenantId,currentTenantId:i});return}if(!o){console.error("[SavedAvails] Invalid notification - no savedAvailId found:",e);return}try{const w=performance.now(),R=await et.get(route("savedavails.show",{id:o})),$=performance.now()-w,y=R.data;if(!y||!y.id){console.error(`[SavedAvails] â Failed to fetch full data for SavedAvail ID: ${o}`,R),z({title:"Update Error",description:`Could not retrieve full details for updated item ID ${o}. Please refresh.`,variant:"destructive"});return}const C=n.availabilities.findIndex(ee=>ee.id===o)!==-1;yr(n,y);const U=performance.now()-t;if(r.log(`[SavedAvails] â
Card updated for ID ${o} (fetch: ${$.toFixed(0)}ms, total: ${U.toFixed(0)}ms)`),W.value&&b.value){const ee=b.value.id,ce=y.id;if(r.log(`[SavedAvails] ð§ Checking if details panel needs update. Current: ${ee}, Update: ${ce}`),ee==ce){if(Je.has(ce)){r.log("[SavedAvails] ð Actively receiving images, preserving local images (not over
2writing from API)");const ga=b.value.images||[],ei=b.value.currentImageIndex||0;b.value={...y,images:ga,currentImageIndex:ei};return}r.log("[SavedAvails] ð Updating selected details with fresh data from API");const ne=b.value.currentImageIndex||0,be=(y.images||[]).length,j=ne<be?ne:0;b.value={...y,images:y.images||[],currentImageIndex:j},r.log("[SavedAvails] â
Selected details updated from API. Images count:",be)}}y.isProcessing||(r.log("[SavedAvails] ð¬ Adding animation for ID:",y.id),Be.value.add(y.id),setTimeout(()=>{r.log("[SavedAvails] ð¬ Removing animation for ID:",y.id),Be.value.delete(y.id)},1500)),!C&&y.status==="import_completed"&&y.in_primary_inventory!==!1?(r.log("[SavedAvails] ð Showing success toast for completed import"),z({title:"Import Complete",description:`Flyer "${y.original_filename||"Imported Flyer"}" processed successfully.`,variant:"success"})):!C&&y.status==="import_failed"&&z({title:"Import Failed",description:`We couldn't import "${y.original_filename||"this flyer"}". Your existing availability was not changed. You can try uploading it again.`,variant:"destructive"})}catch(w){console.error(`[SavedAvails] Error fetching full data for SavedAvail ID ${o}:`,w),n.availabilities.some($=>$.id===o)?z({title:"Network Error",description:`Failed to get updated details for item ID ${o}. Please refresh.`,variant:"destructive"}):r.log("[SavedAvails] Silently ignoring error for item not in our list:",o)}finally{}}function Qi(e){const{savedAvailId:t,jobId:a,timestamp:i}=e.detail;r.log("[SavedAvails] ð flyer-import-completed received, savedAvailId:",t),Gi({savedAvailId:t,userId:fe.userId,action:"updated",status:"import_completed"})}const Je=ls(new Set);function zn(e){var u,s,d,c,w,R,$,y,N;r.log("[SavedAvails] ð¸ RAW ImageRegistered event received:",e);const t=fe.userId;if(!t||e.userId!=t){r.log("[SavedAvails] ð¸ Filtered out - wrong user",{currentUserId:t,dataUserId:e.userId});return}const a=e.savedAvailId,i=e.image;if(!(i!=null&&i.id)){r.log("[SavedAvails] ð¸ No image data, skipping");return}Je.add(a),setTimeout(()=>{Je.delete(a)},3e4),r.log("[SavedAvails] ð¸ ImageRegistered processing",{savedAvailId:a,imageId:i==null?void 0:i.id,imageType:i==null?void 0:i.type,isReceiving:Je.has(a)});const o=n.availabilities.findIndex(C=>C.id===a);if(r.log("[SavedAvails] ð¸ Looking for requirement in store",{savedAvailId:a,foundIndex:o,totalAvailabilities:n.availabilities.length,availIds:n.availabilities.map(C=>C.id).slice(0,5)}),o!==-1){const C=n.availabilities[o];if(r.log("[SavedAvails] ð¸ Found requirement",{reqId:C.id,currentImageCount:((u=C.images)==null?void 0:u.length)||0,hasPlaceholders:((s=C.images)==null?void 0:s.some(j=>j.isLoading))||!1}),C.images||(C.images=[]),C.images.some(j=>j.id===i.id)){r.log("[SavedAvails] ð¸ Image already exists, skipping",{imageId:i.id});return}const ee=C.images.findIndex(j=>j.isLoading),ce=ee!==-1?ee:C.images.length;let ne=-1;for(let j=C.images.length-1;j>=0;j--)if(C.images[j].isLoading){ne=j;break}ne!==-1&&C.images.splice(ne,1),C.images.splice(ce,0,{id:i.id,url:i.url,small_thumbnail:i.small_thumbnail,large_thumbnail:i.large_thumbnail,type:i.type,is_ai_regenerated:i.is_ai_regenerated||!1,isLoading:!1}),C.image_count!==void 0&&(C.image_count=C.images.filter(j=>!j.isLoading).length),C.images.some(j=>j.isLoading)||(C.imagesLoading=!1,Je.delete(a),r.log("[SavedAvails] ð¸ All images received for store, cleared receivingImagesFor flag")),n.updateAvailability(o,{...C,images:[...C.images]}),r.log("[SavedAvails] ð¸ Image appended to requirement",{savedAvailId:a,newImageCount:C.images.length,remainingPlaceholders:C.images.filter(j=>j.isLoading).length,imageType:i.type})}if(r.log("[SavedAvails] ð¸ Checking if details panel needs update",{showDetails:W.value,selectedId:(d=b.value)==null?void 0:d.id,eventSavedAvailId:a,match:W.value&&((c=b.value)==null?void 0:c.id)===a}),W.value&&((w=b.value)==null?void 0:w.id)===a){r.log("[SavedAvails] ð¸ Details panel IS open for this avail, updating...");const C={...b.value},U=C.images?[...C.images]:[];if(U.some(te=>te.id===i.id)){r.log("[SavedAvails] ð¸ Image already exists in details panel, skipping");return}
2r.log("[SavedAvails] ð¸ Current images before insert:",U.map((te,Mo)=>({index:Mo,id:te.id,isLoading:te.isLoading,type:te.type})));const ce=U.findIndex(te=>te.isLoading),ne=ce!==-1?ce:U.length;r.log("[SavedAvails] ð¸ Insert position calculation:",{firstPlaceholderIdx:ce,insertPosition:ne,totalImages:U.length});let be=-1;for(let te=U.length-1;te>=0;te--)if(U[te].isLoading){be=te;break}be!==-1&&(U.splice(be,1),r.log("[SavedAvails] ð¸ Removed placeholder at index",be));const j={id:i.id,url:i.url,small_thumbnail:i.small_thumbnail,large_thumbnail:i.large_thumbnail,type:i.type,is_ai_regenerated:i.is_ai_regenerated||!1,isLoading:!1};U.splice(ne,0,j),r.log("[SavedAvails] ð¸ Inserted image at position",ne,"Array now:",U.length);const ga=U.some(te=>te.isLoading);ga||(Je.delete(a),r.log("[SavedAvails] ð¸ All images received for details, cleared receivingImagesFor flag"));const ei={...C,images:U,imagesLoading:ga};r.log("[SavedAvails] ð¸ About to update selectedLandlordRequirement",{oldImageCount:(($=(R=b.value)==null?void 0:R.images)==null?void 0:$.length)||0,newImageCount:U.length,remainingPlaceholders:U.filter(te=>te.isLoading).length,newImageAdded:j}),b.value=ei,r.log("[SavedAvails] ð¸ â
selectedLandlordRequirement updated!",{newValue:(N=(y=b.value)==null?void 0:y.images)==null?void 0:N.length})}else r.log("[SavedAvails] ð¸ Details panel NOT open for this avail or ID mismatch")}async function Hn(){if(r.log("[SavedAvails] Setting up event listeners..."),vt)return;window.addEventListener("flyer-import-completed",Qi);let e=fe.userId;if(!e){const t=await fe.fetchUserId();e=(t==null?void 0:t.id)??fe.userId}if(!e){r.warn("[SavedAvails] Cannot setup Echo - user ID not available");return}vt=window.Echo.private(cs(e)).listen("SavedAvailUpdated",t=>{r.log("ð¢ SavedAvailUpdated received:",t),Gi(t)}).listen(".ImageRegistered",t=>{r.log("ð´ð´ð´ ImageRegistered EVENT RECEIVED ð´ð´ð´",t),zn(t)}),r.log("[SavedAvails] â
Event listeners ready on private channel "+cs(e))}function Un(){window.removeEventListener("flyer-import-completed",Qi),vt&&(vt.stopListening("SavedAvailUpdated"),vt.stopListening(".ImageRegistered"),vt=null)}async function Yi(e){const t=new URLSearchParams(window.location.search),a=t.get("open"),i=t.get("pending_change_id");let o=null,u=null;const s=He.url,d=s.indexOf("?");if(d!==-1){const N=new URLSearchParams(s.slice(d+1));o=N.get("open"),u=N.get("pending_change_id")}const c=a??o;if(!c)return;const w=parseInt(c,10);if(!Number.isFinite(w))return;const R=parseInt(i??u??"",10);Ma.value=Number.isFinite(R)?R:null;const $=b.value?Number(b.value.id??b.value.saved_avail_id):null;if(W.value&&$===w){window.history.replaceState({},"",window.location.pathname);return}const y=ie.value.find(N=>Number(N.id??N.saved_avail_id)===w);try{r.log("Auto-opening saved avail from URL param:",w),await Tt(y??{id:w,saved_avail_id:w,images:[]}),e&&window.history.replaceState({},"",window.location.pathname)}catch(N){r.error("Failed to fetch saved avail:",N),z({title:"Error",description:"Could not find the requested property.",variant:"destructive"})}}function Jn(){const t=new URLSearchParams(window.location.search).get("include_leased");(t==="1"||t==="true")&&(n.showLeasedSpaces||(r.log("Phase 5 deep-link: activating include_leased filter"),n.toggleShowLeasedSpaces()))}oe(()=>He.url,async()=>{await Yi(!0)}),bs(()=>{ut=!1,n.isLoading=!0,new URLSearchParams(window.location.search).get("ai")==="1"&&q(()=>setTimeout(()=>Ai(),150)),mi.aiScope&&Ie.value&&q(()=>setTimeout(()=>void nn(),150));const e=jo("newAvailabilityId");e&&(r.log("Found new availability to animate from navigation state:",e),Be.value.add(e),q(()=>{const a=document.querySelector(".cards-container");a&&(a.scrollTop=0)}),setTimeout(()=>{Be.value.clear()},1500)),q(async()=>{const a=io();n.setPerPage(a),gi();const i=localStorage.getItem("saved-availabilities");if(i)try{const s=JSON.parse(i);r.debug("[SavedAvails] localStorage persisted data",s),s.mapBounds&&console.error("ð¨ [SavedAvails] BUG: mapBounds is in localStorage but should NOT be persisted!",s.mapBounds)}catch(s){console.warn("Failed to parse persisted data:",s)}n.mapBounds!==null&&(console.warn("[SavedAvails] Clearing stale mapBounds before initial fetch",{mapBounds:n.mapBounds,mapFilterEnabled:se.value}),n.clearMapBounds()),r.info("[SavedAvails] Initial state before fetch",{"ð§ perPage set to":a,"ð·ï¸ currentScope":n.currentScope,"ð
2 selectedSources":n.selectedSources,"ð selectedStatuses":n.selectedStatuses,"ð¨ aiFloorplanOnly":n.aiFloorplanOnly,"ðºï¸ mapBounds":n.mapBounds,"ð searchQuery":n.searchQuery}),Xa(),Jn();const o=Mn(),u=o||await Cn();ut||(o?$i():u||Di(),Z(!0).then(async()=>{yt.value=!1,await Yi(!0);const s=new URLSearchParams(window.location.search),d=s.get("create_property"),c=s.get("link_to_comp_id");if(d==="true"){r.log("Auto-opening create form from URL param",{linkToCompId:c}),c&&(Jt.value=parseInt(c,10)),b.value=null,$e.value=!0;const w=window.location.pathname;window.history.replaceState({},"",w)}}),setTimeout(()=>Ao(),200))}),Ya(),document.addEventListener("themeChanged",Ya),Hn(),document.addEventListener("visibilitychange",Hi),window.addEventListener("focus",Ui),window.addEventListener("pageshow",Ji),oe(()=>ie.value,a=>{a.length>0&&r.log("Requirements loaded with images:",a.slice(0,3).map(i=>({id:i.id,hasImages:i.images&&i.images.length>0,imageCount:i.images?i.images.length:0})))},{immediate:!0});let t=null;oe(()=>ie.value.length,(a,i)=>{a>0&&(t=performance.now(),r.log("[Render Tracking] Starting render timing, cards:",a,"isLoading:",_t.value),q(()=>{requestAnimationFrame(()=>{const o=performance.now()-t;r.info("[SavedAvails] Frontend rendering time",{cards_rendered:a,render_time_ms:o.toFixed(2)+"ms",avg_per_card:(o/a).toFixed(2)+"ms",was_loading:_t.value})})}))})}),Ro(()=>{if(ut=!0,document.removeEventListener("themeChanged",Ya),document.removeEventListener("visibilitychange",Hi),window.removeEventListener("storage",B),window.removeEventListener("focus",Ui),window.removeEventListener("pageshow",Ji),window.removeEventListener("resize",es),Un(),Ct&&clearTimeout(Ct),Le&&(clearTimeout(Le),Le=null),n.clearMapBounds(),n.clearPolygonBounds(),n.clearPolygonGeoJson(),n.clearCriteriaFilters(),pe&&(clearTimeout(pe),pe=null),je){try{je.disconnect()}catch{}je=null}if(Ge&&X.value&&(X.value.removeEventListener("scroll",Ge),Ge=null),Re){try{Re.abort()}catch{}Re=null}Ha.clear(),ea=null,lt=null,ia(),ct=null}),oe(()=>(ie.value||[]).map(e=>(e==null?void 0:e.id)??(e==null?void 0:e.saved_avail_id)).join(","),()=>Oa());const Ya=()=>{D.value=localStorage.getItem("theme")||"light"};function Xi(e){event==null||event.stopPropagation(),b.value=e,$e.value=!0}function Wn(e){var s,d;if(!e)return[];const t=c=>{if(!Array.isArray(c))return[];const w=[],R=new Set;for(const $ of c){const y=Number($);!Number.isInteger(y)||y<=0||R.has(y)||(R.add(y),w.push(y))}return w},a=t(e.matched_space_ids);if(a.length>0)return a;const i=(d=(s=e==null?void 0:e.breakdown)==null?void 0:s.matched_configuration)==null?void 0:d.units,o=t(Array.isArray(i)?i.map(c=>c==null?void 0:c.id):[]);if(o.length>0)return o;const u=Number(e==null?void 0:e.space_id);return Number.isInteger(u)&&u>0?[u]:[]}function jn(e,t){var s,d;const a=(k.chips.value||[]).map(c=>c.label),i=k.semanticFilter.value;(i==null?void 0:i.status)==="applied"&&a.push(qo(i));const o=((s=k.rubricChecksFor(e))==null?void 0:s.checks)||{},u=[...k.rankingRows.value||[],...k.rankingContextRows.value||[]].map(c=>({label:c.label,state:si(c,o[c.key])}));return{must:a,prefer:u,matchedSpaceCount:Array.isArray(t)?t.length:0,evidence:{query:(i==null?void 0:i.status)==="applied"?i.query:null,verification:(e==null?void 0:e.semantic_verification)??null,snippet:((d=e==null?void 0:e.semantic_evidence)==null?void 0:d.snippet)??null}}}const gt=new Map;function Ki(e,t=eu){const a=gt.get(e);if(a&&Date.now()-a.at<au)return a.promise;const i=n.fetchAvailabilityDetail(e,{insertIfMissing:!1,imageLimit:t});return gt.set(e,{promise:i,at:Date.now()}),i.catch(()=>gt.delete(e)),i}function Gn(e){const t=re.value||[];if(!e||t.length===0)return;const a=t.findIndex(i=>i.id===e.id||i.saved_avail_id===e.id||i.id===e.saved_avail_id);a!==-1&&[t[a-1],t[a+1]].forEach(i=>{const o=(i==null?void 0:i.id)??(i==null?void 0:i.saved_avail_id);o&&Ki(o,tu).catch(()=>{})})}let Et=null,Ft=null;function ia(){Et!==null&&typeof window.cancelIdleCallback=="function"&&window.cancelIdleCallback(Et),Ft&&clearTimeout(Ft),Et=null,Ft=null}function Qn(e){ia();const t=()=>{Et=null,Ft=null,Gn(e)};typeof window.requestIdleCallback=="function"?Et=window.requestIdleCallback(t,{timeout:1500}):Ft=setTimeout(t,750)}async function Tt(e){var a,i;ia(),qn(e),st.value=!1,Ut.value=F.value?Wn(e):[],Ia.value=F.value?jn(e,Ut.value):null,b.value={...e,images:e.images||[],currentImageIndex:e.currentImageIndex||0,__detail_loading:!0},W.value=!0;const t=(e==null?void 0:e.id)??(e==null?void 0:e.saved_avail_id);try{if(t){const o=await Ki(t);if(o&&((a=b.value)==null?void 0:a.id)===t){const u=((i=b.value)==null?void 0:i.currentImageIndex)||0,s=(o.images||[]).length;b.value={...o,images:o.images||[],currentImageIndex:u<s?u:0,__detail_loading:!1}}}}catch(o){r.error("[SavedAvails] Failed to hydrate full details for panel:",o)}finally{!!b.value&&(b.value.id===t||!t)&&b.value.__detail_loading&&(b.value={...b.value,__detail_loading:!1})}Qn(e)}async function Zi(e){he.value||await Tt(e)}async function Yn(e){e&&await Tt(e)}async function Xn(e,t=null){var u,s;const a=b.value,i=(a==null?void 0:a.currentImageIndex)||0,o=(a==null?void 0:a.images)||[];gt.delete(e);try{const d=await n.fetchAvailabilityDetail(e,{markAsIndividuallyFetched:!0});if(!d)return;if(((u=b.value)==null?void 0:u.id)===e){const c=Array.isArray(d.images)&&d.images.length>0?d.images:o,w=c.length>0?Math.min(i,c.length-1):0;b.value={...d,images:c,currentImageIndex:w}}}catch(d){if(console.error("[SavedAvails] Failed to refresh requirement after inline edit:",d),!t)return;((s=b.value)==null?void 0:s.id)===e&&(b.value={...b.value,...t});const c=n.availabilities.findIndex(w=>w.id===e);c!==-1&&n.updateAvailability(c,t)}}async function Kn(e,t){var s,d;const a=typeof e=="number"||typeof e=="string",i=Number(a?e:e==null?void 0:e.savedAvailId),o=a?((s=t==null?void 0:t.result)==null?void 0:s.data)??(t==null?void 0:t.data)??null:e==null?void 0:e.updates;if(!i||!o)return;if(gt.delete(i),a){await Xn(i,o);return}((d=b.value)==null?void 0:d.id)===i&&o&&(b.value={...b.value,...o});const u=n.availabilities.findIndex(c=>c.id===i);u!==-1&&o&&n.updateAvailability(u,o)}function Zn(e){const t=new URLSearchParams;t.set("create_comp","true"),e!=null&&e.saved_avail_id&&t.set("saved_avail_id",String(e.saved_avail_id)),e!=null&&e.space_id&&t.set("space_id",String(e.space_id)),e!=null&&e.address&&t.set("address",e.address),e!=null&&e.neighborhood&&t.set("neighborhood",e.neighborhood),e!=null&&e.workflow&&t.set("workflow",e.workflow),e!=null&&e.link_mode&&t.set("link_mode",e.link_mode),e!=null&&e.mark_saved_avail_unavailable&&t.set("mark_saved_avail_unavailable","1"),e!=null&&e.is_current_lease&&t.set("is_current_lease","1"),e!=null&&e.status&&t.set("status",e.status),e!=null&&e.pending_change_id&&t.set("pending_change_id",String(e.pending_change_id)),window.location.href=`/data/comps?${t.toString()}`}function qn(e){try{const t=(e==null?void 0:e.id)??(e==null?void 0:e.saved_avail_id);if(!t)return;et.post(route("savedavails.markViewed",{id:t})).catch(()=>{})}catch{}}async function We(){const e=new Date().toISOString();gt.clear(),Ha.clear(),ea=null,Re&&(Re.abort(),Re=null,lt=null),r.log("[SavedAvails] ð refreshRequirements called at:",e);const t=new Set(ie.value.map(i=>i.saved_avail_id||i.id));
2if(r.log("[SavedAvails] ð Current requirements count:",ie.value.length),r.log("[SavedAvails] ð Current IDs:",Array.from(t)),r.log("[SavedAvails] ð Fetching fresh requirements..."),await Z(!0),r.log("[SavedAvails] â
Fresh requirements fetched at:",new Date().toISOString()),r.log("[SavedAvails] ð New requirements count:",ie.value.length),W.value&&b.value){const i=b.value.id;r.log("[SavedAvails] Details panel is open, looking for requirement with ID:",i);const o=ie.value.find(u=>u.id===i);o?(r.log("[SavedAvails] Found updated requirement, updating selectedLandlordRequirement"),b.value=o,r.log("Updated selectedLandlordRequirement after refresh:",{id:i,field_sources:o.field_sources,validation_status:o.validation_status})):console.warn("[SavedAvails] Could not find updated requirement with ID:",i)}else r.log("[SavedAvails] Details panel not open or no selectedLandlordRequirement");const a=ie.value.filter(i=>!t.has(i.saved_avail_id||i.id)&&!i.isProcessing);a.length>0&&(Be.value.clear(),a.forEach(i=>{Be.value.add(i.saved_avail_id||i.id)}),q(()=>{const i=document.querySelector(".cards-container");i&&(i.scrollTop=0)}),setTimeout(()=>{Be.value.clear()},1500))}function eo(){ia(),W.value=!1,Ma.value=null,st.value=!1,Ut.value=[],Ia.value=null}function qi(){const e=st.value;$e.value=!1,xe.value=1,ue.value=null,de.value=0,Jt.value=null,Wt.value=null,Ue.value=null,kt.value=!1,e&&b.value&&(W.value=!0),st.value=!1}async function to(e){var t,a,i,o,u,s;try{r.log("[SavedAvails] closePanelAndReload called with data:",e);const d=(e==null?void 0:e.id)||(e==null?void 0:e.saved_avail_id)||((t=b.value)==null?void 0:t.id)||((a=b.value)==null?void 0:a.saved_avail_id),c=d?Number(d):null;r.log("[SavedAvails] requirementId to open:",c,"type:",typeof c);let w=null;if(c)try{r.log("[SavedAvails] Fetching full detail for requirement:",c),w=await n.fetchAvailabilityDetail(c,{markAsIndividuallyFetched:!0}),r.log("[SavedAvails] Full detail fetched, images count:",(i=w==null?void 0:w.images)==null?void 0:i.length)}catch(R){r.log("[SavedAvails] Error fetching full detail:",R)}if($e.value=!1,xe.value=1,ue.value=null,de.value=0,Jt.value=null,We().then(()=>{r.log("[SavedAvails] Background refreshRequirements completed")}),w)b.value={...w,images:w.images||[],images_loaded:!0,currentImageIndex:0},r.log("[SavedAvails] selectedLandlordRequirement set with full detail:",(o=b.value)==null?void 0:o.id),r.log("[SavedAvails] Images in selectedLandlordRequirement:",(s=(u=b.value)==null?void 0:u.images)==null?void 0:s.length),W.value=!0,r.log("[SavedAvails] showDetails set to true, opening details panel"),await q(),r.log("[SavedAvails] After nextTick, showDetails is:",W.value);else if(c){r.log("[SavedAvails] Full detail not available, falling back to list data"),await We();const R=ie.value.find($=>Number($.id)===c||Number($.saved_avail_id)===c);R?(b.value={...R,images:R.images||[],images_loaded:!1,currentImageIndex:0},W.value=!0,await q(),await Wi(R,{updateSelected:!0})):r.log("[SavedAvails] Could not find requirement with id:",c)}else r.log("[SavedAvails] No requirementId found, not opening details");st.value=!1}catch(d){console.error("[SavedAvails] Error in closePanelAndReload:",d),r.log("[SavedAvails] Error in closePanelAndReload:",d)}}async function ao(e,t=null,a=0){r.log("[SavedAvails] handleEditFromDetails called",{requirementId:e==null?void 0:e.id,fieldName:t,spaceIndex:a}),W.value=!1,st.value=!0,b.value=e,de.value=a??0,r.log("ð§ [SavedAvails] editSpaceIndex set to:",de.value),r.log(`Editing space index: ${de.value}`),t?(xe.value=Ve(t),ue.value=t,r.log(`Editing field "${t}" - navigating to step ${xe.value}`)):(xe.value=1,ue.value=null),await q(),r.log("ð§ [SavedAvails] After nextTick, opening form with editSpaceIndex:",de.value),$e.value=!0}async function Ze(e="explicit"){if(Yt.take({automatic:e==="automatic",evidence:Ce.value,available:Ba()})){if(F.value){if(!It.value)return;await k.store.loadMoreResults(),await q(),qe();return}if(r.debug("[SavedAvails] loadMore called",{canLoadMore:It.value,isLoadingMore:nt.value,currentPage:n.currentPage,lastPage:n.lastPage}),!It.value){r.debug("[SavedAvails] loadMore skipped: canLoadMore is false");return}if(nt.value){r.debug("[SavedAvails] loadMore skipped: already loading");return}nt.value=!0;try{r.debug("[SavedAvails] Calling store.loadMore()"),await n.loadMore(),r.debug("[SavedAvails] store.loadMore() completed",{total:n.availabilities.length}),Oa(),await q(),qe()}finally{nt.value=!1,Ei()&&(qt+=1,setTimeout(()=>{Ze("automatic")},0))}}}let je=null,Ge=null;function qe(){if(je){try{je.disconnect()}catch{}je=null}Ge&&X.value&&(X.value.removeEventListener("scroll",Ge),Ge=null);const e=X.value,t=Mi.value;if(!e||!t){r.warn("[SavedAvails] Cannot setup infinite observer",{root:!!e,target:!!t});return}r.debug("[SavedAvails] Setting up IntersectionObserver",{rootScrollHeight:e.scrollHeight,rootClientHeight:e.clientHeight,canScroll:e.scrollHeight>e.clientHeight}),je=new IntersectionObserver(a=>{a.some(o=>o.isIntersecting)&&(r.debug("[SavedAvails] IntersectionObserver triggered loadMore"),Ze("automatic"))},{root:e,rootMargin:"300px 0px",threshold:0}),je.observe(t),Ge=()=>{ot();const a=e.scrollTop,i=e.scrollHeight,o=e.clientHeight,u=i-a-o;u<300&&It.value&&!nt.value&&(r.debug("[SavedAvails] Scroll handler triggered loadMore",{distanceFromBottom:u}),Ze("automatic"))},e.addEventListener("scroll",Ge,{passive:!0}),r.debug("[SavedAvails] Infinite scroll setup complete")}function sa(){const e=X.value??document.querySelector(".cards-container");if(!e||e.clientWidth===0)return 1;const t=16,a=Ii.value;return Math.max(1,Math.floor((e.clientWidth+t)/(a+t)))}function io(e=36){const t=sa(),a=X.value??document.querySelector(".cards-container"),i=16,o=180;let u=e;if(a&&a.clientHeight>0){const d=Math.max(3,Math.ceil((a.clientHeight+i)/(o+i)));u=Math.max(e,t*(d+2))}const s=t*Math.ceil(u/t);return Math.min(72,Math.max(e,s))}function Xa(){const e=document.querySelector(".cards-container");if(!e||e.clientHeight===0||e.clientWidth===0)return;const t=e.clientHeight;e.clientWidth;const a=16,i=20;sa();const o=180,u=t-i,s=Math.max(1,Math.floor((u+a)/(o+a))),d=Math.max(o,Math.floor((u-(s-1)*a)/s));e.style.setProperty("--card-row-height",`${d}px`),Kt.value=d}let Ka=null;const es=()=>{Ka&&clearTimeout(Ka),Ka=setTimeout(()=>{Xa(),requestAnimationFrame(()=>{ot(),qe()})},150)};window.addEventListener("resize",es);function so(){he.value=!he.value,n.toggleSelectionMode(),he.value||(H.value=[])}function no(e){if(!ie.value.find(i=>i.id===e))return;const a=H.value.indexOf(e);a===-1?H.value.push(e):H.value.splice(a,1),n.toggleAvailabilitySelection(e)}async function oo(){if(!H.value.length)return;const e=Fn.value;if(e.length>0){const t=e.some(a=>a.role==="listing");z({title:t?"Cannot delete selected listing":"Cannot delete selected property",description:t?"Only the listing owner or an explicit listing collaborator can delete a listing. Other org members can view it as a saved avail, but cannot delete the listing workspace.":"One or more selected saved availabilities cannot be deleted because they are not shared with you.",variant:"destructive"});return}ra.value=!0}
2function ro(e){mt.value=!1,z({title:"Added to Tour Book",description:`${H.value.length} ${H.value.length===1?"property":"properties"} added to tour book successfully.`,variant:"success"}),H.value=[],he.value=!1}function lo(){ca.value=!1}async function uo(){await We(),he.value=!1,H.value=[]}async function co(){if(ra.value=!1,!H.value.length)return;H.value.forEach(a=>{Ht.value.add(a)});const e=350;await new Promise(a=>setTimeout(a,e));const t=await n.unsaveSelected();H.value=[],he.value=!1,Ht.value.clear(),t!=null&&t.success||z({title:"Delete failed",description:(t==null?void 0:t.message)||"Could not delete the selected availabilities. Please try again.",variant:"destructive"})}async function vo(){if(!H.value.length)return;const e=dt.value.filter(t=>t.duplicate_status==="pending_review");if(e.length>0){z({title:"Cannot Share",description:`Please resolve ${e.length} duplicate(s) before sharing.`,variant:"destructive"});return}try{await n.shareSelected()?(H.value=[],he.value=!1):alert("Failed to share availabilities")}catch(t){console.error("Error sharing availabilities:",t),alert("Failed to share availabilities")}}async function go(){z({title:"Cannot Unshare",description:"Once shared with your organization, availabilities cannot be unshared. You can still edit or delete them.",variant:"destructive"})}function ts(){b.value=null,$e.value=!0}function fo(e){qi(),We()}async function mo(e){try{if(e.shared){z({title:"Cannot Unshare",description:"Once shared with your organization, availabilities cannot be unshared. You can still edit or delete them.",variant:"destructive"});return}await n.toggleShareAvailability(e.id,!0),await Z(!0)}catch(t){console.error("Error sharing availability:",t),z({title:"Error",description:"Failed to share availability",variant:"destructive"})}}function ho(e){z({title:"Cannot Share",description:e.message,variant:"destructive"})}const na=h(!1);async function po(){na.value=!1,await We()}const Lt=h(!1),oa=h([]),Za=h(!1),Bt=h(null),ra=h(!1),Qe=h([]),$t=h(!1),Dt=h(0),ft=h(""),la=h(null),ua=h(!1),da=h(!1),ca=h(!1),mt=h(!1),as=()=>{try{const e=localStorage.getItem(tt);return e?JSON.parse(e):[]}catch{return[]}},bo=()=>{try{const e=localStorage.getItem(ba);return e?JSON.parse(e):null}catch{return null}},is=(e,t)=>{const a={jobId:e,isMinimized:t,timestamp:Date.now()};localStorage.setItem(ba,JSON.stringify(a))},yo=e=>{const t=Qe.value.length===0;Qe.value.includes(e)||(Qe.value=[...Qe.value,e]),localStorage.setItem(tt,JSON.stringify(Qe.value)),_o(e),is(e,!1),n.addActiveProgressJob(e),t&&(Bt.value=e,Za.value=!1)},va=()=>{Qe.value=[],localStorage.removeItem(tt),localStorage.removeItem(ba),localStorage.removeItem(ya),localStorage.removeItem(ai),n.clearActiveProgressJobs(),Bt.value=null};window.clearAllProgressData=()=>{va(),localStorage.removeItem("activeProgressJobs"),Object.keys(localStorage).forEach(e=>{e.startsWith("progressState_")&&localStorage.removeItem(e)}),r.log("All progress data cleared!"),window.location.reload()};const qa=()=>{try{const e=localStorage.getItem(ya);return e?JSON.parse(e):{}}catch{return{}}},_o=e=>{const t=qa();t[e]=Date.now(),localStorage.setItem(ya,JSON.stringify(t))},wo=e=>{const t=qa();delete t[e],localStorage.setItem(ya,JSON.stringify(t))};function ss(){try{const e=localStorage.getItem(ai);return e?JSON.parse(e):{}}catch{return{}}}function ko(e,t){const a=ss();a[e]=t,localStorage.setItem(ai,JSON.stringify(a)),So[e]=t}const So=ls({...ss()}),xo=()=>{const e=Date.now(),t=iu*60*60*1e3,a=qa(),i=as();let o=!1;const u=i.filter(s=>{const d=a[s];return!d||e-d>t?(r.log("[SavedAvails] Job expired due to age:",s),wo(s),o=!0,!1):!0});
2return o&&(r.log("[SavedAvails] Cleaning up expired jobs, keeping:",u),u.length>0?localStorage.setItem(tt,JSON.stringify(u)):va(),n.clearActiveProgressJobs(),u.forEach(s=>n.addActiveProgressJob(s))),u},Ao=async()=>{var o,u;const e=xo(),t=e.length>0?e:as(),a=bo();r.log("[SavedAvails] Checking for active jobs on page load:",t),r.log("[SavedAvails] Stored progress state:",a),n.clearActiveProgressJobs();const i=[];for(const s of t)try{r.log("[SavedAvails] Validating job:",s);const d=await et.get(`/flyers/progress/${s}`);if(d.data&&d.data.progress){const c=d.data.progress;r.log("[SavedAvails] Job is still active:",s,c),c.progress_percent>=100||c.status==="completed"||c.status==="failed"?r.log("[SavedAvails] Job is completed/failed, removing:",s):(r.log("[SavedAvails] Job is still in progress, keeping:",s),i.push(s),n.addActiveProgressJob(s))}else r.log("[SavedAvails] No progress data for job, removing:",s)}catch(d){r.log("[SavedAvails] Job validation fetch error:",s,(o=d==null?void 0:d.response)==null?void 0:o.status),((u=d==null?void 0:d.response)==null?void 0:u.status)!==404&&r.log("[SavedAvails] Removing job due to non-404 error")}
2if(i.length!==t.length&&(r.log("[SavedAvails] Updating localStorage with valid jobs:",i),i.length>0?localStorage.setItem(tt,JSON.stringify(i)):(localStorage.removeItem(tt),localStorage.removeItem(ba))),Qe.value=[...i],i.length>0&&a&&i.includes(a.jobId)){const s=ie.value.filter(d=>d.isProcessing);r.log("[SavedAvails] Found processing requirements:",s),s.length>0||i.includes(a.jobId)?(r.log("[SavedAvails] Restoring progress panel for job:",a.jobId),Bt.value=a.jobId,Za.value=a.isMinimized,r.log("[SavedAvails] Progress panel restored - minimized:",a.isMinimized),(i.length>1||!i.includes(a.jobId))&&(localStorage.setItem(tt,JSON.stringify([a.jobId])),n.clearActiveProgressJobs(),n.addActiveProgressJob(a.jobId))):(r.log("[SavedAvails] No processing requirements found, clearing stored jobs"),va())}else if(i.length>0){const s=i[0];r.log("[SavedAvails] No stored state, creating default for job:",s),Bt.value=s,Za.value=!1,is(s,!1)}else i.length===0?Qe.value=[]:(r.log("[SavedAvails] No valid jobs found, clearing all stored data"),va())};function ns(){Lt.value=!1,Ye.value=!1,ft.value="",Dt.value=0,la.value=null,ua.value=!1}async function os(e){var i,o,u,s,d;const t=e.files||[],a=e.urls||[];if(!(!t.length&&!a.length)&&!$t.value){$t.value=!0,Dt.value=0,ft.value="",oa.value=[],la.value=null;try{const{body:c,single:w}=Eo(e,{role:"availability"}),R=await et.post(w?"/flyers/import":"/flyers/import-batch",c,{headers:{"Content-Type":"multipart/form-data"},timeout:12e4,validateStatus:y=>y>=200&&y<300||y===409||y===422,onUploadProgress:y=>{y.total&&(Dt.value=Math.round(y.loaded*100/y.total))}}),$=await Fo(R.data,{queued:y=>{var U,ee;const N=y.job_id;yo(N);const C=y.original_filename||y.savedAvail.original_filename||((U=t[y.item_index])==null?void 0:U.name)||"Flyer";ko(N,C),ke.ensureJob(N),(ee=ke.jobs[N]).original_filename||(ee.original_filename=C),ke.setActive(N),ke.persist(),Bt.value=N},reused:async y=>{await Tt({id:y.savedAvail.id,saved_avail_id:y.savedAvail.id,images:[]})}});oa.value=$.results,$.remaining.length||ns(),z({title:$.remaining.length?"Review import results":"Flyer ready",description:$.message})}catch(c){const w=(i=c==null?void 0:c.response)==null?void 0:i.status,R=((u=(o=c==null?void 0:c.response)==null?void 0:o.data)==null?void 0:u.message)||((d=(s=c==null?void 0:c.response)==null?void 0:s.data)==null?void 0:d.error)||(c==null?void 0:c.message)||"Failed to import flyer.";w===401&&/azure|re-authenticate|refresh/i.test(R)?ua.value=!0:(ft.value=w===419?"Your session has expired. Please refresh the page and try again.":R,z({title:"Import needs attention",description:ft.value,variant:"destructive"}))}finally{$t.value=!1}}}function rs(e,t,a){r.log("[SavedAvails] Using existing listing for a matching document:",e),t==null||t(),z({title:"Already in your availabilities",description:a?`${a} is the listing for this flyer. Nothing was imported.`:"This flyer is already one of your listings. Nothing was imported."})}async function Io(e,t,a=1){r.log("[SavedAvails] Items moved to tenant:",{tenantId:e,count:t,tenantCount:a}),z({title:"Moved Successfully",description:a>1?`${t} ${t===1?"property":"properties"} added to ${a} tenant shortlists.`:`${t} ${t===1?"property":"properties"} added to the tenant shortlist.`,variant:"success"}),H.value=[],he.value=!1,await Z(!0)}return(e,t)=>(m(),A(ye,null,[V(f(Ho),{title:"Saved Availabilities"}),V(To,{breadcrumbs:Oe.value},{default:ht(()=>{var a,i,o,u;return[g("div",gl,[g("div",fl,[V(Lo,{"is-loading":_t.value,"selection-mode":he.value,"selected-count":H.value.length,"show-view-selector":!1,"search-query":De.value,"onUpdate:searchQuery":t[4]||(t[4]=s=>De.value=s),"search-fields":pi.value,"onUpdate:searchFields":t[5]||(t[5]=s=>pi.value=s),"search-placeholder":"Search properties...","search-suggestions-url":bi.value?"/savedavails/address-suggestions":void 0,"search-suggestions-params":yi,"is-searching":it.value,"show-share-actions":!0,"all-selected-shared":yn.value,onAdd:ts,onRefresh:We,onToggleSelect:so,onDeleteSelected:oo,onShareSelected:vo,onUnshareSelected:go,showImportFlyerButton:!0,"unified-create":Ns.value,onCreate:Vs,addButtonDusk:"saved-avails-add-new",showAiSiteSearchButton:!Ie.value,"ai-omnibox":Ie.value,"ai-session-active":F.value,onAiSiteSearch:Ai,onImportFlyer:t[6]||(t[6]=s=>Lt.value=!0)},{search:ht(()=>[Ie.value?(m(),O(Zo,{key:0,ref_key:"omniboxRef",ref:St,modelValue:De.value,"onUpdate:modelValue":t[0]||(t[0]=s=>De.value=s),"dataset-terms":sn.value,"results-count":an.value,"browse-loading":Gt.value,"panel-align-el":Ys.value,"suggestions-url":bi.value?"/savedavails
2/address-suggestions":void 0,"suggestions-params":yi,onFilterSubmit:Ms,onFirstFocus:f(wt).maybeAutoOpenOnFirstFocus,onHelp:f(wt).openManually},null,8,["modelValue","dataset-terms","results-count","browse-loading","panel-align-el","suggestions-url","onFirstFocus","onHelp"])):P("",!0),Ie.value?(m(),O(ar,{key:1,visible:f(wt).show.value,"flyer-evidence-enabled":Bs.value,"concept-ranking-enabled":$s.value,onClose:f(wt).close,onRun:Ds},null,8,["visible","flyer-evidence-enabled","concept-ranking-enabled","onClose"])):P("",!0)]),"ai-session":ht(()=>[V(Gr)]),"selection-actions":ht(()=>[g("button",{onClick:t[1]||(t[1]=s=>da.value=!0),class:"inline-flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-medium bg-gradient-to-r from-emerald-500 to-green-600 hover:from-emerald-600 hover:to-green-700 text-white shadow-lg shadow-emerald-500/25 hover:shadow-emerald-500/40 transform hover:scale-105 transition-all duration-200 active:scale-95 whitespace-nowrap"},[...t[18]||(t[18]=[g("svg",{class:"w-4 h-4 flex-shrink-0",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2.5",d:"M8 7h12m0 0l-4-4m4 4l-4 4m0 6H4m0 0l4 4m-4-4l4-4"})],-1),g("span",{class:"hidden lg:inline"},"Move to Tenant",-1)])]),g("button",{onClick:t[2]||(t[2]=s=>mt.value=!0),class:"inline-flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-medium text-white bg-gradient-to-r from-amber-400 to-orange-500 hover:from-amber-500 hover:to-orange-600 shadow-lg shadow-orange-500/25 hover:shadow-orange-500/40 transform hover:scale-105 transition-all duration-200 active:scale-95 whitespace-nowrap"},[V(f(fr),{class:"w-4 h-4 flex-shrink-0"}),t[19]||(t[19]=g("span",{class:"hidden lg:inline"},"Add to Tourbook",-1))]),g("button",{onClick:t[3]||(t[3]=s=>f(Q)?f(ae)("quick_exports"):ca.value=!0),class:K([f(Q)?"opacity-50 saturate-50":"","inline-flex items-center gap-2 px-4 py-2 rounded-xl text-sm font-medium bg-gradient-to-r from-sky-400 to-blue-500 hover:from-sky-500 hover:to-blue-600 text-white shadow-lg shadow-sky-500/25 hover:shadow-sky-500/40 transform hover:scale-105 transition-all duration-200 active:scale-95 whitespace-nowrap"])},[f(Q)?(m(),O(f(vs),{key:0,class:"w-4 h-4 flex-shrink-0"})):(m(),O(f(Uo),{key:1,class:"w-4 h-4 flex-shrink-0"})),t[20]||(t[20]=g("span",{class:"hidden lg:inline"},"Quick Export",-1))],2)]),_:1},8,["is-loading","selection-mode","selected-count","search-query","search-fields","search-suggestions-url","is-searching","all-selected-shared","unified-create","showAiSiteSearchButton","ai-omnibox","ai-session-active"]),g("div",ml,[F.value?(m(),O(dr,{key:0})):(m(),A(ye,{key:1},[V(Do,{"container-class":"w-4/6 px-2",scope:ze.value,sort:me.value,"prioritize-pending-changes":ri.value,"complete-first":li.value,"removed-last":ui.value,total:Aa.value.total,"total-pending":!f(n).totalIsExact,"market-scope":f(n).marketScopeMeta,"show-all-markets":f(n).showAllMarkets,"onUpdate:scope":_n,"onUpdate:showAllMarkets":wn,"onUpdate:sort":t[7]||(t[7]=s=>me.value=s),"onUpdate:prioritizePendingChanges":t[8]||(t[8]=s=>ri.value=s),"onUpdate:completeFirst":t[9]||(t[9]=s=>li.value=s),"onUpdate:removedLast":t[10]||(t[10]=s=>ui.value=s)},null,8,["scope","sort","prioritize-pending-changes","complete-first","removed-last","total","total-pending","market-scope","show-all-markets"]),g("div",hl,[g("button",{type:"button","aria-pressed":Xe.value,title:Xe.value?"Hide map":"Show map",class:K(["relative flex h-[32px] items-center gap-1.5 rounded-full px-3.5 text-xs font-semibold transition-all duration-200 flex-shrink-0",Xe.value?"bg-emerald-600 text-white":"border border-gray-200 bg-gray-100 text-gray-600 hover:border-emerald-300 hover:bg-emerald-50 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700"]),onClick:on},[V(f(mr),{class:"w-3.5 h-3.5"}),t[21]||(t[21]=Se(" Map ",-1)),se.value?(m(),A("span",bl)):P("",!0)],10,pl),g("button",{type:"button","aria-pressed":xt.value,title:xt.value?"Hide filters":"Show filters",class:K(["flex h-[32px] items-center gap-1.5 rounded-full px-3.5 text-xs font-semibold transition-all duration-200 flex-shrink-0",xt.value?"bg-slate-900 text-white dark:bg-white dark:text-slate-950":"border border-gray-200 bg-gray-100 text-gray-600 hover:border-slate-300 hover:bg-white dark:border-gray-700 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700"]),onClick:ln},[V(f(pr),{class:"w-3.5 h-3.5"}),t[22]||(t[22]=Se(" Filter ",-1)),di.value>0?(m(),A("span",_l,J(di.value),1)):P("",!0)],10,yl),se.value?(m(),A("div",wl,[g("button",{type:"button",class:"flex items-center gap-1.5",title:"Show the map to adjust the visible area",onClick:rn},[...t[23]||(t[23]=[g("span",{class:"h-1.5 w-1.5 rounded-full bg-blue-500"},null,-1),Se(" Visible Map Area ",-1)])]),g("button",{type:"button",title:"Remove the visible-area filter",class:"ml-0.5 rounded-full p-0.5 text-blue-500 hover:bg-blue-100 hover:text-blue-700 dark:hover:bg-blue-800/50",onClick:In},[V(f(ii),{class:"w-3.5 h-3.5"})])])):P("",!0)])],64))]),g("div",kl,[g("div",{class:K([Fa.value?"w-4/6":"w-full","flex flex-col relative"])},[Ts.value?(m(),A("div",Sl,[g("div",xl,[V(f(Jo),{class:"w-4 h-4 flex-shrink-0"}),t[24]||(t[24]=g("span",{class:"truncate"},"Couldnât refresh the list. Your filters are applied â the results below may be out of date.",-1))]),g("button",{type:"button",onClick:Ls,disabled:_t.value,class:"flex-shrink-0 inline-flex items-center gap-1.5 rounded-lg bg-amber-600 px-3 py-1.5 text-xs font-semibold text-white transition-colors hover:bg-amber-700 disabled:cursor-not-allowed disabled:opacity-50"},[V(f(br),{class:K(["w-3.5 h-3.5",{"animate-spin":_t.value}])},null,8,["class"]),t[25]||(t[25]=Se(" Retry ",-1))],8,Al)])):P("",!0),g("div",{ref_key:"cardsContainerRef",ref:X,class:K(["cards-container",{"cards-with-new-insertion":kn.value,"browse-refreshing":xi.value}]),onWheelPassive:un,onTouchstartPassive:dn,onTouchmovePassive:cn,onKeydown:vn,onPointerdown:gn,style:Nt({"--card-min-width":Ii.value+"px"})},[xi.value?(m(),A("div",Il,[V(f(_a),{class:"w-3.5 h-3.5 animate-spin"}),g("span",null,J(Xs.value),1)])):P("",!0),Zs.value?(m(),A("div",Ml,[(m(!0),A(ye,null,pt(Fs.value,s=>(m(),A("div",{key:`sk-${s}`,class:"card-wrapper"},[V(Bo,{index:s-1},null,8,["index"])]))),128))])):(m(),A("div",{key:2,class:"virtual-sp
2acer",style:Nt({height:mn.value+"px"})},[g("div",{class:K(["responsive-card-grid virtual-grid transition-opacity duration-300",{"virtual-grid--seamed":F.value,"opacity-50":F.value&&f(k).thinking.value&&re.value.length>0}]),style:Nt({transform:`translateY(${hn.value}px)`})},[F.value?(m(!0),A(ye,{key:0},pt(Zt.value.cells,s=>(m(),A(ye,{key:s.key},[s.kind==="divider"?(m(),A("div",Cl,[t[26]||(t[26]=g("span",{class:"set-aside-divider__line","aria-hidden":"true"},null,-1)),g("span",Rl,"Set aside · "+J(Bn.value),1),t[27]||(t[27]=g("span",{class:"set-aside-divider__hint"},"removed from their source or may be leased â kept below the live results",-1)),t[28]||(t[28]=g("span",{class:"set-aside-divider__line","aria-hidden":"true"},null,-1))])):s.kind==="filler"?(m(),A("div",Pl)):(m(),A("div",{key:2,class:K(["card-wrapper relative group/aicard transition-opacity duration-200",{"ai-card-set-aside":!!s.req.lease_signal_kind}]),"data-req-id":s.req.id,onMouseenter:d=>Ni(s.req.id),onMouseleave:d=>Vi(s.req.id)},[V(ds,{requirement:s.req,images:s.req.images,mode:"savedavails","show-image-carousel":!1,"selection-mode":!1,theme:D.value,"is-hovered":Ne.value===s.req.id,"show-share-controls":!1,"show-ai-floorplans-badge":!1,"show-linked-comps-badge":!1,"show-share-source-icon":!1,"hide-score":!f(k).store.softScoringActive,"hide-multi-space-indicator":!0,"space-override-label":f(vr)(s.req),onEdit:Xi,onCardClick:Zi,onRequestImages:ji},{"image-overlay":ht(()=>[g("div",{class:K(["absolute bottom-2 right-2 z-10 flex gap-1 transition-opacity duration-150",Qt(s.req)?"opacity-100":"opacity-0 group-hover/aicard:opacity-100"])},[g("button",{type:"button",class:K(["inline-flex items-center gap-1 rounded-full px-2 py-1 text-[10.5px] font-semibold shadow-sm border transition-colors",Qt(s.req)?"bg-purple-600 border-purple-600 text-white":"bg-white/95 dark:bg-gray-800/95 border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-300 hover:border-purple-300 hover:text-purple-700"]),title:Qt(s.req)?"Unlock â stop pinning this property":"Lock â keep this property in the shortlist",onClick:Vt(d=>f(k).toggleLock(s.req),["stop"])},[V(f(vs),{class:"w-3 h-3"}),Se(" "+J(Qt(s.req)?"Locked":"Lock"),1)],10,Fl),g("button",{type:"button",class:"inline-flex items-center gap-1 rounded-full px-2 py-1 text-[10.5px] font-semibold shadow-sm border bg-white/95 dark:bg-gray-800/95 border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-300 hover:border-red-300 hover:text-red-600 transition-colors",title:"Hide this result from the current search",onClick:Vt(d=>f(k).rejectResult(s.req),["stop"])},[V(f(ii),{class:"w-3 h-3"}),t[29]||(t[29]=Se(" Hide ",-1))],8,Tl)],2)]),_:2},1032,["requirement","images","theme","is-hovered","hide-score","space-override-label"]),g("div",Ll,[Ws.value&&wi.value.length&&f(k).rubricChecksFor(s.req)?(m(),O(vl,{key:0,rows:wi.value,payload:f(k).rubricChecksFor(s.req),"fetch-receipts":f(k).fetchRubricReceipts},null,8,["rows","payload","fetch-receipts"])):P("",!0)])],42,El))],64))),128)):(m(!0),A(ye,{key:1},pt(Zt.value.items,s=>(m(),O(ds,{key:s.id,requirement:s,images:s.images,mode:"savedavails","show-image-carousel":!1,"selection-mode":he.value,"is-selected":H.value.includes(s.id),theme:D.value,"highlighted-content":Nn(s),"is-hovered":Ne.value===s.id,"is-shared":s.shared,"show-share-controls":!0,"show-ai-floorplans-badge":!1,"show-linked-comps-badge":!1,"show-share-source-icon":!1,"show-source":Ti.value,"is-processing":s.isProcessing,"images-loading":s.imagesLoading,class:K(["card-wrapper",{"animate-new-card":Be.value.has(s.saved_avail_id||s.id)&&!s.isProcessing},{"animate-delete-card":Ht.value.has(s.id)}]),onEdit:Xi,onToggleSelect:no,onMouseenter:d=>Ni(s.id),onMouseleave:d=>Vi(s.id),onCardClick:Zi,onRequestImages:ji,onToggleShare:mo,onShareBlocked:ho,"data-req-id":s.id},null,8,["requirement","images","selection-mode","is-selected","theme","highlighted-content","is-hovered","is-shared","show-source","is-processing","images-loading","class","onMouseenter","onMouseleave","data-req-id"]))),128))],6)],4)),Ks.value||Ea.value?(m(),A("div",Bl,[g("div",$l,J(en.value),1),g("div",Dl,J(tn.value),1)])):P("",!0),g("div",{ref_key:"loadMoreSentinelRef",ref:Mi,class:"h-1"},null,512),Ra.value>0||Ce.value&&At.value?(m(),O(us,{key:4,loading:La.value,"has-more":At.value,"load-more-label":Ce.value?"Check more matches":void 0,"loading-label":Ce.value?"Checking more flyersâ¦":void 0,loaded:re.value.length,"total-pending":Si.value,onLoadMore:Ze},null,8,["loading","has-more","load-more-label","loading-label","loaded","total-pending"])):P("",!0)],38),Ra.value>0||Ce.value&&At.value?(m(),A("div",Nl,[V(us,{variant:"bar",loading:La.value,"has-more":At.value,"load-more-label":Ce.value?"Check more matches":void 0,"loading-label":Ce.value?"Checking more flyersâ¦":void 0,loaded:re.value.length,total:Ra.value,"total-pending":Si.value,onLoadMore:Ze},null,8,["loading","has-more","load-more-label","loading-label","loaded","total","total-pending"])])):P("",!0)],2),Fa.value?(m(),A("div",{key:0,ref_key:"sidePanelColumnRef",ref:Pa,class:"w-2/6 mt-2 relative"},[Xe.value&&!W.value?(m(),A(ye,{key:0},[V(f(x),{ref_key:"mapWithPolygonRef",ref:T,class:"h-full rounded-lg overflow-hidden",markers:F.value?f(k).mapMarkers.value:Sn.value,"overlay-markers":F.value?f(k).mapOverlayMarkers.value:[],polygons:F.value?f(k).mapPolygons.value:Sa.value,"highlight-id":Ne.value,theme:D.value,"fit-to-markers":!1,"show-drawing-tools":hi.value&&!F.value,"ai-editable":F.value,"editable-polygons":F.value?f(k).store.drawnPolygons||[]:[],"initial-center":Wa.value,"initial-zoom":ja.value,onViewportChanged:xn,onMarkerMouseenter:Rn,onMarkerMouseleave:Pn,onMarkerClick:En,onPolygonsUpdated:Qs,onPolygonCreated:Cs,onPolygonFilterChanged:fi,onClearPolygonFilter:Ps},null,8,["markers","overlay-markers","polygons","highlight-id","theme","show-drawing-tools","ai-editable","editable-polygons","initial-center","initial-zoom"]),V(Po,{"enter-active-class":"transition ease-out duration-200","enter-from-class":"opacity-0 translate-y-1","enter-to-class":"opacity-100 translate-y-0","leave-active-class":"transition ease-in duration-150","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:ht(()=>[Ie.value&&za.value&&!F.value?(m(),A("div",Vl,[V(f(_a),{class:"w-3 h-3 animate-spin text-blue-500"}),Se(" "+J(Rt.value.length?"Updating mapâ¦":"Loading mapâ¦"),1)])):P("",!0)]),_:1}),F.value?P("",!0):(m(),A("div",{key:0,class:K(["absolute z-20 flex flex-col gap-2",hi.value?"top-12 left-2":"top-3 left-3"])},[g("div",Ol,[g("button",{type:"button",onClick:An,class:K(["flex items-center justify-center w-10 h-10 rounded-full shadow-lg backdrop-blur-sm transition-all duration-200 border",se.value?"bg-blue-600 text-white border-blue-500 shadow-blue-200/50 dark:shadow-blue-900/30":"bg-white/90 dark:bg-gray-800/90 text-gray-600 dark:text-gray-300 border-gray-200 dark:border-gray-700 hover:bg-white dark:hover:bg-gray-800 hover:border-blue-300 dark:hover:border-blue-600"])},[V(f(hr),{class:"w-5 h-5"})],2),t[30]||(t[30]=g("div",{class:"absolute left-12 top-1/2 -translate-y-1/2 px-2.5 py-1.5 bg-gray-900 dark:bg-gray-700 text-white text-xs rounded-md whitespace-nowrap opacity-0 pointer-events-none group-hover:opacity-100 transition-opacity duration-150 shadow-md"}," Filter by visible map area ",-1))])],2))],64)):xt.value?(m(),O(f(L),{key:1,modelValue:wa.value,"onUpdate:modelValue":t[11]||(t[11]=s=>wa.value=s)},null,8,["modelValue"])):P("",!0)],512)):P("",!0)])])]),$e.value?(m(),O(f(l),{key:`wizard-${(a=b.value)==null?void 0:a.id}-${de.value}-${Ue.value?"freeform":"blank"}`,"form-data":b.value||Wt.value,"form-route":"/savedavails","is-saved-avail":!0,"listing-mode":kt.value,mode:b.value?"editSavedAvail":"create","initial-step":
2xe.value,"highlight-field":ue.value,"space-index":de.value,"validation-issues":((u=(o=(i=b.value)==null?void 0:i.spaces)==null?void 0:o[de.value])==null?void 0:u.validation_issues)||[],"link-to-comp-id":Jt.value,"freeform-meta":Ue.value,onClose:qi,onUpdate:to,onSubmit:fo,onBack:Hs},null,8,["form-data","listing-mode","mode","initial-step","highlight-field","space-index","validation-issues","link-to-comp-id","freeform-meta"])):P("",!0),Ye.value?(m(),O(f(_),{key:1,"initial-state":jt.value,"is-importing":$t.value,"upload-progress":Dt.value,"import-error":ft.value,"import-results":oa.value,"server-duplicate-info":la.value,"requires-reauth":ua.value,onClose:Ca,onOpenManual:Os,onOpenExisting:Us,onReview:zs,onCreated:Js,onImport:os,onViewExisting:rs},null,8,["initial-state","is-importing","upload-progress","import-error","import-results","server-duplicate-info","requires-reauth"])):P("",!0),W.value?(m(),O(f(ge),{key:2,show:W.value,requirement:b.value,"is-organization-mode":Ti.value,"from-saved-avails":!0,"matched-space-ids":Ut.value,"search-context":Ia.value,"open-pending-change-id":Ma.value,"all-requirements":re.value,onClose:eo,onRefresh:We,onEdit:ao,onNavigate:Yn,onRequirementUpdated:Kn,onAddCompToProperty:Zn},null,8,["show","requirement","is-organization-mode","matched-space-ids","search-context","open-pending-change-id","all-requirements"])):P("",!0),Lt.value?(m(),O(f(E),{key:3,modelValue:Lt.value,"onUpdate:modelValue":t[12]||(t[12]=s=>Lt.value=s),"is-importing":$t.value,"upload-progress":Dt.value,"import-error":ft.value,"import-results":oa.value,"server-duplicate-info":la.value,"requires-reauth":ua.value,onImport:os,onClose:ns,onViewExisting:rs},null,8,["modelValue","is-importing","upload-progress","import-error","import-results","server-duplicate-info","requires-reauth"])):P("",!0),ra.value?(m(),A("div",zl,[g("div",Hl,[g("div",Ul,[g("h4",Jl,J(Tn.value),1),g("p",Wl,J(Ln.value),1)]),g("div",jl,[g("button",{onClick:t[13]||(t[13]=s=>ra.value=!1),class:"px-6 py-2 text-gray-700 dark:text-foreground hover:bg-gray-100 dark:hover:bg-gray-700 rounded-lg transition-colors font-medium"}," Cancel "),g("button",{onClick:co,class:"px-6 py-2 bg-red-600 hover:bg-red-700 text-white rounded-lg transition-colors flex items-center gap-2 font-medium"},[...t[31]||(t[31]=[g("svg",{xmlns:"http://www.w3.org/2000/svg",class:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","stroke-width":"2"},[g("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})],-1),Se(" Confirm ",-1)])])])])])):P("",!0),da.value?(m(),O(f(ve),{key:5,show:da.value,"selected-avail-ids":H.value,onClose:t[14]||(t[14]=s=>da.value=!1),onMoved:Io},null,8,["show","selected-avail-ids"])):P("",!0),!f(Q)&&ca.value?(m(),O(f(_e),{key:6,"is-visible":!f(Q)&&ca.value,"selected-properties":dt.value,onClose:lo,onGenerated:uo},null,8,["is-visible","selected-properties"])):P("",!0),mt.value?(m(),O(f(we),{key:7,show:mt.value,"saved-avail-ids":H.value,onClose:t[15]||(t[15]=s=>mt.value=!1),onAdded:ro,onReopen:t[16]||(t[16]=s=>mt.value=!0)},null,8,["show","saved-avail-ids"])):P("",!0),na.value?(m(),O(f(G),{key:8,onClose:t[17]||(t[17]=s=>na.value=!1),onFinalized:po})):P("",!0)]}),_:1},8,["breadcrumbs"])],64))}}),Nc=ws(su,[["__scopeId","data-v-a05bf6c6"]]);export{Nc as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.