@riverbankcms/sdk 0.174.1 → 0.176.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (198) hide show
  1. package/dist/_dts/{BlocksIslandsHydrator-YRmc-Yxz.d.ts → BlocksIslandsHydrator-DvoTk7Py.d.ts} +1 -1
  2. package/dist/_dts/{Page-Du0zX1B-.d.ts → Page-D-l374tU.d.ts} +8 -16
  3. package/dist/_dts/{SdkPreviewMode-4L8v3FkY.d.ts → SdkPreviewMode-22DdQAj5.d.ts} +2 -2
  4. package/dist/_dts/{client-B1J6Akyf.d.ts → client-D4p0J1lK.d.ts} +487 -11
  5. package/dist/_dts/{content-types-CGGYI0u_.d.ts → content-types-0WWR6dC4.d.ts} +2 -2
  6. package/dist/_dts/{contracts-CHMlw9hT.d.ts → contracts-f_ZG_SwY.d.ts} +8 -8
  7. package/dist/_dts/{footerPageOutline-DIHSU1Vr.d.ts → footerPageOutline-DSeZvOaj.d.ts} +85 -8
  8. package/dist/_dts/{generatePageMetadata-JITXD6BU.d.ts → generatePageMetadata-BlitPA2D.d.ts} +2 -2
  9. package/dist/_dts/{index-BLEKFHt1.d.ts → index-CKkkCgb6.d.ts} +1 -1
  10. package/dist/_dts/{index-yWDbUojb.d.ts → index-CoLcwjqJ.d.ts} +1 -1
  11. package/dist/_dts/{index-DpJm0NpL.d.ts → index-D-ai8IQd.d.ts} +4 -4
  12. package/dist/_dts/{index-CXZSy_9M.d.ts → index-DDsfmM4d.d.ts} +2 -2
  13. package/dist/_dts/{index-CF62FntA.d.ts → index-EJMo-KSo.d.ts} +2 -2
  14. package/dist/_dts/{index-D9ZYmGAJ.d.ts → index-ZKEDvLuN.d.ts} +1 -1
  15. package/dist/_dts/{index-BgOr1Xyz.d.ts → index-tcPtGdag.d.ts} +3 -3
  16. package/dist/_dts/{loadContent-M-s0p0rq.d.ts → loadContent-Ci932ORy.d.ts} +7 -7
  17. package/dist/_dts/{request-BK-pHf0P.d.ts → request-B8jVdvgI.d.ts} +1993 -407
  18. package/dist/_dts/{resolveBlockData-DZAlnhwt.d.ts → resolveBlockData-DrSMuD76.d.ts} +5 -5
  19. package/dist/_dts/{resolvePageContent-DXUCWJ3y.d.ts → resolvePageContent-Be4iL6-F.d.ts} +2 -2
  20. package/dist/_dts/sdk/src/bookings/index.d.ts +2 -2
  21. package/dist/_dts/sdk/src/client/types.d.ts +2 -2
  22. package/dist/_dts/sdk/src/client.d.ts +7 -7
  23. package/dist/_dts/sdk/src/config/index.d.ts +6 -6
  24. package/dist/_dts/sdk/src/config/template-validation.d.ts +1 -1
  25. package/dist/_dts/sdk/src/config/validation.d.ts +1 -1
  26. package/dist/_dts/sdk/src/data/dataLoaderContext.d.ts +2 -2
  27. package/dist/_dts/sdk/src/data/resolveBlockData.d.ts +1 -1
  28. package/dist/_dts/sdk/src/data/types.d.ts +2 -2
  29. package/dist/_dts/sdk/src/gifting/client.d.ts +13 -1
  30. package/dist/_dts/sdk/src/index.d.ts +8 -8
  31. package/dist/_dts/sdk/src/manifest/index.d.ts +3 -3
  32. package/dist/_dts/sdk/src/metadata/index.d.ts +1 -1
  33. package/dist/_dts/sdk/src/navigation/index.d.ts +3 -3
  34. package/dist/_dts/sdk/src/next/index.d.ts +7 -7
  35. package/dist/_dts/sdk/src/next/middleware.d.ts +2 -2
  36. package/dist/_dts/sdk/src/page-converter/index.d.ts +3 -3
  37. package/dist/_dts/sdk/src/portal/client.d.ts +3 -2
  38. package/dist/_dts/sdk/src/prebuild/index.d.ts +1 -1
  39. package/dist/_dts/sdk/src/preview-next/before-render.d.ts +2 -2
  40. package/dist/_dts/sdk/src/preview-next/client/index.d.ts +2 -2
  41. package/dist/_dts/sdk/src/preview-next/client/runtime.d.ts +1 -1
  42. package/dist/_dts/sdk/src/rendering/client.d.ts +2 -2
  43. package/dist/_dts/sdk/src/rendering/components/pageShared.d.ts +1 -1
  44. package/dist/_dts/sdk/src/rendering/helpers/loadPage.d.ts +1 -1
  45. package/dist/_dts/sdk/src/rendering/helpers/pageRuntimeSupport.d.ts +5 -177
  46. package/dist/_dts/sdk/src/rendering/index.d.ts +7 -7
  47. package/dist/_dts/sdk/src/rendering/islands/client.d.ts +1 -1
  48. package/dist/_dts/sdk/src/rendering/server.d.ts +3 -3
  49. package/dist/_dts/sdk/src/rendering/themeAdmission.d.ts +1 -1
  50. package/dist/_dts/sdk/src/routing/index.d.ts +5 -5
  51. package/dist/_dts/sdk/src/server.d.ts +5 -5
  52. package/dist/_dts/sdk/src/spam-protection/index.d.ts +2 -2
  53. package/dist/_dts/sdk/src/theme/index.d.ts +2 -1
  54. package/dist/_dts/{types-CwmB2NHU.d.ts → types-BXMX4z2j.d.ts} +7 -7
  55. package/dist/_dts/{types-DjVNADXR.d.ts → types-DXY64Xh4.d.ts} +4 -4
  56. package/dist/_dts/{types-Dmow_FI6.d.ts → types-lwSgCWZ4.d.ts} +11 -2
  57. package/dist/_dts/{validation-h8t1HLlL.d.ts → validation-C5xp--Fu.d.ts} +7 -4
  58. package/dist/client/{BlocksIslandsHydrator-DRVx_XLi.mjs → BlocksIslandsHydrator-CeYQQQs7.mjs} +17 -16
  59. package/dist/client/{BookingMailingListNote-CwrMzj-k.mjs → BookingMailingListNote-CDDWrY_W.mjs} +6 -6
  60. package/dist/client/{BookingPanelArrangement-C2_hFT6K.mjs → BookingPanelArrangement-BShQSial.mjs} +1 -1
  61. package/dist/client/{BookingQuestionFields-DZMrGvBh.mjs → BookingQuestionFields-MbvIo2jS.mjs} +3 -3
  62. package/dist/client/{CalendarNavigationChevron-Az1-TIEI.mjs → CalendarNavigationChevron-C6CSVfEB.mjs} +36 -11
  63. package/dist/client/DemoBookingPortalAccess-C9Ggcfx3.mjs +545 -0
  64. package/dist/client/{EventCalendar.client-CDkkP-Lv.mjs → EventCalendar.client-BSMuSqg0.mjs} +15 -25
  65. package/dist/client/{EventCombined.client-DK3aaz62.mjs → EventCombined.client-BTrmSyUB.mjs} +25 -17
  66. package/dist/client/{EventItem-WeUipfIP.mjs → EventItem-B0WjGXsH.mjs} +4 -3
  67. package/dist/client/{EventListWeekNavigation-D3sbAeDo.mjs → EventListWeekNavigation-8Ij7vuxY.mjs} +1 -1
  68. package/dist/client/{EventListing.client-DL3gGGmF.mjs → EventListing.client-CWk2NEwd.mjs} +3 -3
  69. package/dist/client/{EventListing.view-DKFImKOx.mjs → EventListing.view-BEH4UbSL.mjs} +18 -8
  70. package/dist/client/{EventRegistrationPayment-Dn9TpWyL.mjs → EventRegistrationPayment-B2EikR3f.mjs} +635 -359
  71. package/dist/client/{LocationMapActions-BJT7MqP2.mjs → LocationMapActions-myIQIvQL.mjs} +1 -1
  72. package/dist/client/{MapDrawingSvg-DCIwlON6.mjs → MapDrawingSvg-BfsVyPvB.mjs} +2 -22
  73. package/dist/client/{Page-BpeP9xdt.mjs → Page-F3lhDvw1.mjs} +1036 -953
  74. package/dist/client/{DemoBookingPortalAccess-1p-pJ1lg.mjs → SiteTermsAgreementField-BYACYP0T.mjs} +4 -301
  75. package/dist/client/{StepIndicator-CP6zrwkl.mjs → StepIndicator-Bb7rPtSq.mjs} +37 -12
  76. package/dist/client/{accordion-nR7D4m1a.mjs → accordion-BfsOiweL.mjs} +1 -1
  77. package/dist/client/{booking-form.client-Ce-mQZ7W.mjs → booking-form.client-B8ohIj13.mjs} +229 -42
  78. package/dist/client/{bookingForm-B-qT_AQB.mjs → bookingForm-CXsck2oH.mjs} +4 -4
  79. package/dist/client/bookings.mjs +22 -15
  80. package/dist/client/{boxStyleClassNames-CrE3TDpW.mjs → boxStyleClassNames-B_hcuT06.mjs} +2 -1
  81. package/dist/client/{carousel-CVUOatsY.mjs → carousel-Cz5Ddbsx.mjs} +1 -1
  82. package/dist/client/{cart-DE0K6E0R.mjs → cart-CTC2oS3p.mjs} +3 -3
  83. package/dist/client/{cart.client-C23E6WQ5.mjs → cart.client-c1YkTC-Q.mjs} +1 -1
  84. package/dist/client/{checkout-76cdHyPL.mjs → checkout-BeW1ufaH.mjs} +3 -3
  85. package/dist/client/{checkout.client-DJOzqb26.mjs → checkout.client-BeU32khQ.mjs} +1 -1
  86. package/dist/client/{checkoutUrls-CvIP5DCO.mjs → checkoutUrls-DVfSUSKp.mjs} +1 -1
  87. package/dist/client/client.mjs +145 -21
  88. package/dist/client/{context-CNlesLfF.mjs → context-R9p5c8IH.mjs} +76 -58
  89. package/dist/client/{course-DHIrXqNT.mjs → course-CUFVJEAc.mjs} +2 -2
  90. package/dist/client/{creditProducts-KYMVIH3J.mjs → creditProducts-BQ1t1erI.mjs} +14 -61
  91. package/dist/client/{dateFormatting-B73Ll0s4.mjs → dateFormatting-CF6FWCoo.mjs} +1 -1
  92. package/dist/client/{demoPortalMagicLink-BVbLD4pi.mjs → demoPortalMagicLink-tZxIm3RL.mjs} +1 -1
  93. package/dist/client/display-4HYOb-AK.mjs +11844 -0
  94. package/dist/client/{enhanceHeaderSection-5GD5o4Mt.mjs → enhanceHeaderSection-DEYDI54E.mjs} +3 -3
  95. package/dist/client/{event-details.client-D7Oz1q2L.mjs → event-details.client-BwjBJP-f.mjs} +1 -1
  96. package/dist/client/{event-registration.client-zbuX36aA.mjs → event-registration.client-DWvSODTI.mjs} +176 -75
  97. package/dist/client/{eventCalendar-uZrksODt.mjs → eventCalendar-C9Pn9eeZ.mjs} +4 -4
  98. package/dist/client/{eventCombined-DxhvNAx8.mjs → eventCombined-Bdhk0fp0.mjs} +4 -4
  99. package/dist/client/{eventDetails-DCIH4BYG.mjs → eventDetails-C2LfNW_o.mjs} +2 -2
  100. package/dist/client/{eventListing-B9KrnPvc.mjs → eventListing-B-bJOQUk.mjs} +4 -4
  101. package/dist/client/{eventRegistration-TjnURMKl.mjs → eventRegistration-CbdmUiDT.mjs} +4 -4
  102. package/dist/client/{form-CfqIAhfN.mjs → form-BbUUt784.mjs} +3 -3
  103. package/dist/client/{form.client-CL6fF0cW.mjs → form.client-BVlz-9_t.mjs} +4 -4
  104. package/dist/client/{form.parts-Bf-L66Gg.mjs → form.parts-TB4UIrML.mjs} +1 -1
  105. package/dist/client/{formatDate-Dp7POa9Y.mjs → formatDate-TDHhFjFN.mjs} +1 -1
  106. package/dist/client/gifting/client.mjs +5 -3
  107. package/dist/client/gifting-CbNSrp7C.mjs +28 -0
  108. package/dist/client/gifting.client-B__bGhFc.mjs +404 -0
  109. package/dist/client/gifting.parts-CTA1sDW6.mjs +86 -0
  110. package/dist/client/{headerSection-WVXtOcuW.mjs → headerSection-5Wn9nUW_.mjs} +2 -2
  111. package/dist/client/{display-Cf_j5stk.mjs → lookSurfaces-BwiNdgMU.mjs} +2951 -14395
  112. package/dist/client/{newsletter-form.client-Bb7GAZpO.mjs → newsletter-form.client-B17WYHxZ.mjs} +7 -5
  113. package/dist/client/{newsletter-form.parts-BqOVRdIc.mjs → newsletter-form.parts-DN9wD1ZG.mjs} +3 -3
  114. package/dist/client/{newsletterForm-DOVe-qY3.mjs → newsletterForm-DLMlxInp.mjs} +3 -3
  115. package/dist/client/{noop-D5mFWXtN.mjs → noop-CaQxI-Js.mjs} +94 -36
  116. package/dist/client/portal/client.mjs +313 -148
  117. package/dist/client/{product-detail.client-CNzeFnFf.mjs → product-detail.client-Di_anRGR.mjs} +1 -1
  118. package/dist/client/{product-list.client-LKpzC7pj.mjs → product-list.client-Duhl6rtL.mjs} +1 -1
  119. package/dist/client/{productDetail-D2JNeEgx.mjs → productDetail-BgKmCwA8.mjs} +3 -3
  120. package/dist/client/{productList-DTgZXOEq.mjs → productList-C_wMKsYS.mjs} +3 -3
  121. package/dist/client/{propsDecoder-mpBQt2AT.mjs → propsDecoder-y3LvxaiG.mjs} +4 -3
  122. package/dist/client/{registry.server-DdTJyar2.mjs → registry.server-CIWYKz1V.mjs} +369 -246
  123. package/dist/client/rendering/client.mjs +25 -491
  124. package/dist/client/rendering/islands.mjs +1 -1
  125. package/dist/client/rendering.mjs +87 -21
  126. package/dist/client/{richText-coerce-C32cRQ03.mjs → richText-coerce-DkPBFb_a.mjs} +1 -1
  127. package/dist/client/{routeIslandApiConfig-8cfSgT0E.mjs → routeIslandApiConfig-BgO0rZce.mjs} +1 -1
  128. package/dist/client/{shop-5LBhftWx.mjs → shop-CFbWlv_W.mjs} +3 -3
  129. package/dist/client/{shop-discount-apply.state-D0ifS6KX.mjs → shop-add-feedback-DvC2kP1K.mjs} +1 -78
  130. package/dist/client/{shop-commerce-DkValjZj.mjs → shop-commerce-C-I29eaA.mjs} +64 -32
  131. package/dist/client/{shop-commerce-store-BOmXFmk_.mjs → shop-commerce-store-DGcc7twO.mjs} +1 -1
  132. package/dist/client/shop-discount-apply.state-DOm7vx0X.mjs +83 -0
  133. package/dist/client/{shop.client-BTtZqNmv.mjs → shop.client-GHTWUKD6.mjs} +56 -19
  134. package/dist/client/{shop.interactive-DNRqG4aX.mjs → shop.interactive-CxDJ8P2r.mjs} +113 -35
  135. package/dist/client/{shopShared-Nky6kPYr.mjs → shopShared-Be9QJJpT.mjs} +2 -2
  136. package/dist/client/{timetableModel-DZArznD_.mjs → timetableModel--R0zVzZO.mjs} +10 -10
  137. package/dist/client/{useAvailableSlots-CUVRD1nx.mjs → useAvailableSlots-BGu_2F50.mjs} +3 -3
  138. package/dist/client/{useDiscountCodeUi-d7viY_mu.mjs → useDiscountCodeUi-I_mXI9Yd.mjs} +32 -17
  139. package/dist/client/{useEventPagination-Da2JqxGC.mjs → useEventPagination-DxIJ--JZ.mjs} +7 -6
  140. package/dist/client/{view-BvuYmQJ5.mjs → view-3foOzGWR.mjs} +3 -2
  141. package/dist/client/{view-D9ObkFtz.mjs → view-BbzH5MQb.mjs} +128 -32
  142. package/dist/preview-next/client/{PageSectionToolbar-DwxHT-2k.mjs → PageSectionToolbar-0xyUPWUB.mjs} +4 -4
  143. package/dist/preview-next/client/{PreviewEditorSidebar-D4SBxGU6.mjs → PreviewEditorSidebar-D8vUzXtI.mjs} +61 -55
  144. package/dist/preview-next/client/{PreviewEditorUI-D8mUct32.mjs → PreviewEditorUI-CRjS4gAu.mjs} +4 -4
  145. package/dist/preview-next/client/{PreviewShell-L2AEdNUQ.mjs → PreviewShell-BvdBdeH_.mjs} +5 -5
  146. package/dist/preview-next/client/{SdkPreviewModeRuntime-bhVAU2D2.mjs → SdkPreviewModeRuntime-DWTyKbFj.mjs} +156 -143
  147. package/dist/preview-next/client/{previewAssistantSlot-Jpj_HDra.mjs → previewAssistantSlot-BqY2TTcZ.mjs} +4535 -2913
  148. package/dist/preview-next/client/{previewChromeRoot-CYTDvx4u.mjs → previewChromeRoot-BuRYe2iL.mjs} +1 -1
  149. package/dist/preview-next/client/runtime.mjs +3 -3
  150. package/dist/preview-next/client/{sdk-runtime-CZHX6J_4.mjs → sdk-runtime-BnK5kH9f.mjs} +2 -2
  151. package/dist/preview-next/client/{siteStyleAccess-DmGIG9Hk.mjs → siteStyleAccess-DbKozRSn.mjs} +527 -236
  152. package/dist/preview-next/client/{useAutosaveStatus-DQCyswQ-.mjs → useAutosaveStatus-D9s6dyMW.mjs} +1 -1
  153. package/dist/preview-next/client/{useOpenBlockForSetup-LwE5yXvL.mjs → useOpenBlockForSetup-Ce4WCxpT.mjs} +28 -5
  154. package/dist/preview-next/container-responsive.css +51 -3
  155. package/dist/preview-next/keepAlive.mjs +1 -1
  156. package/dist/preview-next/middleware.mjs +1 -1
  157. package/dist/preview-next/{route-contract-BOuNcOcN.mjs → route-contract-BYezcMx5.mjs} +94 -12
  158. package/dist/server/{Block.shared-wfJfhs08.mjs → Block.shared-Cn7gg13_.mjs} +84 -16
  159. package/dist/server/{ThemeScopeCore-BtrJNHTB.mjs → ThemeScopeCore-DFEM1a85.mjs} +16 -2
  160. package/dist/server/{bindings-P1CF2Gm6.mjs → bindings-VGgS6UvF.mjs} +13 -34
  161. package/dist/server/{client-CGtU5fHI.mjs → client-Bvag5OtW.mjs} +145 -22
  162. package/dist/server/config-validation.mjs +1 -1
  163. package/dist/server/config.mjs +2 -2
  164. package/dist/server/{customCss-BGB8gMVb.mjs → customCss-BZ8YSrQg.mjs} +1 -0
  165. package/dist/server/data/resolveBlockData.mjs +1 -1
  166. package/dist/server/index.mjs +2 -2
  167. package/dist/server/{loadContent-ChnkJSay.mjs → loadContent-CxASA3PE.mjs} +6 -9
  168. package/dist/server/{loadPage-DesHhgxj.mjs → loadPage-CQgde5DN.mjs} +2 -2
  169. package/dist/server/{lookMediaFrame-BBr0mkze.mjs → lookMediaFrame-CaH018pK.mjs} +24 -5
  170. package/dist/server/mapLocation-BM5WX7FY.mjs +315 -0
  171. package/dist/server/next.mjs +35 -9
  172. package/dist/server/{overrideResolution-DHEkHcZs.mjs → overrideResolution-BqVLO4gX.mjs} +1 -1
  173. package/dist/server/page-converter.mjs +1 -1
  174. package/dist/server/{pageRenderPlan-0jvm0RBk.mjs → pageRenderPlan-CfSnAkCO.mjs} +67 -40
  175. package/dist/server/{pageRuntimeSupport-8-f1Zr9e.mjs → pageRuntimeSupport-uz4gzBOo.mjs} +7 -15
  176. package/dist/server/{pageShared-CuVFoV4z.mjs → pageShared-D23o5QgC.mjs} +1068 -891
  177. package/dist/server/{parseThemeForPersistence-Cwqb5pZx.mjs → parseThemeForPersistence-DOsfofCy.mjs} +1 -1
  178. package/dist/server/{prebuild-Bms_Y7wQ.mjs → prebuild-BuoXWT9y.mjs} +1 -1
  179. package/dist/server/prebuild.mjs +1 -1
  180. package/dist/server/{prefetchBlockData-5oC5kyHe.mjs → prefetchBlockData-CCiYV8_s.mjs} +21 -6
  181. package/dist/server/{registry-DmqxC8th.mjs → registry-CXRXsFSx.mjs} +19721 -19621
  182. package/dist/server/rendering/components/pageShared.mjs +1 -1
  183. package/dist/server/rendering/helpers/loadPage.mjs +1 -1
  184. package/dist/server/rendering/helpers/pageRuntimeSupport.mjs +1 -1
  185. package/dist/server/rendering/server.mjs +4 -4
  186. package/dist/server/rendering.mjs +7 -7
  187. package/dist/server/{resolveBlockData-EYogtwQc.mjs → resolveBlockData-yfe8WLEA.mjs} +1 -1
  188. package/dist/server/{responseMedia-DpBC1hTM.mjs → responseMedia-F-ElH2Rd.mjs} +1 -0
  189. package/dist/server/{schema-CUDHMirj.mjs → schema-BpsqaSSU.mjs} +2 -2
  190. package/dist/server/server.mjs +3 -3
  191. package/dist/server/theme-bridge.mjs +1 -1
  192. package/dist/server/theme.mjs +2 -2
  193. package/dist/server/{validation-Bt_8IL1g.mjs → validation-CozQ7wE0.mjs} +4 -4
  194. package/dist/server/{version-DT_efohp.mjs → version-CgCWRFEY.mjs} +1 -1
  195. package/dist/styles/index.css +295 -37
  196. package/package.json +1 -1
  197. package/dist/client/useDiscountApply-BBnStWXU.mjs +0 -199
  198. package/dist/server/identity-DQD_8lNO.mjs +0 -6
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { n as useOptionalPreviewLayout } from "./PreviewLayoutContext-Dy0LwcHc.mjs";
3
- import { Ac as createRovingFocusGroupScope, Al as rgbColorValue, Ao as applyCompiledRuntimeFieldsToContent, Ar as LocationMapView, As as isRecord$1, Bc as FocusScope, Bs as unwrapResponse, Co as DEFAULT_THEME_RESPONSIVE_MODE, Dc as hideOthers, Dl as surfaceForegroundInputFromResolved, Eo as heroPhotoPaintsGround, Fc as Content$1, Fn as renderSourceFor, Gc as createCollection, Go as headerStyleRecipeForTheme, Gs as Callout, Hc as DismissableLayer, Ho as componentRuntimeRulesForTheme, Ic as Root2$1, Ir as withValueAtPath, Jc as createContextScope, Jo as compiledRuntimeStyleFieldNames, K as siteChromeHeaderLogoMayBeHardToSee, Kc as useControllableState, Lc as createPopperScope, Ll as expandPalette, Ln as resolveRenderedValues, Mc as Portal, Ml as mapDrawingStyle, Nc as Anchor, Nl as parseSurfaceTree, No as restoreCompiledRuntimeFieldsFromContent, Oc as Item, Ol as surfaceForegroundStyle, Pc as Arrow, Pl as resolveSurfaceForeground, Pn as remoteDraftValues, Po as formatSiteChromeBackgroundTokenLabel, Qc as Button, Qi as themeRuntimeScopeProps, Rc as useSize, Rs as ApiEnvelopeError, Uc as useCallbackRef, Uo as designRuntimeRulesForTheme, Vc as useFocusGuards, Wc as useDirection, Ws as VISUALLY_HIDDEN_STYLES, Xc as Primitive, Xi as buildThemeDataAttrs, Yc as composeEventHandlers, Yo as surfaceResolutionContextFromTheme, Yu as unsafeAsEditorBlockId, _c as usePortalContainer, ac as DialogContent, al as useComposedRefs, ao as coerceInlineTextWithFallback, bo as buildThemeRuntime, c as usePreviewShownTheme, cc as DialogPortal, cd as unsafeAsPositiveSeconds, cs as resolveCompiledSectionContextFromContent, da as measureSiteTopChromeBottomPx, el as useControlReadiness, es as buildGoogleFontFamilyQuery, eu as getFontWidthRange, fr as planArrangementContent, h as composePreviewTheme, ic as DialogClose, id as assertNever, jc as Presence, jo as compileEditorModelRuntime, kc as Root, lc as DialogTitle, mc as menuItemInteractionClassName, ni as getBlockDefinition, nl as createSlot, ns as getSiteFontsStorageUrl, oa as SITE_CHROME_VISIBLE_HEADER_SELECTOR, ol as cn$1, oo as deriveInlineTextFieldChanges, ou as authoredValuesEqual, pa as siteTopChromeMeasurementTargets$1, qc as useLayoutEffect2, rc as Dialog, ru as asDesignBlockId, s as usePreviewPageDesignRenderState, sd as unsafeAsPositiveByteCount, ts as generateFontFaceCss, u as useSiteChromeCustomizeOptional, uc as DialogTrigger, un as ApiRequestError, vc as ReactRemoveScroll, wo as getResponsiveScopeSpec, xn as useOptionalEditorUiStoreInstance, xo as escapeStyleContent, xr as resolveBlockVariantKey, y as applyBindingsToContent, zc as useId$1, zs as extractApiEnvelopeErrorDetails } from "./previewAssistantSlot-Jpj_HDra.mjs";
3
+ import { $c as composeEventHandlers, $i as themeRuntimeScopeProps, $u as unsafeAsEditorBlockId, Ar as LocationMapView, Bc as Root2$1, Co as buildThemeRuntime, Do as getResponsiveScopeSpec, Eo as DEFAULT_THEME_RESPONSIVE_MODE, Fc as Presence, Fn as renderSourceFor, Gc as useFocusGuards, Go as componentRuntimeRulesForTheme, Hc as useSize, Hs as ApiEnvelopeError, Ic as Portal, Il as mapDrawingStyle, Io as restoreCompiledRuntimeFieldsFromContent, Ir as withValueAtPath, Jc as useDirection, Jo as headerStyleRecipeForTheme, Js as VISUALLY_HIDDEN_STYLES, K as siteChromeHeaderLogoMayBeHardToSee, Kc as DismissableLayer, Ko as designRuntimeRulesForTheme, Lc as Anchor, Ll as parseSurfaceTree, Ln as resolveRenderedValues, Lo as formatSiteChromeBackgroundTokenLabel, Mc as Item, Ml as surfaceForegroundStyle, Nc as Root, No as applyCompiledRuntimeFieldsToContent, Ns as isRecord$1, Pc as createRovingFocusGroupScope, Pl as rgbColorValue, Pn as remoteDraftValues, Po as compileEditorModelRuntime, Qc as createContextScope, Qo as surfaceResolutionContextFromTheme, Rc as Arrow, Rl as resolveSurfaceForeground, Sc as ReactRemoveScroll, Uc as useId$1, Us as extractApiEnvelopeErrorDetails, Vc as createPopperScope, Vl as expandPalette, Wc as FocusScope, Ws as unwrapResponse, Xc as useControllableState, Yc as createCollection, Ys as Callout, Zc as useLayoutEffect2, Zi as buildThemeDataAttrs, Zo as compiledRuntimeStyleFieldNames, as as getSiteFontsStorageUrl, c as usePreviewShownTheme, cc as DialogClose, cd as assertNever, co as coerceInlineTextWithFallback, dd as unsafeAsPositiveByteCount, ds as resolveCompiledSectionContextFromContent, el as Primitive, fa as measureSiteTopChromeBottomPx, fc as DialogPortal, fd as unsafeAsPositiveSeconds, fr as planArrangementContent, h as composePreviewTheme, il as useControlReadiness, is as generateFontFaceCss, iu as getFontWidthRange, jc as hideOthers, jl as surfaceForegroundInputFromResolved, ko as heroPhotoPaintsGround, lc as DialogContent, ll as useComposedRefs, lo as deriveInlineTextFieldChanges, ma as siteTopChromeMeasurementTargets$1, mc as DialogTrigger, ni as getBlockDefinition, nl as Button, ol as createSlot, pc as DialogTitle, qc as useCallbackRef, rs as buildGoogleFontFamilyQuery, s as usePreviewPageDesignRenderState, sa as SITE_CHROME_VISIBLE_HEADER_SELECTOR, sc as Dialog, su as asDesignBlockId, u as useSiteChromeCustomizeOptional, ul as cn$1, un as ApiRequestError, uu as authoredValuesEqual, vc as menuItemInteractionClassName, wo as escapeStyleContent, xc as usePortalContainer, xn as useOptionalEditorUiStoreInstance, xr as resolveBlockVariantKey, y as applyBindingsToContent, zc as Content$1 } from "./previewAssistantSlot-BqY2TTcZ.mjs";
4
4
  import { At as sameMeaningfulAddress, C as Move, Ct as LOCATION_MATCH_THRESHOLDS_METRES, D as MapPin, Dt as editLocationValue, Et as decideLocationSave, Ft as locationPinSchema, I as Info, Kt as err, Mt as decideLocationSourcePermission, Nt as formatLocationAddress, Ot as locationDistanceMetres, Pt as locationAddressSchema, Q as ExternalLink, Rt as parseLocationValue, Tt as decideLocationRelationship, V as House, at as Circle, c as Trash2, ct as CircleCheck, dt as ChevronRight, et as Crosshair, ft as ChevronLeft, g as RotateCcw, gt as Building2, h as Route, kt as sameLocationSpatialPair, l as Store, mt as Check, n as X, p as Search, pt as ChevronDown, qt as ok, r as WifiOff, s as TriangleAlert, ut as ChevronUp, v as Plus, w as Mountain, wt as confirmLocationPair, y as Pencil } from "./lucide-react-Dfgl3Vtq.mjs";
5
5
  import { a as NO_EDIT_MAP_OVERLAY, i as useOptionalLocationPickerEnvironment, l as EMPTY_EDIT_MAP_VIEW, r as useLocationPickerWidgetContext, t as LocationDashboardLink } from "./LocationPickerEnvironment-8iKKoYZr.mjs";
6
6
  import * as React$1 from "react";
@@ -4519,8 +4519,9 @@ function createLocationPickerState(location) {
4519
4519
  responseOperation: null,
4520
4520
  lastRequest: null,
4521
4521
  retryAt: 0,
4522
- check: initialCheck(location),
4522
+ saveIntent: "idle",
4523
4523
  suggestedName: null,
4524
+ chosenName: null,
4524
4525
  adjustment: null,
4525
4526
  undo: null,
4526
4527
  history: []
@@ -4535,9 +4536,21 @@ function retainAddressEvidence(previous, next) {
4535
4536
  ...next.addressCheckSettled || previous.addressCheckSettled ? { addressCheckSettled: true } : {}
4536
4537
  };
4537
4538
  }
4538
- function initialCheck(location) {
4539
- if (location?.addressMatch || location?.addressCheckSettled) return "complete";
4540
- return location?.address && location.pin ? "opening" : "idle";
4539
+ /** A check has already answered for this address, whatever it found. */
4540
+ function addressCheckDone(location) {
4541
+ return location?.addressMatch !== null && location?.addressMatch !== void 0 || location?.addressCheckSettled === true;
4542
+ }
4543
+ /** A pin and an address nothing has compared yet. Without a pin there's nothing to compare, so nothing is owed. */
4544
+ function addressCheckOwed(location) {
4545
+ return location !== null && location.address !== null && location.pin !== null && !addressCheckDone(location);
4546
+ }
4547
+ /** An address check or reverse lookup is on its way; a search never holds a save back. */
4548
+ function placeLookupRunning(state) {
4549
+ return state.request !== null && state.request.input.operation !== "autocomplete";
4550
+ }
4551
+ /** Pending saves resolve by themselves once a lookup replies; every other refusal needs the owner. */
4552
+ function isSavePending(save) {
4553
+ return save.kind === "blocked" && (save.reason === "pending_address_check" || save.reason === "pending_reverse");
4541
4554
  }
4542
4555
  function pickerCoordinateValue(coordinates) {
4543
4556
  if (!coordinates.lat.trim() && !coordinates.lng.trim()) return {
@@ -4565,11 +4578,7 @@ function pickerSaveDecision(state) {
4565
4578
  reason: "adjusting_pin"
4566
4579
  };
4567
4580
  if (state.request && state.request.input.operation !== "autocomplete") return decideLocationSave(state.location, state.request.input.operation);
4568
- if (state.check === "opening" || state.check === "unresolved") return {
4569
- kind: "blocked",
4570
- reason: "unresolved_address"
4571
- };
4572
- return decideLocationSave(state.location, state.request?.input.operation ?? "idle");
4581
+ return decideLocationSave(state.location, addressCheckOwed(state.location) ? "address-check" : "idle");
4573
4582
  }
4574
4583
  function withLocation(state, location) {
4575
4584
  return {
@@ -4597,7 +4606,6 @@ function editDetails(state, details) {
4597
4606
  };
4598
4607
  if (!sameMeaningfulAddress(state.location?.address ?? null, edited.value?.address ?? null)) return {
4599
4608
  ...next,
4600
- check: edited.value?.address ? "unresolved" : "idle",
4601
4609
  history: []
4602
4610
  };
4603
4611
  return sameLocationSpatialPair(state.location, edited.value) ? refineDetails(state, next) : rememberMove(state, next);
@@ -4621,7 +4629,6 @@ function rememberMove(state, next) {
4621
4629
  ...next,
4622
4630
  undo: {
4623
4631
  location: state.location,
4624
- check: state.check,
4625
4632
  expiresAt: Infinity
4626
4633
  },
4627
4634
  history: [state.undo, ...state.history].filter((entry) => entry !== null).slice(0, 4)
@@ -4632,17 +4639,61 @@ const detailsOf = (state) => ({
4632
4639
  pin: state.location?.pin ?? null,
4633
4640
  doorNote: state.location?.doorNote ?? null
4634
4641
  });
4635
- /** One exhaustive dispatch; helpers own edits, lookup lifecycle and draft history. */
4636
4642
  function locationPickerReducer(state, action) {
4643
+ return settleSaveIntent(applyAction(state, action));
4644
+ }
4645
+ /** After every change: a waiting save is answered once nothing's pending, or interrupted if its lookup was cancelled. */
4646
+ function settleSaveIntent(state) {
4647
+ switch (state.saveIntent) {
4648
+ case "idle":
4649
+ case "settled": return state;
4650
+ case "waiting":
4651
+ if (!isSavePending(pickerSaveDecision(state))) return {
4652
+ ...state,
4653
+ saveIntent: "settled"
4654
+ };
4655
+ return placeLookupRunning(state) ? state : {
4656
+ ...state,
4657
+ saveIntent: "interrupted"
4658
+ };
4659
+ case "interrupted": return isSavePending(pickerSaveDecision(state)) ? state : {
4660
+ ...state,
4661
+ saveIntent: "idle"
4662
+ };
4663
+ default: return assertNever(state.saveIntent);
4664
+ }
4665
+ }
4666
+ function requestSave(state, action) {
4667
+ if (!action.wait) return {
4668
+ ...state,
4669
+ saveIntent: "settled"
4670
+ };
4671
+ const waiting = {
4672
+ ...state,
4673
+ saveIntent: "waiting"
4674
+ };
4675
+ if (!action.check) return waiting;
4676
+ return startRequest(state.request?.input.operation === "reverse" ? {
4677
+ ...waiting,
4678
+ request: null
4679
+ } : waiting, action.check, action.now);
4680
+ }
4681
+ /** One exhaustive dispatch; helpers own edits, lookup lifecycle and draft history. */
4682
+ function applyAction(state, action) {
4637
4683
  switch (action.type) {
4638
4684
  case "replace": return {
4639
4685
  ...createLocationPickerState(retainAddressEvidence(state.location, action.location)),
4686
+ chosenName: state.chosenName,
4640
4687
  sequence: state.sequence + 1,
4641
4688
  revision: state.revision + 1
4642
4689
  };
4643
4690
  case "address":
4644
4691
  case "note":
4645
4692
  case "pin": return editDraft(state, action);
4693
+ case "use-coordinates": return withQuery(editDetails(state, {
4694
+ ...detailsOf(state),
4695
+ pin: action.pin
4696
+ }), "");
4646
4697
  case "coordinate": return editCoordinate(state, action);
4647
4698
  case "query":
4648
4699
  case "request":
@@ -4651,6 +4702,8 @@ function locationPickerReducer(state, action) {
4651
4702
  case "select":
4652
4703
  case "confirm":
4653
4704
  case "unconfirm": return choosePair(state, action);
4705
+ case "adopt-location": return adoptLocation(state, action.location);
4706
+ case "use-typed-address": return keepTypedAddress(state, action.text, action.now);
4654
4707
  case "put-back":
4655
4708
  case "commit-adjustment": return commitPin(state, action);
4656
4709
  case "begin-adjustment":
@@ -4658,6 +4711,15 @@ function locationPickerReducer(state, action) {
4658
4711
  case "cancel-adjustment": return adjustPin(state, action);
4659
4712
  case "remove":
4660
4713
  case "undo": return draftHistory(state, action);
4714
+ case "request-save": return requestSave(state, action);
4715
+ case "save-reported": return {
4716
+ ...state,
4717
+ saveIntent: "idle"
4718
+ };
4719
+ case "suggestion-taken": return {
4720
+ ...state,
4721
+ suggestedName: null
4722
+ };
4661
4723
  default: return assertNever(action);
4662
4724
  }
4663
4725
  }
@@ -4677,20 +4739,21 @@ function editDraft(state, action) {
4677
4739
  });
4678
4740
  }
4679
4741
  function lookupTransition(state, action) {
4680
- if (action.type === "query") return {
4742
+ if (action.type === "query") return withQuery(state, action.query, action.mode);
4743
+ if (action.type === "request") return startRequest(state, action.input, action.now);
4744
+ if (action.type === "reply") return acceptReply(state, action);
4745
+ return state.lastRequest ? startRequest(state, state.lastRequest, action.now) : state;
4746
+ }
4747
+ /** New search text starts over, and only a search is dropped with it. Finishing a choice clears the text this way too. */
4748
+ function withQuery(state, query, mode = state.mode) {
4749
+ return {
4681
4750
  ...state,
4682
- query: action.query,
4683
- mode: action.mode ?? state.mode,
4751
+ query,
4752
+ mode,
4684
4753
  candidates: [],
4685
4754
  response: null,
4686
4755
  request: state.request?.input.operation === "autocomplete" ? null : state.request
4687
4756
  };
4688
- if (action.type === "request") return startRequest(state, action.input, action.now);
4689
- if (action.type === "reply") return acceptReply(state, action);
4690
- return state.lastRequest ? startRequest({
4691
- ...state,
4692
- check: state.lastRequest.operation === "address-check" ? "idle" : state.check
4693
- }, state.lastRequest, action.now) : state;
4694
4757
  }
4695
4758
  function choosePair(state, action) {
4696
4759
  if (action.type === "select") return selectCandidate(state, action.candidate);
@@ -4706,14 +4769,10 @@ function choosePair(state, action) {
4706
4769
  }
4707
4770
  function commitPin(state, action) {
4708
4771
  const pin = action.type === "put-back" ? state.location?.addressMatch?.point : state.adjustment?.candidate;
4709
- const next = pin ? editDetails(state, {
4772
+ return pin ? editDetails(state, {
4710
4773
  ...detailsOf(state),
4711
4774
  pin
4712
4775
  }) : state;
4713
- return action.type === "put-back" && pin ? {
4714
- ...next,
4715
- check: "complete"
4716
- } : next;
4717
4776
  }
4718
4777
  function adjustPin(state, action) {
4719
4778
  if (action.type === "cancel-adjustment") return {
@@ -4737,11 +4796,10 @@ function beginAdjustment(state) {
4737
4796
  function draftHistory(state, action) {
4738
4797
  if (action.type === "remove") return {
4739
4798
  ...withLocation(state, null),
4740
- check: "idle",
4741
4799
  authored: true,
4800
+ chosenName: null,
4742
4801
  undo: state.location ? {
4743
4802
  location: state.location,
4744
- check: state.check,
4745
4803
  expiresAt: action.now + 5e3
4746
4804
  } : null,
4747
4805
  history: [state.undo, ...state.history].filter((entry) => entry !== null).slice(0, 4)
@@ -4753,7 +4811,6 @@ function draftHistory(state, action) {
4753
4811
  };
4754
4812
  return {
4755
4813
  ...withLocation(state, state.undo.location),
4756
- check: state.undo.check,
4757
4814
  authored: true,
4758
4815
  undo: state.history[0] ?? null,
4759
4816
  history: state.history.slice(1)
@@ -4778,11 +4835,10 @@ function editCoordinate(state, action) {
4778
4835
  coordinates
4779
4836
  };
4780
4837
  }
4781
- function startRequest(state, input, now) {
4782
- if (now < state.retryAt) return state;
4838
+ function startRequest(state, input, now, onReply = { kind: "compare" }) {
4783
4839
  if (state.request && !(input.operation === "address-check" && state.request.input.operation === "autocomplete")) return state;
4840
+ if (now < state.retryAt) return answerInsideThrottle(state, input, now);
4784
4841
  if (input.operation === "autocomplete" && input.query.trim().length < 3) return state;
4785
- if (input.operation === "address-check" && state.check === "complete") return state;
4786
4842
  return {
4787
4843
  ...state,
4788
4844
  sequence: state.sequence + 1,
@@ -4791,35 +4847,50 @@ function startRequest(state, input, now) {
4791
4847
  request: {
4792
4848
  id: state.sequence + 1,
4793
4849
  revision: state.revision,
4794
- input
4795
- },
4796
- check: requestCheckStatus(state, input)
4850
+ input,
4851
+ onReply
4852
+ }
4797
4853
  };
4798
4854
  }
4855
+ /** Asking inside a throttle window gets the answer a throttled reply would give, without the round trip. */
4856
+ function answerInsideThrottle(state, input, now) {
4857
+ switch (input.operation) {
4858
+ case "address-check": return settleAddressCheck(state);
4859
+ case "autocomplete": return {
4860
+ ...state,
4861
+ lastRequest: input,
4862
+ responseOperation: input.operation,
4863
+ response: {
4864
+ kind: "throttled",
4865
+ retryAfterSeconds: Math.ceil((state.retryAt - now) / 1e3)
4866
+ }
4867
+ };
4868
+ case "reverse": return state;
4869
+ }
4870
+ }
4799
4871
  /** Opening verification is incidental; an explicit check/reverse belongs to the owner's draft. */
4800
4872
  function lookupAuthored(state, operation) {
4801
4873
  switch (operation) {
4802
4874
  case "autocomplete": return state.authored;
4803
4875
  case "reverse": return true;
4804
- case "address-check": return state.authored || state.check !== "opening";
4876
+ case "address-check": return state.authored || !addressCheckOwed(state.location);
4805
4877
  }
4806
4878
  }
4807
- /** Starting a check does not resolve its intent: only a reply or an explicit owner choice does. */
4808
- function requestCheckStatus(state, input) {
4809
- if (input.operation !== "address-check") return state.check;
4810
- return state.check === "opening" ? "opening" : "unresolved";
4811
- }
4879
+ const isCurrentReply = (state, request) => state.request?.id === request.id && state.revision === request.revision;
4880
+ const retryAtAfter = (response, now, current) => response.kind === "throttled" ? now + response.retryAfterSeconds * 1e3 : current;
4812
4881
  function acceptReply(state, action) {
4813
- if (state.request?.id !== action.request.id || state.revision !== action.request.revision) return state;
4814
- const response = action.response, settled = {
4882
+ if (!isCurrentReply(state, action.request)) return state;
4883
+ const response = isFullSearch(action.request.input) && action.response.kind !== "found" ? { kind: "no-match" } : action.response;
4884
+ const settled = {
4815
4885
  ...state,
4816
4886
  request: null,
4817
4887
  response,
4818
4888
  responseOperation: action.request.input.operation,
4819
4889
  lastRequest: action.request.input,
4820
- retryAt: response.kind === "throttled" ? action.now + response.retryAfterSeconds * 1e3 : state.retryAt
4890
+ retryAt: retryAtAfter(action.response, action.now, state.retryAt)
4821
4891
  };
4822
- const completed = completedLookup(settled, action.request.input.operation);
4892
+ if (action.request.onReply.kind === "start-pin") return startPinAtPostcode(settled, action.request.onReply.postcode);
4893
+ const completed = action.request.input.operation === "address-check" ? settleAddressCheck(settled) : settled;
4823
4894
  if (response.kind !== "found") return completed;
4824
4895
  if (action.request.input.operation === "autocomplete") return {
4825
4896
  ...settled,
@@ -4828,53 +4899,68 @@ function acceptReply(state, action) {
4828
4899
  return applyMatchedAddress(completed, response.candidates[0], action.request.input.operation);
4829
4900
  }
4830
4901
  /** Completion is durable for the current meaningful address, including an unchecked result. */
4831
- function completedLookup(state, operation) {
4832
- switch (operation) {
4833
- case "autocomplete": return state;
4834
- case "reverse": return {
4835
- ...state,
4836
- check: "complete"
4837
- };
4838
- case "address-check": return {
4839
- ...state,
4840
- check: "complete",
4841
- location: state.location?.address ? {
4842
- ...state.location,
4843
- addressCheckSettled: true
4844
- } : state.location
4845
- };
4846
- }
4902
+ function settleAddressCheck(state) {
4903
+ return state.location?.address ? {
4904
+ ...state,
4905
+ location: {
4906
+ ...state.location,
4907
+ addressCheckSettled: true
4908
+ }
4909
+ } : state;
4847
4910
  }
4848
4911
  function applyMatchedAddress(state, candidate, operation) {
4849
4912
  const address = operation === "reverse" ? candidate.address : state.location?.address ?? null;
4850
4913
  if (!state.location || address === null) return state;
4914
+ const location = {
4915
+ ...state.location,
4916
+ address,
4917
+ addressMatch: candidate.match,
4918
+ ownerConfirmedPinAndAddress: operation === "address-check" && state.location.ownerConfirmedPinAndAddress
4919
+ };
4920
+ const kept = operation === "address-check" ? {
4921
+ adjustment: state.adjustment,
4922
+ undo: state.undo,
4923
+ history: state.history,
4924
+ coordinates: state.coordinates
4925
+ } : {
4926
+ adjustment: null,
4927
+ undo: null,
4928
+ history: []
4929
+ };
4851
4930
  return {
4852
- ...withLocation(state, {
4853
- ...state.location,
4854
- address,
4855
- addressMatch: candidate.match,
4856
- ownerConfirmedPinAndAddress: operation === "address-check" && state.location.ownerConfirmedPinAndAddress
4857
- }),
4858
- check: "complete",
4931
+ ...withLocation(state, location),
4859
4932
  response: state.response,
4860
- adjustment: operation === "address-check" ? state.adjustment : null,
4861
- undo: operation === "address-check" ? state.undo : null,
4862
- history: operation === "address-check" ? state.history : []
4933
+ ...kept
4863
4934
  };
4864
4935
  }
4865
4936
  function selectCandidate(state, candidate) {
4866
4937
  if (!state.candidates.includes(candidate)) return state;
4867
4938
  return {
4868
- ...withLocation(state, {
4939
+ ...withQuery(withLocation(state, {
4869
4940
  address: candidate.address,
4870
4941
  pin: candidate.match.point,
4871
4942
  addressMatch: candidate.match,
4872
4943
  ownerConfirmedPinAndAddress: false,
4873
4944
  doorNote: state.location?.doorNote ?? null
4874
- }),
4875
- check: "complete",
4945
+ }), ""),
4946
+ authored: true,
4947
+ suggestedName: candidate.kind === "business" ? candidate.name : null,
4948
+ chosenName: candidate.name ? {
4949
+ name: candidate.name,
4950
+ address: candidate.address
4951
+ } : null
4952
+ };
4953
+ }
4954
+ /** A place the site already holds comes with its own evidence, so it never needs a lookup. The door note stays the draft's. */
4955
+ function adoptLocation(state, place) {
4956
+ return {
4957
+ ...withQuery(withLocation(state, {
4958
+ ...place,
4959
+ doorNote: state.location?.doorNote ?? null,
4960
+ ...place.address && !addressCheckDone(place) ? { addressCheckSettled: true } : {}
4961
+ }), ""),
4876
4962
  authored: true,
4877
- suggestedName: candidate.kind === "business" ? candidate.name : null
4963
+ chosenName: null
4878
4964
  };
4879
4965
  }
4880
4966
  function confirmPair(state) {
@@ -4883,14 +4969,86 @@ function confirmPair(state) {
4883
4969
  return confirmed.ok ? {
4884
4970
  ...state,
4885
4971
  location: confirmed.value,
4886
- check: "complete",
4887
4972
  request: null,
4888
4973
  authored: true
4889
4974
  } : state;
4890
4975
  }
4976
+ const UK_POSTCODE_AT_END = /(?:^|[\s,]+)([A-Z]{1,2}\d[A-Z\d]?)\s*(\d[A-Z]{2})\s*$/i;
4977
+ const samePostcode = (a, b) => a?.replace(/\s/g, "").toUpperCase() === b.replace(/\s/g, "").toUpperCase();
4978
+ /** Text after the last comma is the town, and everything else (or a line with no commas) is the street. */
4979
+ function typedStreetAndTown(text) {
4980
+ const parts = text.split(",").map((part) => part.trim().slice(0, 200)).filter(Boolean);
4981
+ if (parts.length < 2) return {
4982
+ street: parts[0] ?? null,
4983
+ locality: null
4984
+ };
4985
+ return {
4986
+ street: parts.slice(0, -1).join(", ").slice(0, 200),
4987
+ locality: parts.at(-1) ?? null
4988
+ };
4989
+ }
4990
+ /** Keeps what was typed for the owner to correct, with a UK postcode at the end taken off. */
4991
+ function addressFromTypedText(text, mode) {
4992
+ const postcode = UK_POSTCODE_AT_END.exec(text);
4993
+ const typed = typedStreetAndTown(postcode ? text.slice(0, postcode.index) : text);
4994
+ if (!postcode && !typed.street && !typed.locality) return null;
4995
+ const parsed = locationAddressSchema.safeParse({
4996
+ ...typed,
4997
+ postalCode: postcode ? postcode.slice(1, 3).join(" ").toUpperCase() : null,
4998
+ country: postcode || mode === "uk" ? "GB" : null
4999
+ });
5000
+ return parsed.success ? parsed.data : null;
5001
+ }
5002
+ /** Saving never depends on a match: the draft is whole now, and a postcode lookup can only add a starting pin. */
5003
+ function keepTypedAddress(state, text, now) {
5004
+ const address = addressFromTypedText(text, state.mode);
5005
+ const edited = editLocationValue(null, {
5006
+ address,
5007
+ pin: null,
5008
+ doorNote: state.location?.doorNote ?? null
5009
+ });
5010
+ if (!edited.ok || edited.value === null) return state;
5011
+ const next = {
5012
+ ...withQuery(withLocation(state, edited.value), ""),
5013
+ authored: true,
5014
+ chosenName: null
5015
+ };
5016
+ const postcode = address?.postalCode;
5017
+ return postcode ? startRequest(next, {
5018
+ operation: "address-check",
5019
+ query: postcode,
5020
+ mode: "uk"
5021
+ }, now, {
5022
+ kind: "start-pin",
5023
+ postcode
5024
+ }) : next;
5025
+ }
5026
+ /** A postcode is a neighbourhood, whatever the provider calls the result, so the status asks the owner to move the pin. */
5027
+ function startPinAtPostcode(state, postcode) {
5028
+ const found = state.response?.kind === "found" ? state.response.candidates.find((candidate) => samePostcode(candidate.address.postalCode, postcode)) : void 0;
5029
+ if (!found || !state.location) return settleAddressCheck(state);
5030
+ return {
5031
+ ...withLocation(state, {
5032
+ ...state.location,
5033
+ pin: found.match.point,
5034
+ addressMatch: {
5035
+ ...found.match,
5036
+ precision: "area"
5037
+ }
5038
+ }),
5039
+ response: state.response
5040
+ };
5041
+ }
5042
+ const FULL_SEARCH_MIN_LENGTH = 8;
5043
+ const isFullSearch = (input) => input.operation === "autocomplete" && input.fullSearch === true;
5044
+ /** Autocomplete found nothing for this exact text, it's long enough to be an address, and the fuller search hasn't had a go. */
5045
+ function wantsFullSearch(state) {
5046
+ const last = state.lastRequest;
5047
+ return state.responseOperation === "autocomplete" && state.response?.kind === "no-match" && last?.operation === "autocomplete" && !last.fullSearch && last.query === state.query.trim() && last.query.length >= FULL_SEARCH_MIN_LENGTH;
5048
+ }
4891
5049
  /** Completed legacy opening checks may be recorded without making the draft an owner edit. */
4892
5050
  function openingCheckEvidence(previous, state) {
4893
- if (initialCheck(previous) !== "opening" || state.authored || state.check !== "complete" || !state.location || !sameLocationSpatialPair(previous, state.location)) return null;
5051
+ if (!addressCheckOwed(previous) || state.authored || addressCheckOwed(state.location) || !state.location || !sameLocationSpatialPair(previous, state.location)) return null;
4894
5052
  return state.location;
4895
5053
  }
4896
5054
  //#endregion
@@ -4901,9 +5059,13 @@ function openingCheckEvidence(previous, state) {
4901
5059
  */
4902
5060
  /** Below this the pin is drawn on the address point, so the status says "on" rather than "moved". */
4903
5061
  const SAME_SPOT_METRES = 3;
4904
- /** The words the status uses for "the address": the building or street, as people know it. */
5062
+ /** The most specific thing people typed or would recognise. Every name for a place starts here. */
5063
+ function placeName(address) {
5064
+ return address?.building ?? address?.street ?? address?.locality ?? address?.postalCode ?? null;
5065
+ }
5066
+ /** The words the status uses for "the address". */
4905
5067
  function addressName(address) {
4906
- return address?.building ?? address?.street ?? "the address";
5068
+ return placeName(address) ?? "the address";
4907
5069
  }
4908
5070
  const roundedMetres = (a, b) => Math.round(locationDistanceMetres(a, b));
4909
5071
  /** All placement instructions consume the primary-pointer decision made by the map area. */
@@ -4932,12 +5094,11 @@ function describePinStatus(state, addressEdited) {
4932
5094
  canPlaceOnAddress: location.addressMatch !== null
4933
5095
  };
4934
5096
  if (location.address === null) return { kind: "pin-only" };
4935
- if (state.check === "opening") return {
5097
+ if (addressCheckOwed(location)) return state.authored ? { kind: "address-edited" } : {
4936
5098
  kind: "checking",
4937
5099
  operation: "address-check",
4938
5100
  hasPin: true
4939
5101
  };
4940
- if (state.check === "unresolved") return { kind: "address-edited" };
4941
5102
  return comparedStatus(location, location.pin, state.undo !== null, addressEdited);
4942
5103
  }
4943
5104
  function comparedStatus(location, pin, movedThisSession, addressEdited) {
@@ -5006,7 +5167,7 @@ function countryName(country) {
5006
5167
  */
5007
5168
  function resultLines(candidate, homeCountry) {
5008
5169
  const address = candidate.address;
5009
- const title = candidate.name ?? address.street ?? address.locality ?? candidate.label;
5170
+ const title = candidate.name ?? placeName(address) ?? candidate.label;
5010
5171
  return {
5011
5172
  title,
5012
5173
  detail: [[address.street, [address.locality, address.postalCode].filter(Boolean).join(" ")].filter((part) => Boolean(part) && part !== title).join(", "), address.country !== null && address.country !== homeCountry ? countryName(address.country) : null].filter(Boolean).join(" · ")
@@ -5045,7 +5206,7 @@ function searchedCoordinates(query) {
5045
5206
  }
5046
5207
  /** What the chosen-place row shows: a remembered business name while the address is unchanged. */
5047
5208
  function chosenPlaceLines(address, chosenName) {
5048
- const title = (chosenName !== null && sameMeaningfulAddress(chosenName.address, address) ? chosenName.name : null) ?? address.building ?? address.street ?? address.locality ?? "Place";
5209
+ const title = (chosenName !== null && sameMeaningfulAddress(chosenName.address, address) ? chosenName.name : null) ?? placeName(address) ?? "Place";
5049
5210
  return {
5050
5211
  title,
5051
5212
  detail: [
@@ -5057,6 +5218,14 @@ function chosenPlaceLines(address, chosenName) {
5057
5218
  ].filter((part) => Boolean(part) && part !== title).join(", ")
5058
5219
  };
5059
5220
  }
5221
+ /** The site's business address as a place to use. A saved pin with no address has nothing to offer. */
5222
+ function businessAddressOffer(location, siteCountry) {
5223
+ const line = formatLocationAddress(location?.address ?? null, siteCountry);
5224
+ return location && line ? {
5225
+ location,
5226
+ line
5227
+ } : null;
5228
+ }
5060
5229
  function regionLabel(country) {
5061
5230
  return country === "GB" ? "County" : country === "US" ? "State" : "Region";
5062
5231
  }
@@ -5074,13 +5243,14 @@ const KIND_ICON = {
5074
5243
  };
5075
5244
  const MIN_QUERY = 3;
5076
5245
  /** The search combobox and its result list. Choosing a row is the only thing that changes the draft. */
5077
- function PlaceSearch({ controller, idBase, siteCountry, changingFrom, onKeepCurrent, onChosen, onManual, onCoordinates, announce }) {
5246
+ function PlaceSearch({ controller, idBase, siteCountry, changingFrom, onKeepCurrent, businessOffer, onBusinessAddress, onChosen, onTyped, onCoordinates, announce }) {
5078
5247
  const { state, dispatch } = controller;
5079
5248
  const [open, setOpen] = useState(false);
5080
5249
  const [activeKey, setActiveKey] = useState(null);
5081
5250
  const input = useRef(null);
5082
5251
  const listId = `${idBase}-results`;
5083
- const rows = searchRows(state);
5252
+ const rows = searchRows(state, businessOffer);
5253
+ const showList = open && (state.query !== "" || rows.length > 0);
5084
5254
  const active = rows.findIndex((row) => rowKey(row) === activeKey);
5085
5255
  const setActive = (index) => setActiveKey(rows[index] ? rowKey(rows[index]) : null);
5086
5256
  const homeCountry = siteCountry ?? (state.mode === "uk" ? "GB" : null);
@@ -5088,9 +5258,10 @@ function PlaceSearch({ controller, idBase, siteCountry, changingFrom, onKeepCurr
5088
5258
  const choose = (row) => {
5089
5259
  setOpen(false);
5090
5260
  setActive(-1);
5091
- if (row.kind === "candidate") onChosen(row.candidate);
5261
+ if (row.kind === "business") onBusinessAddress(row.offer);
5262
+ else if (row.kind === "candidate") onChosen(row.candidate);
5092
5263
  else if (row.kind === "coordinates") onCoordinates(row.pin);
5093
- else onManual();
5264
+ else onTyped(row.text);
5094
5265
  };
5095
5266
  const onKeyDown = (event) => {
5096
5267
  const next = searchKey(event.key, {
@@ -5141,7 +5312,7 @@ function PlaceSearch({ controller, idBase, siteCountry, changingFrom, onKeepCurr
5141
5312
  children: "Keep it"
5142
5313
  })
5143
5314
  ]
5144
- }) : null, open && state.query !== "" ? /* @__PURE__ */ jsx(ResultList, {
5315
+ }) : null, showList ? /* @__PURE__ */ jsx(ResultList, {
5145
5316
  controller,
5146
5317
  rows,
5147
5318
  active,
@@ -5163,7 +5334,7 @@ function PlaceSearch({ controller, idBase, siteCountry, changingFrom, onKeepCurr
5163
5334
  id,
5164
5335
  role: "combobox",
5165
5336
  "aria-autocomplete": "list",
5166
- "aria-expanded": open && state.query !== "",
5337
+ "aria-expanded": showList,
5167
5338
  "aria-controls": listId,
5168
5339
  "aria-activedescendant": open && active >= 0 ? `${idBase}-row-${active}` : void 0,
5169
5340
  "aria-describedby": messageId,
@@ -5173,7 +5344,7 @@ function PlaceSearch({ controller, idBase, siteCountry, changingFrom, onKeepCurr
5173
5344
  value: state.query,
5174
5345
  onKeyDown,
5175
5346
  onFocus: () => {
5176
- if (state.query) setOpen(true);
5347
+ if (state.query || rows.length > 0) setOpen(true);
5177
5348
  },
5178
5349
  onChange: (event) => {
5179
5350
  dispatch({
@@ -5208,7 +5379,7 @@ function PlaceSearch({ controller, idBase, siteCountry, changingFrom, onKeepCurr
5208
5379
  const IGNORE = { kind: "ignore" };
5209
5380
  /** Down/Up move through results, Enter chooses, the first Escape closes the list and the second clears the text. */
5210
5381
  const SEARCH_KEYS = {
5211
- ArrowDown: (list) => list.hasQuery ? {
5382
+ ArrowDown: (list) => list.hasQuery || list.count > 0 ? {
5212
5383
  kind: "move",
5213
5384
  active: list.open ? Math.min(list.count - 1, list.active + 1) : 0
5214
5385
  } : IGNORE,
@@ -5222,11 +5393,19 @@ const SEARCH_KEYS = {
5222
5393
  function searchKey(key, list) {
5223
5394
  return SEARCH_KEYS[key]?.(list) ?? IGNORE;
5224
5395
  }
5225
- function searchRows(state) {
5226
- const coordinates = searchedCoordinates(state.query);
5396
+ /** Text long enough to mean something can be kept as typed, and any text can once search has failed, as long as it reads as an address. */
5397
+ function canKeepTypedText(state) {
5227
5398
  const failed = state.responseOperation === "autocomplete" && (state.response?.kind === "unavailable" || state.response?.kind === "throttled");
5228
- const typedEnough = state.query.trim().length >= MIN_QUERY;
5399
+ const text = state.query.trim();
5400
+ return (text.length >= MIN_QUERY || failed) && coordinateSearch(state.query).kind === "place" && addressFromTypedText(text, state.mode) !== null;
5401
+ }
5402
+ function searchRows(state, businessOffer) {
5403
+ const coordinates = searchedCoordinates(state.query);
5229
5404
  return [
5405
+ ...businessOffer ? [{
5406
+ kind: "business",
5407
+ offer: businessOffer
5408
+ }] : [],
5230
5409
  ...coordinates ? [{
5231
5410
  kind: "coordinates",
5232
5411
  pin: coordinates
@@ -5235,7 +5414,10 @@ function searchRows(state) {
5235
5414
  kind: "candidate",
5236
5415
  candidate
5237
5416
  })),
5238
- ...typedEnough || failed ? [{ kind: "manual" }] : []
5417
+ ...canKeepTypedText(state) ? [{
5418
+ kind: "typed",
5419
+ text: state.query.trim()
5420
+ }] : []
5239
5421
  ];
5240
5422
  }
5241
5423
  /** Screen readers hear the count once results arrive, or that nothing matched. */
@@ -5251,7 +5433,7 @@ function ResultList({ controller, rows, active, listId, idBase, homeCountry, onC
5251
5433
  const { state } = controller;
5252
5434
  return /* @__PURE__ */ jsxs("div", {
5253
5435
  className: "mt-1.5 overflow-hidden rounded-[var(--item-radius)] border border-border bg-background shadow-[0_8px_24px_rgba(60,50,45,0.12)]",
5254
- children: [/* @__PURE__ */ jsx(ResultListHead, { controller }), /* @__PURE__ */ jsx("ul", {
5436
+ children: [state.query !== "" ? /* @__PURE__ */ jsx(ResultListHead, { controller }) : null, /* @__PURE__ */ jsx("ul", {
5255
5437
  role: "listbox",
5256
5438
  id: listId,
5257
5439
  "aria-label": "Places",
@@ -5262,7 +5444,7 @@ function ResultList({ controller, rows, active, listId, idBase, homeCountry, onC
5262
5444
  id: `${idBase}-row-${index}`,
5263
5445
  selected: index === active,
5264
5446
  query: state.query,
5265
- separated: row.kind === "manual" && index > 0,
5447
+ separated: row.kind === "typed" && index > 0,
5266
5448
  onChoose: () => onChoose(row),
5267
5449
  onHover: () => onHover(index)
5268
5450
  }, rowKey(row)))
@@ -5347,7 +5529,7 @@ function NoMatch({ controller, query }) {
5347
5529
  }),
5348
5530
  /* @__PURE__ */ jsx("p", {
5349
5531
  className: "m-0 mb-1.5 text-[13px] text-muted-foreground",
5350
- children: "Check the spelling, or try just the postcode, or the street and town. If your place isn't listed, you can put the pin on the map yourself and type the address in."
5532
+ children: "Check the spelling, or try just the postcode, or the street and town. If your place isn't listed, choose Use this address as typed below and you can correct it."
5351
5533
  }),
5352
5534
  /* @__PURE__ */ jsx("p", {
5353
5535
  className: "m-0 text-[13px]",
@@ -5373,7 +5555,7 @@ function SearchDown({ controller, retryAfter }) {
5373
5555
  children: [
5374
5556
  "Whatever you've typed is kept. ",
5375
5557
  retryAfter === null ? "You can try again" : `You can try again in ${retryAfter} seconds`,
5376
- ", or put the pin on the map yourself and type the address in."
5558
+ ", or choose Use this address as typed below."
5377
5559
  ]
5378
5560
  }),
5379
5561
  retryAfter === null ? /* @__PURE__ */ jsx("p", {
@@ -5414,7 +5596,7 @@ function SearchRowItem({ row, homeCountry, id, selected, query, separated, onCho
5414
5596
  className: cn$1("flex cursor-pointer items-start gap-2.5 rounded-lg px-2.5 py-2", selected && "bg-accent", "hover:bg-accent", separated && "mt-1 rounded-t-none border-t border-border"),
5415
5597
  children: [
5416
5598
  /* @__PURE__ */ jsx("span", {
5417
- className: cn$1("grid size-7 flex-none place-items-center rounded-lg text-[color:var(--primary-ink,var(--primary))]", row.kind === "manual" ? "border border-dashed border-[color:var(--field-border-strong)]" : "bg-[var(--surface,var(--muted))]"),
5599
+ className: cn$1("grid size-7 flex-none place-items-center rounded-lg text-[color:var(--primary-ink,var(--primary))]", row.kind === "typed" ? "border border-dashed border-[color:var(--field-border-strong)]" : "bg-[var(--surface,var(--muted))]"),
5418
5600
  children: /* @__PURE__ */ jsx(Icon, {
5419
5601
  className: "size-4",
5420
5602
  "aria-hidden": "true"
@@ -5444,10 +5626,16 @@ function SearchRowItem({ row, homeCountry, id, selected, query, separated, onCho
5444
5626
  });
5445
5627
  }
5446
5628
  function rowContent(row, homeCountry) {
5447
- if (row.kind === "manual") return {
5448
- icon: MapPin,
5449
- title: "Put the pin on the map myself",
5450
- detail: "Then type the address in",
5629
+ if (row.kind === "business") return {
5630
+ icon: House,
5631
+ title: "Use your business address",
5632
+ detail: row.offer.line,
5633
+ kind: null
5634
+ };
5635
+ if (row.kind === "typed") return {
5636
+ icon: Pencil,
5637
+ title: "Use this address as typed",
5638
+ detail: row.text,
5451
5639
  kind: null
5452
5640
  };
5453
5641
  if (row.kind === "coordinates") return {
@@ -5505,18 +5693,18 @@ function ChosenPlace({ address, chosenName, siteCountry, fieldsOpen, onToggleFie
5505
5693
  className: "rb-chosen-actions flex flex-none gap-0.5",
5506
5694
  children: [/* @__PURE__ */ jsxs(Button, {
5507
5695
  type: "button",
5508
- variant: "ghost",
5696
+ variant: "link",
5509
5697
  size: "sm",
5510
- className: "h-7 px-2.5 text-[13px] text-muted-foreground",
5698
+ className: "h-7 px-2.5 text-[13px]",
5511
5699
  "aria-expanded": fieldsOpen,
5512
5700
  "aria-controls": `${idBase}-fields`,
5513
5701
  onClick: onToggleFields,
5514
5702
  children: [/* @__PURE__ */ jsx(Pencil, { "aria-hidden": "true" }), fieldsOpen ? "Hide address" : "Edit address"]
5515
5703
  }), /* @__PURE__ */ jsx(Button, {
5516
5704
  type: "button",
5517
- variant: "ghost",
5705
+ variant: "link",
5518
5706
  size: "sm",
5519
- className: "h-7 px-2.5 text-[13px] text-muted-foreground",
5707
+ className: "h-7 px-2.5 text-[13px]",
5520
5708
  onClick: onChange,
5521
5709
  children: "Change"
5522
5710
  })]
@@ -6212,27 +6400,22 @@ const PREVIEW_CAPTION = {
6212
6400
  drawing: "Drawing the map for this spot. It'll appear here when it's ready.",
6213
6401
  "details-only": null
6214
6402
  };
6215
- function PinTab({ mapRef, ...props }) {
6403
+ function PinTab(props) {
6216
6404
  const [coordsOpen, setCoordsOpen] = useState(false);
6217
6405
  const [availability, setAvailability] = useState("loading");
6218
6406
  const unavailable = availability === "unavailable";
6219
6407
  const showCoords = coordsOpen || unavailable || props.coordinatesError !== null;
6220
6408
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
6221
- /* @__PURE__ */ jsxs("div", {
6222
- ref: mapRef,
6223
- tabIndex: -1,
6224
- className: "outline-none",
6225
- children: [unavailable ? /* @__PURE__ */ jsx("p", {
6226
- className: "m-0 mb-2 rounded-[var(--item-radius)] bg-accent px-3 py-2.5 text-[13.5px]",
6227
- children: "The map couldn't load just now. You can still type the pin's coordinates below."
6228
- }) : null, /* @__PURE__ */ jsx("div", {
6229
- hidden: unavailable,
6230
- children: /* @__PURE__ */ jsx(PinMap, {
6231
- ...props,
6232
- onAvailabilityChange: setAvailability
6233
- })
6234
- })]
6235
- }),
6409
+ /* @__PURE__ */ jsxs("div", { children: [unavailable ? /* @__PURE__ */ jsx("p", {
6410
+ className: "m-0 mb-2 rounded-[var(--item-radius)] bg-accent px-3 py-2.5 text-[13.5px]",
6411
+ children: "The map couldn't load just now. You can still type the pin's coordinates below."
6412
+ }) : null, /* @__PURE__ */ jsx("div", {
6413
+ hidden: unavailable,
6414
+ children: /* @__PURE__ */ jsx(PinMap, {
6415
+ ...props,
6416
+ onAvailabilityChange: setAvailability
6417
+ })
6418
+ })] }),
6236
6419
  !props.touch ? /* @__PURE__ */ jsx("p", {
6237
6420
  className: "sr-only",
6238
6421
  id: `${props.idBase}-pinhelp`,
@@ -6243,9 +6426,9 @@ function PinTab({ mapRef, ...props }) {
6243
6426
  className: "flex flex-wrap items-center justify-between gap-2",
6244
6427
  children: /* @__PURE__ */ jsx(Button, {
6245
6428
  type: "button",
6246
- variant: "ghost",
6429
+ variant: "link",
6247
6430
  size: "sm",
6248
- className: "h-7 px-2.5 text-[13px] text-muted-foreground",
6431
+ className: "h-7 px-2.5 text-[13px]",
6249
6432
  "aria-expanded": showCoords,
6250
6433
  "aria-controls": `${props.idBase}-coordinates`,
6251
6434
  onClick: () => setCoordsOpen((open) => !open),
@@ -6611,11 +6794,11 @@ function statusContent(view, actions, touch) {
6611
6794
  };
6612
6795
  case "address-edited": return {
6613
6796
  tone: "info",
6614
- body: "You've changed the address. We'll check it against the pin when you leave the field."
6797
+ body: "You've changed the address. We'll check it against the pin when you leave this field, or when you save."
6615
6798
  };
6616
6799
  case "unchecked": return {
6617
6800
  tone: "info",
6618
- body: "We couldn't find this address on the map, so we can't compare it with the pin. Check the pin's in the right place."
6801
+ body: "We couldn't check this address on the map, so we can't compare it with the pin. Make sure the pin's in the right place."
6619
6802
  };
6620
6803
  case "on": return {
6621
6804
  tone: "ok",
@@ -6630,11 +6813,16 @@ function statusContent(view, actions, touch) {
6630
6813
  case "approximate": return {
6631
6814
  tone: "warn",
6632
6815
  body: /* @__PURE__ */ jsxs(Fragment$1, { children: [
6633
- "“",
6634
- view.name,
6635
- "” is ",
6636
- view.precision === "street" ? "a whole street" : "an area",
6637
- ", not a single building, so the pin's somewhere in the middle. Move it to where people should arrive.",
6816
+ view.precision === "street" ? /* @__PURE__ */ jsxs(Fragment$1, { children: [
6817
+ "“",
6818
+ view.name,
6819
+ "” is a whole street, not a single building, so the pin's somewhere in the middle."
6820
+ ] }) : /* @__PURE__ */ jsxs(Fragment$1, { children: [
6821
+ "We only know roughly where “",
6822
+ view.name,
6823
+ "” is, so the pin's somewhere nearby."
6824
+ ] }),
6825
+ " Move it to where people should arrive.",
6638
6826
  /* @__PURE__ */ jsx(UndoLink, { undo: actions.undo })
6639
6827
  ] })
6640
6828
  };
@@ -6723,11 +6911,17 @@ function farBody(view, actions) {
6723
6911
  }
6724
6912
  //#endregion
6725
6913
  //#region ../editor-blocks/src/widgets/location/useSiteCountry.ts
6914
+ const NO_FACTS = {
6915
+ country: null,
6916
+ businessLocation: null
6917
+ };
6726
6918
  /**
6727
- * The site's country, so "On your site this reads…" leaves it out the way the site does.
6728
- * Same source as the server's getSiteLocationCountry: the saved business address country, falling back to its configured locale/currency.
6919
+ * What the picker needs to know about the site, from one read.
6920
+ * The country lets "On your site this reads…" leave it out the way the site does, from the same source as the
6921
+ * server's getSiteLocationCountry: the saved business address country, falling back to its configured locale/currency.
6922
+ * The business location is what "Use your business address" offers.
6729
6923
  */
6730
- function useSiteCountry(siteId) {
6924
+ function useSiteAddressFacts(siteId) {
6731
6925
  const apiClient = useOptionalLocationPickerEnvironment()?.apiClient;
6732
6926
  const [loaded, setLoaded] = useState(null);
6733
6927
  useEffect(() => {
@@ -6739,21 +6933,26 @@ function useSiteCountry(siteId) {
6739
6933
  }).then(unwrapResponse).then((response) => {
6740
6934
  if (!lifetime.signal.aborted) setLoaded({
6741
6935
  siteId,
6742
- country: response.siteCountry ?? null
6936
+ facts: {
6937
+ country: response.siteCountry ?? null,
6938
+ businessLocation: response.locationValue ?? null
6939
+ }
6743
6940
  });
6744
6941
  }).catch(() => {});
6745
6942
  return () => lifetime.abort();
6746
6943
  }, [siteId, apiClient]);
6747
- return loaded?.siteId === siteId ? loaded.country : null;
6944
+ return loaded?.siteId === siteId ? loaded.facts : NO_FACTS;
6748
6945
  }
6749
6946
  //#endregion
6750
6947
  //#region ../editor-blocks/src/widgets/location/LocationPicker.tsx
6751
- const pickerSaveMessage = (save) => save.kind === "ready" ? null : save.reason === "invalid_coordinates" ? "Enter both valid coordinates, or clear both." : "Choose where the pin should go before saving.";
6752
- const LEGEND = {
6753
- venue: "Where is it?",
6754
- business: null,
6755
- custom: null
6948
+ const SAVE_REFUSAL = {
6949
+ invalid_coordinates: "Enter both valid coordinates, or clear both.",
6950
+ adjusting_pin: "Finish adjusting the pin first: choose Use this spot or Cancel.",
6951
+ unconfirmed_mismatch: "The pin and the address look like different places. Choose which is right before saving.",
6952
+ pending_address_check: "We're still checking the address against the pin. Try saving again in a moment.",
6953
+ pending_reverse: "We're still finding the address at the pin. Try saving again in a moment."
6756
6954
  };
6955
+ const pickerSaveMessage = (save) => save.kind === "ready" ? null : SAVE_REFUSAL[save.reason];
6757
6956
  const REMOVAL = {
6758
6957
  venue: {
6759
6958
  title: "Remove this venue's location?",
@@ -6781,7 +6980,8 @@ function LocationPicker(props) {
6781
6980
  const { controller, context } = props;
6782
6981
  const idBase = `location-${useId().replace(/[^a-zA-Z0-9-]/g, "")}`;
6783
6982
  const ui = usePickerUi(controller, idBase);
6784
- const siteCountry = useSiteCountry(controller.siteId);
6983
+ const { country: siteCountry, businessLocation } = useSiteAddressFacts(controller.siteId);
6984
+ const businessOffer = props.offerBusinessAddress ? businessAddressOffer(businessLocation, siteCountry) : null;
6785
6985
  useReportDecision(props);
6786
6986
  const ownRemoval = useLocationRemoval();
6787
6987
  const removal = props.removal ?? ownRemoval;
@@ -6796,11 +6996,7 @@ function LocationPicker(props) {
6796
6996
  "aria-live": "polite",
6797
6997
  children: ui.announcement
6798
6998
  }),
6799
- /* @__PURE__ */ jsx(PickerHeading, {
6800
- context,
6801
- canRemove: context === "venue" && location !== null,
6802
- onRemove: removal.ask
6803
- }),
6999
+ context === "venue" && location !== null ? /* @__PURE__ */ jsx(RemoveLocationButton, { onRemove: removal.ask }) : null,
6804
7000
  removal.confirming && location ? /* @__PURE__ */ jsx(RemoveConfirmation, {
6805
7001
  context,
6806
7002
  onKeep: removal.keep,
@@ -6816,26 +7012,46 @@ function LocationPicker(props) {
6816
7012
  controller,
6817
7013
  ui,
6818
7014
  idBase,
6819
- siteCountry
7015
+ siteCountry,
7016
+ businessOffer
6820
7017
  }),
6821
- ui.fieldsOpen && location && !ui.changing ? /* @__PURE__ */ jsx(PickerAddressFields, {
7018
+ /* @__PURE__ */ jsx(PickerDraftFields, {
6822
7019
  controller,
7020
+ ui,
6823
7021
  idBase,
6824
7022
  siteCountry,
6825
- streetRef: ui.streetRef,
6826
- onAddressEdit: ui.setEditedAddress
6827
- }) : null,
6828
- location && !ui.changing ? /* @__PURE__ */ jsx(PickerDoorNote, {
6829
- controller,
6830
7023
  context,
6831
- hint: props.doorNoteHint
6832
- }) : null,
7024
+ doorNoteHint: props.doorNoteHint
7025
+ }),
6833
7026
  /* @__PURE__ */ jsx(PickerMapArea, { ...mapAreaProps(props, ui, idBase) })
6834
7027
  ]
6835
7028
  })
6836
7029
  ]
6837
7030
  });
6838
7031
  }
7032
+ /** The address fields and door note, for a place that's in use and not being changed. */
7033
+ function PickerDraftFields({ controller, ui, idBase, siteCountry, context, doorNoteHint }) {
7034
+ if (!controller.state.location || ui.changing) return null;
7035
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
7036
+ controller.saveInterrupted ? /* @__PURE__ */ jsx("p", {
7037
+ role: "status",
7038
+ className: "m-0 text-sm text-muted-foreground",
7039
+ children: "You changed this while we were checking the address, so it hasn't saved yet. Save again when you're ready."
7040
+ }) : null,
7041
+ ui.fieldsOpen ? /* @__PURE__ */ jsx(PickerAddressFields, {
7042
+ controller,
7043
+ idBase,
7044
+ siteCountry,
7045
+ streetRef: ui.streetRef,
7046
+ onAddressEdit: ui.setEditedAddress
7047
+ }) : null,
7048
+ /* @__PURE__ */ jsx(PickerDoorNote, {
7049
+ controller,
7050
+ context,
7051
+ hint: doorNoteHint
7052
+ })
7053
+ ] });
7054
+ }
6839
7055
  /** Reveal happens during render; focus waits until the pin tab and coordinate fields exist. */
6840
7056
  function useSaveRefusalFocus(props) {
6841
7057
  const root = useRef(null);
@@ -6852,41 +7068,40 @@ function useSaveRefusalFocus(props) {
6852
7068
  }, [errors.status, errors.coordinates]);
6853
7069
  return root;
6854
7070
  }
6855
- /** Parents receive the decided save value, and an offered business name, whenever the draft changes. */
7071
+ /** Parents receive the decided save value whenever the draft changes, and an offered business name once. */
6856
7072
  function useReportDecision({ controller, onDecision, onSuggestedName }) {
6857
- const { state, save } = controller;
6858
- const decided = useEffectEvent(() => {
6859
- onDecision?.(save);
6860
- if (state.suggestedName) onSuggestedName?.(state.suggestedName);
6861
- });
7073
+ const { state, save, dispatch } = controller;
7074
+ const decided = useEffectEvent(() => onDecision?.(save));
6862
7075
  useLayoutEffect(() => {
6863
7076
  decided();
6864
7077
  }, [state]);
7078
+ const offered = state.suggestedName;
7079
+ const offer = useEffectEvent((name) => onSuggestedName?.(name));
7080
+ useLayoutEffect(() => {
7081
+ if (!offered) return;
7082
+ offer(offered);
7083
+ dispatch({ type: "suggestion-taken" });
7084
+ }, [offered, dispatch]);
6865
7085
  }
6866
- function PickerHeading({ context, canRemove, onRemove }) {
6867
- const legend = LEGEND[context];
6868
- if (!legend && !canRemove) return null;
6869
- return /* @__PURE__ */ jsxs("div", {
6870
- className: "-mb-0.5 flex flex-wrap items-center justify-between gap-2",
6871
- children: [/* @__PURE__ */ jsx("span", {
6872
- className: "text-sm font-semibold leading-6",
6873
- children: legend
6874
- }), canRemove ? /* @__PURE__ */ jsxs(Button, {
7086
+ function RemoveLocationButton({ onRemove }) {
7087
+ return /* @__PURE__ */ jsx("div", {
7088
+ className: "-mb-0.5 flex justify-end",
7089
+ children: /* @__PURE__ */ jsxs(Button, {
6875
7090
  type: "button",
6876
- variant: "ghost",
7091
+ variant: "link",
6877
7092
  size: "sm",
6878
- className: "h-7 px-2.5 text-[13px] text-muted-foreground",
7093
+ className: "h-7 px-2.5 text-[13px]",
6879
7094
  onClick: onRemove,
6880
7095
  children: [/* @__PURE__ */ jsx(Trash2, { "aria-hidden": "true" }), "Remove location"]
6881
- }) : null]
7096
+ })
6882
7097
  });
6883
7098
  }
6884
7099
  /** The place in use, or the search while there isn't one (or while "Change" is open). */
6885
- function PlaceRow({ controller, ui, idBase, siteCountry }) {
7100
+ function PlaceRow({ controller, ui, idBase, siteCountry, businessOffer }) {
6886
7101
  const address = controller.state.location?.address ?? null;
6887
7102
  if (address && !ui.changing) return /* @__PURE__ */ jsx(ChosenPlace, {
6888
7103
  address,
6889
- chosenName: ui.chosenName,
7104
+ chosenName: controller.state.chosenName,
6890
7105
  siteCountry,
6891
7106
  fieldsOpen: ui.fieldsOpen,
6892
7107
  idBase,
@@ -6901,14 +7116,16 @@ function PlaceRow({ controller, ui, idBase, siteCountry }) {
6901
7116
  announce: ui.setAnnouncement,
6902
7117
  changingFrom: address ? addressName(address) : null,
6903
7118
  onKeepCurrent: ui.keepCurrent,
7119
+ businessOffer,
7120
+ onBusinessAddress: ui.adoptBusinessAddress,
6904
7121
  onChosen: ui.choose,
6905
- onManual: ui.manual,
7122
+ onTyped: ui.keepTyped,
6906
7123
  onCoordinates: ui.placeAt
6907
7124
  });
6908
7125
  }
6909
- /** A refused Save points at what still needs answering: the coordinates, or the status line's question. */
7126
+ /** A refused Save points at what still needs answering. A lookup still running isn't a question for the owner, so nothing's marked. */
6910
7127
  function saveErrorTargets(save, saveError) {
6911
- if (save.kind === "ready" || !saveError) return {
7128
+ if (save.kind === "ready" || isSavePending(save) || !saveError) return {
6912
7129
  status: null,
6913
7130
  coordinates: null
6914
7131
  };
@@ -6931,7 +7148,6 @@ function mapAreaProps(props, ui, idBase) {
6931
7148
  MapComponent: props.MapComponent,
6932
7149
  active: props.active ?? true,
6933
7150
  pinOptional: context === "business",
6934
- mapRef: ui.mapRef,
6935
7151
  forcePinTab: errors.status !== null || errors.coordinates !== null,
6936
7152
  coordinatesError: errors.coordinates,
6937
7153
  previewAppearance: props.previewAppearance,
@@ -6991,12 +7207,15 @@ function usePickerUi(controller, idBase) {
6991
7207
  const { state, dispatch } = controller;
6992
7208
  const [fieldsOpen, setFieldsOpen] = useState(false);
6993
7209
  const [changing, setChanging] = useState(false);
6994
- const [chosenName, setChosenName] = useState(null);
6995
7210
  const [editedAddress, setEditedAddress] = useState(null);
6996
7211
  const [announcement, setAnnouncement] = useState("");
6997
- const chosenRef = useRef(null), mapRef = useRef(null), streetRef = useRef(null);
7212
+ const chosenRef = useRef(null), streetRef = useRef(null);
6998
7213
  const address = state.location?.address ?? null;
6999
7214
  const searchInput = () => document.getElementById(`${idBase}-search`);
7215
+ const closeChange = () => {
7216
+ setChanging(false);
7217
+ setEditedAddress(null);
7218
+ };
7000
7219
  const statusActions = {
7001
7220
  undo: state.undo && state.location ? () => dispatch({
7002
7221
  type: "undo",
@@ -7015,13 +7234,11 @@ function usePickerUi(controller, idBase) {
7015
7234
  fieldsOpen,
7016
7235
  setFieldsOpen,
7017
7236
  changing,
7018
- chosenName,
7019
7237
  setEditedAddress,
7020
7238
  announcement,
7021
7239
  setAnnouncement,
7022
7240
  addressEdited: editedAddress !== null && address !== null && sameMeaningfulAddress(editedAddress, address),
7023
7241
  chosenRef,
7024
- mapRef,
7025
7242
  streetRef,
7026
7243
  statusActions,
7027
7244
  choose: (candidate) => {
@@ -7029,33 +7246,35 @@ function usePickerUi(controller, idBase) {
7029
7246
  type: "select",
7030
7247
  candidate
7031
7248
  });
7249
+ closeChange();
7250
+ setAnnouncement(`Chose ${candidate.name ?? addressName(candidate.address)}. ${candidate.match.precision === "street" || candidate.match.precision === "area" ? "This is an area, so move the pin to where people arrive." : `The pin is on ${addressName(candidate.address)}.`}`);
7251
+ focusSoon(() => chosenRef.current);
7252
+ },
7253
+ adoptBusinessAddress: (offer) => {
7032
7254
  dispatch({
7033
- type: "query",
7034
- query: ""
7255
+ type: "adopt-location",
7256
+ location: offer.location
7035
7257
  });
7036
- setChosenName(candidate.name ? {
7037
- name: candidate.name,
7038
- address: candidate.address
7039
- } : null);
7040
- setChanging(false);
7041
- setEditedAddress(null);
7042
- setAnnouncement(`Chose ${candidate.name ?? addressName(candidate.address)}. ${candidate.match.precision === "street" || candidate.match.precision === "area" ? "This is an area, so move the pin to where people arrive." : `The pin is on ${addressName(candidate.address)}.`}`);
7258
+ closeChange();
7259
+ setAnnouncement(`Using your business address, ${offer.line}.`);
7043
7260
  focusSoon(() => chosenRef.current);
7044
7261
  },
7045
- manual: () => {
7046
- setChanging(false);
7047
- setAnnouncement("Place the pin where people should arrive, or use Enter coordinates.");
7048
- focusSoon(() => mapRef.current);
7262
+ keepTyped: (text) => {
7263
+ dispatch({
7264
+ type: "use-typed-address",
7265
+ text,
7266
+ now: Date.now()
7267
+ });
7268
+ closeChange();
7269
+ setFieldsOpen(true);
7270
+ setAnnouncement("Using the address as you typed it. Check the address fields, then place the pin.");
7271
+ focusSoon(() => streetRef.current);
7049
7272
  },
7050
7273
  placeAt: (pin) => {
7051
7274
  dispatch({
7052
- type: "pin",
7275
+ type: "use-coordinates",
7053
7276
  pin
7054
7277
  });
7055
- dispatch({
7056
- type: "query",
7057
- query: ""
7058
- });
7059
7278
  setAnnouncement("Pin placed at those coordinates.");
7060
7279
  },
7061
7280
  startChange: () => {
@@ -7082,7 +7301,6 @@ function usePickerUi(controller, idBase) {
7082
7301
  });
7083
7302
  setFieldsOpen(false);
7084
7303
  setChanging(false);
7085
- setChosenName(null);
7086
7304
  toast("Location removed.", {
7087
7305
  duration: 5e3,
7088
7306
  action: {
@@ -7099,6 +7317,11 @@ function usePickerUi(controller, idBase) {
7099
7317
  }
7100
7318
  //#endregion
7101
7319
  //#region ../editor-blocks/src/widgets/location/useLocationPicker.ts
7320
+ /** Geoapify's own limit is 5 seconds; past this a lookup counts as failed, so a save can never wait on it for long. */
7321
+ const LOOKUP_TIMEOUT_MS = 8e3;
7322
+ /** Waits out the shared 2-a-second budget, and leaves the extra lookup to text the owner has stopped typing. */
7323
+ const FULL_SEARCH_PAUSE_MS = 1200;
7324
+ const LOOKUP_TIMED_OUT = { kind: "unavailable" };
7102
7325
  async function geocode(client, siteId, body) {
7103
7326
  return client ? unwrapResponse(await client({
7104
7327
  endpoint: "geocodeLocation",
@@ -7112,23 +7335,32 @@ function useLocationPicker(input) {
7112
7335
  const client = input.apiClient ?? environment?.apiClient;
7113
7336
  const [state, dispatch] = useReducer(locationPickerReducer, input.initialLocation, createLocationPickerState);
7114
7337
  useOpeningCheckPersistence(input, state);
7338
+ const save = pickerSaveDecision(state);
7339
+ const reportSave = useEffectEvent(() => input.onSaveSettled?.(save));
7115
7340
  const run = useEffectEvent((request) => input.geocode ? input.geocode(input.siteId, request) : geocode(client, input.siteId, request));
7116
7341
  const context = useEffectEvent(() => input.proximity ?? state.location?.pin ?? void 0);
7117
- useEffect(() => {
7118
- if (state.check !== "opening") return;
7342
+ const opening = !state.authored && addressCheckOwed(state.location);
7343
+ const addressCheck = () => {
7119
7344
  const query = formatLocationAddress(state.location?.address ?? null);
7120
- if (query) dispatch({
7345
+ return query && !addressCheckDone(state.location) ? {
7346
+ operation: "address-check",
7347
+ query,
7348
+ mode: state.mode,
7349
+ proximity: context()
7350
+ } : null;
7351
+ };
7352
+ const startOpeningCheck = useEffectEvent(() => {
7353
+ const input = addressCheck();
7354
+ if (input) dispatch({
7121
7355
  type: "request",
7122
7356
  now: Date.now(),
7123
- input: {
7124
- operation: "address-check",
7125
- query,
7126
- mode: state.mode,
7127
- proximity: context()
7128
- }
7357
+ input
7129
7358
  });
7359
+ });
7360
+ useEffect(() => {
7361
+ if (opening) startOpeningCheck();
7130
7362
  }, [
7131
- state.check,
7363
+ opening,
7132
7364
  state.revision,
7133
7365
  state.mode
7134
7366
  ]);
@@ -7146,11 +7378,38 @@ function useLocationPicker(input) {
7146
7378
  }), 350);
7147
7379
  return () => clearTimeout(timer);
7148
7380
  }, [state.query, state.mode]);
7381
+ const fullSearchDue = wantsFullSearch(state);
7382
+ useEffect(() => {
7383
+ if (!fullSearchDue) return;
7384
+ const timer = setTimeout(() => dispatch({
7385
+ type: "request",
7386
+ now: Date.now(),
7387
+ input: {
7388
+ operation: "autocomplete",
7389
+ fullSearch: true,
7390
+ query: state.query.trim(),
7391
+ mode: state.mode,
7392
+ proximity: context()
7393
+ }
7394
+ }), FULL_SEARCH_PAUSE_MS);
7395
+ return () => clearTimeout(timer);
7396
+ }, [
7397
+ fullSearchDue,
7398
+ state.query,
7399
+ state.mode
7400
+ ]);
7149
7401
  useEffect(() => {
7150
7402
  const request = state.request;
7151
7403
  if (!request) return;
7152
7404
  const cancellation = new AbortController();
7405
+ const deadline = setTimeout(() => dispatch({
7406
+ type: "reply",
7407
+ request,
7408
+ response: LOOKUP_TIMED_OUT,
7409
+ now: Date.now()
7410
+ }), LOOKUP_TIMEOUT_MS);
7153
7411
  run(request.input).catch(() => ({ kind: "unavailable" })).then((response) => {
7412
+ clearTimeout(deadline);
7154
7413
  if (!cancellation.signal.aborted) dispatch({
7155
7414
  type: "reply",
7156
7415
  request,
@@ -7158,27 +7417,47 @@ function useLocationPicker(input) {
7158
7417
  now: Date.now()
7159
7418
  });
7160
7419
  });
7161
- return () => cancellation.abort();
7420
+ return () => {
7421
+ clearTimeout(deadline);
7422
+ cancellation.abort();
7423
+ };
7162
7424
  }, [state.request]);
7163
- const request = (operation) => {
7164
- const query = formatLocationAddress(state.location?.address ?? null), point = state.location?.pin;
7165
- if (operation === "reverse") {
7166
- if (point) dispatch({
7167
- type: "request",
7168
- now: Date.now(),
7169
- input: {
7170
- operation,
7171
- point
7172
- }
7173
- });
7174
- } else if (query) dispatch({
7425
+ const saveSettled = state.saveIntent === "settled";
7426
+ useEffect(() => {
7427
+ if (!saveSettled) return;
7428
+ dispatch({ type: "save-reported" });
7429
+ reportSave();
7430
+ }, [saveSettled]);
7431
+ /**
7432
+ * The one way to save: one click runs whatever check is outstanding, then answers through onSaveSettled.
7433
+ * A form that saves something other than the draft passes what it would save, so it only waits if that's pending.
7434
+ * onSaveSettled still reports the draft's decision, so that form reads its own when it's called.
7435
+ */
7436
+ const requestSave = (savingNow = save) => {
7437
+ const wait = isSavePending(savingNow);
7438
+ dispatch({
7439
+ type: "request-save",
7440
+ wait,
7441
+ check: wait ? addressCheck() : null,
7442
+ now: Date.now()
7443
+ });
7444
+ };
7445
+ const checkAddress = () => {
7446
+ const check = addressCheck();
7447
+ if (check) dispatch({
7448
+ type: "request",
7449
+ now: Date.now(),
7450
+ input: check
7451
+ });
7452
+ };
7453
+ const findAddressAtPin = () => {
7454
+ const point = state.location?.pin;
7455
+ if (point) dispatch({
7175
7456
  type: "request",
7176
7457
  now: Date.now(),
7177
7458
  input: {
7178
- operation,
7179
- query,
7180
- mode: state.mode,
7181
- proximity: context()
7459
+ operation: "reverse",
7460
+ point
7182
7461
  }
7183
7462
  });
7184
7463
  };
@@ -7186,9 +7465,12 @@ function useLocationPicker(input) {
7186
7465
  siteId: input.siteId,
7187
7466
  state,
7188
7467
  dispatch,
7189
- save: pickerSaveDecision(state),
7190
- checkAddress: () => request("address-check"),
7191
- useAddressAtPin: () => request("reverse"),
7468
+ save,
7469
+ saveRequested: state.saveIntent === "waiting",
7470
+ saveInterrupted: state.saveIntent === "interrupted",
7471
+ requestSave,
7472
+ checkAddress,
7473
+ useAddressAtPin: findAddressAtPin,
7192
7474
  retryLookup: () => dispatch({
7193
7475
  type: "retry",
7194
7476
  now: Date.now()
@@ -7215,6 +7497,8 @@ function useOpeningCheckPersistence(input, state) {
7215
7497
  }
7216
7498
  //#endregion
7217
7499
  //#region ../editor-blocks/src/widgets/location/LocationPickerField.tsx
7500
+ /** Block forms have no Save button to run the check from, so it runs once the owner pauses. */
7501
+ const AUTO_CHECK_MS = 1500;
7218
7502
  function LocationPickerField({ path, backend }) {
7219
7503
  const { siteId } = useLocationPickerWidgetContext();
7220
7504
  const { value, setValue } = useField(path, backend);
@@ -7258,6 +7542,13 @@ function CanonicalLocationField({ siteId, path, backend, value, setValue, needsP
7258
7542
  backend.form,
7259
7543
  path
7260
7544
  ]);
7545
+ const checkAddress = useEffectEvent(() => picker.checkAddress());
7546
+ const checkWaiting = addressCheckOwed(picker.state.location) && !placeLookupRunning(picker.state);
7547
+ useEffect(() => {
7548
+ if (!checkWaiting) return;
7549
+ const timer = setTimeout(checkAddress, AUTO_CHECK_MS);
7550
+ return () => clearTimeout(timer);
7551
+ }, [checkWaiting, picker.state.revision]);
7261
7552
  const decided = (decision) => {
7262
7553
  if (needsPlace && decision.kind === "ready" && decision.location === null) {
7263
7554
  backend.setError(path, { message: "Choose this place again." });