@flarehr/apollo-benefits 0.1.109 → 0.3.53405

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 (216) hide show
  1. package/README.md +19 -0
  2. package/dist/assets/@splitsoftware-7d799540.js +18 -0
  3. package/dist/assets/all_tab_color-548783b9.svg +21 -0
  4. package/dist/assets/all_tab_gray-a5051313.svg +6 -0
  5. package/dist/assets/check-57fe1dcb.svg +15 -0
  6. package/dist/assets/datadog-ff247651.js +5 -0
  7. package/dist/assets/date-fns-c5d8fbc0.js +1 -0
  8. package/dist/assets/default_backdrop-fdd955b8.png +0 -0
  9. package/dist/assets/external_link-599a0aec.svg +3 -0
  10. package/dist/assets/external_link_white-55111b2e.svg +3 -0
  11. package/dist/assets/framer-motion-bb8d6b82.js +1 -0
  12. package/dist/assets/index-0b3afb09.js +5 -0
  13. package/dist/assets/index-5e9e5aa9.js +35 -0
  14. package/dist/assets/index-cfa25e28.css +1 -0
  15. package/dist/assets/lodash-5d893f8c.js +1 -0
  16. package/dist/assets/logo-a34e9b4b.png +0 -0
  17. package/dist/assets/oidc-client-6f6e47c2.js +101 -0
  18. package/dist/assets/padlock-8c081120.svg +26 -0
  19. package/dist/assets/suitcase-6471ad05.svg +17 -0
  20. package/dist/assets/vendor-2d0139ca.js +788 -0
  21. package/dist/assets/warning-a7f1af23.svg +14 -0
  22. package/dist/assets/welcome_image_mobile-dbde6c80.png +0 -0
  23. package/dist/assets/welcome_image_v2-869c59e4.png +0 -0
  24. package/dist/assets/wellbeing_banner-6903d615.png +0 -0
  25. package/dist/assets/workplace_link_banner_mobile-6ebaa24b.png +0 -0
  26. package/dist/assets/workplace_link_banner_v2-c81ed849.png +0 -0
  27. package/dist/config.json +14 -0
  28. package/dist/favicon.ico +0 -0
  29. package/dist/icons/android-chrome-192x192.png +0 -0
  30. package/dist/icons/android-chrome-512x512.png +0 -0
  31. package/dist/icons/apple-touch-icon.png +0 -0
  32. package/dist/icons/favicon-16x16.png +0 -0
  33. package/dist/icons/favicon-32x32.png +0 -0
  34. package/dist/index.html +114 -0
  35. package/dist/manifest.json +21 -0
  36. package/dist/sw-esm.js +16 -0
  37. package/package.json +129 -60
  38. package/LICENSE +0 -21
  39. package/dist/lib/apollo-benefits/apollo-benefits.esm.js +0 -1
  40. package/dist/lib/apollo-benefits/assets/car-placeholder.svg +0 -5
  41. package/dist/lib/apollo-benefits/assets/check.svg +0 -13
  42. package/dist/lib/apollo-benefits/index.esm.js +0 -0
  43. package/dist/lib/apollo-benefits/p-06a1f65f.js +0 -1
  44. package/dist/lib/apollo-benefits/p-077d7f8d.entry.js +0 -1
  45. package/dist/lib/apollo-benefits/p-14054f15.js +0 -1
  46. package/dist/lib/apollo-benefits/p-24a37d64.js +0 -1
  47. package/dist/lib/apollo-benefits/p-2b3f3b72.entry.js +0 -1
  48. package/dist/lib/apollo-benefits/p-3111d565.entry.js +0 -1
  49. package/dist/lib/apollo-benefits/p-327396fa.entry.js +0 -1
  50. package/dist/lib/apollo-benefits/p-3d4d2683.js +0 -1
  51. package/dist/lib/apollo-benefits/p-4474bcf8.entry.js +0 -1
  52. package/dist/lib/apollo-benefits/p-4bff99bd.entry.js +0 -1
  53. package/dist/lib/apollo-benefits/p-50fe790f.js +0 -1
  54. package/dist/lib/apollo-benefits/p-53bcbd1d.js +0 -1
  55. package/dist/lib/apollo-benefits/p-68c136da.js +0 -1
  56. package/dist/lib/apollo-benefits/p-6bd16f5b.js +0 -1
  57. package/dist/lib/apollo-benefits/p-71dbc8ff.entry.js +0 -1
  58. package/dist/lib/apollo-benefits/p-774d9bc5.entry.js +0 -1
  59. package/dist/lib/apollo-benefits/p-7a2ca86d.entry.js +0 -1
  60. package/dist/lib/apollo-benefits/p-7a572b50.js +0 -1
  61. package/dist/lib/apollo-benefits/p-7c2cd94a.entry.js +0 -1
  62. package/dist/lib/apollo-benefits/p-839493d7.entry.js +0 -1
  63. package/dist/lib/apollo-benefits/p-a24d169b.entry.js +0 -1
  64. package/dist/lib/apollo-benefits/p-b33fc683.js +0 -1
  65. package/dist/lib/apollo-benefits/p-beb8f728.entry.js +0 -1
  66. package/dist/lib/apollo-benefits/p-e241f55b.entry.js +0 -1
  67. package/dist/lib/apollo-benefits/p-e28cee25.js +0 -1
  68. package/dist/lib/apollo-benefits/p-e3cf51f1.entry.js +0 -1
  69. package/dist/lib/apollo-benefits/p-ef8ea713.entry.js +0 -1
  70. package/dist/lib/apollo-benefits/p-f0a7c9fa.entry.js +0 -1
  71. package/dist/lib/apollo-benefits/p-f603197d.js +0 -15
  72. package/dist/lib/cjs/active-router-0ecaf2b8.js +0 -75
  73. package/dist/lib/cjs/ap-ben-choose-vehicle-section_4.cjs.entry.js +0 -2708
  74. package/dist/lib/cjs/ap-ben-complete-section_4.cjs.entry.js +0 -108
  75. package/dist/lib/cjs/ap-ben-notifications-section.cjs.entry.js +0 -238
  76. package/dist/lib/cjs/apollo-benefits.cjs.js +0 -25
  77. package/dist/lib/cjs/app-globals-67583b8b.js +0 -12
  78. package/dist/lib/cjs/async-6a7926f0.js +0 -753
  79. package/dist/lib/cjs/cars-calculator-app.cjs.entry.js +0 -55
  80. package/dist/lib/cjs/cars-calculator.service-c0e51584.js +0 -904
  81. package/dist/lib/cjs/context-consumer.cjs.entry.js +0 -29
  82. package/dist/lib/cjs/datorama-akita-31d23240.js +0 -2551
  83. package/dist/lib/cjs/delay-d31618c3.js +0 -206
  84. package/dist/lib/cjs/distinctUntilChanged-e8538790.js +0 -371
  85. package/dist/lib/cjs/dom-utils-b8befdd5.js +0 -63
  86. package/dist/lib/cjs/fl-button_2.cjs.entry.js +0 -50
  87. package/dist/lib/cjs/fl-dropdown-async_2.cjs.entry.js +0 -467
  88. package/dist/lib/cjs/fl-dropdown.cjs.entry.js +0 -232
  89. package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -91
  90. package/dist/lib/cjs/index-f1fadf90.js +0 -1735
  91. package/dist/lib/cjs/index.cjs.js +0 -2
  92. package/dist/lib/cjs/loader.cjs.js +0 -27
  93. package/dist/lib/cjs/location-utils-36fe7e5e.js +0 -237
  94. package/dist/lib/cjs/match-path-be4ea5f6.js +0 -279
  95. package/dist/lib/cjs/session.query-d61ba7ec.js +0 -1731
  96. package/dist/lib/cjs/stencil-async-content.cjs.entry.js +0 -32
  97. package/dist/lib/cjs/stencil-route-link.cjs.entry.js +0 -78
  98. package/dist/lib/cjs/stencil-route-switch.cjs.entry.js +0 -104
  99. package/dist/lib/cjs/stencil-route-title.cjs.entry.js +0 -32
  100. package/dist/lib/cjs/stencil-route.cjs.entry.js +0 -97
  101. package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +0 -59
  102. package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +0 -32
  103. package/dist/lib/cjs/stencil-router.cjs.entry.js +0 -640
  104. package/dist/lib/collection/assets/image/complete.svg +0 -122
  105. package/dist/lib/collection/collection-manifest.json +0 -53
  106. package/dist/lib/collection/components/cars-calculator-app/api/api-client.js +0 -5
  107. package/dist/lib/collection/components/cars-calculator-app/api/cars-calculator.api.js +0 -45
  108. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.css +0 -22
  109. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.js +0 -97
  110. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.css +0 -0
  111. package/dist/lib/collection/components/cars-calculator-app/modal-section/modal-section.js +0 -144
  112. package/dist/lib/collection/components/cars-calculator-app/notifications-section/notifications-section.js +0 -25
  113. package/dist/lib/collection/components/cars-calculator-app/pages/assets/car-placeholder.svg +0 -5
  114. package/dist/lib/collection/components/cars-calculator-app/pages/assets/check.svg +0 -13
  115. package/dist/lib/collection/components/cars-calculator-app/pages/choose-vehicle-section.component.js +0 -196
  116. package/dist/lib/collection/components/cars-calculator-app/pages/complete-section.component.js +0 -38
  117. package/dist/lib/collection/components/cars-calculator-app/pages/cost-breakdown-section.component.js +0 -45
  118. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.css +0 -34
  119. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.js +0 -85
  120. package/dist/lib/collection/components/cars-calculator-app/pages/personal-info-section.component.js +0 -66
  121. package/dist/lib/collection/components/cars-calculator-app/pages/quote-result-section.component.js +0 -86
  122. package/dist/lib/collection/components/cars-calculator-app/pages/submit-quote-section.component.js +0 -75
  123. package/dist/lib/collection/components/cars-calculator-app/services/app-configuration.service.js +0 -13
  124. package/dist/lib/collection/components/cars-calculator-app/services/cars-calculator.service.js +0 -106
  125. package/dist/lib/collection/components/cars-calculator-app/services/notifications.service.js +0 -37
  126. package/dist/lib/collection/components/cars-calculator-app/services/notifications.store.js +0 -3
  127. package/dist/lib/collection/components/cars-calculator-app/services/session.query.js +0 -35
  128. package/dist/lib/collection/components/cars-calculator-app/services/session.store.js +0 -78
  129. package/dist/lib/collection/global/config.js +0 -2
  130. package/dist/lib/collection/global/main.dev.js +0 -5
  131. package/dist/lib/collection/global/main.js +0 -5
  132. package/dist/lib/collection/index.js +0 -2
  133. package/dist/lib/collection/utils/config.js +0 -2
  134. package/dist/lib/collection/utils/index.js +0 -15
  135. package/dist/lib/collection/utils/lazy.js +0 -29
  136. package/dist/lib/esm/active-router-7c2ca849.js +0 -73
  137. package/dist/lib/esm/ap-ben-choose-vehicle-section_4.entry.js +0 -2701
  138. package/dist/lib/esm/ap-ben-complete-section_4.entry.js +0 -101
  139. package/dist/lib/esm/ap-ben-notifications-section.entry.js +0 -234
  140. package/dist/lib/esm/apollo-benefits.js +0 -23
  141. package/dist/lib/esm/app-globals-65714cca.js +0 -10
  142. package/dist/lib/esm/async-68e9cad7.js +0 -738
  143. package/dist/lib/esm/cars-calculator-app.entry.js +0 -51
  144. package/dist/lib/esm/cars-calculator.service-27826530.js +0 -897
  145. package/dist/lib/esm/context-consumer.entry.js +0 -25
  146. package/dist/lib/esm/datorama-akita-c87196a0.js +0 -2545
  147. package/dist/lib/esm/delay-115d4292.js +0 -200
  148. package/dist/lib/esm/distinctUntilChanged-bf69e0f8.js +0 -363
  149. package/dist/lib/esm/dom-utils-109a7d75.js +0 -55
  150. package/dist/lib/esm/fl-button_2.entry.js +0 -45
  151. package/dist/lib/esm/fl-dropdown-async_2.entry.js +0 -462
  152. package/dist/lib/esm/fl-dropdown.entry.js +0 -228
  153. package/dist/lib/esm/fl-style-guide.entry.js +0 -87
  154. package/dist/lib/esm/index-19c4d245.js +0 -1703
  155. package/dist/lib/esm/index.js +0 -1
  156. package/dist/lib/esm/loader.js +0 -23
  157. package/dist/lib/esm/location-utils-312665d3.js +0 -226
  158. package/dist/lib/esm/match-path-4b5c7d98.js +0 -276
  159. package/dist/lib/esm/polyfills/core-js.js +0 -11
  160. package/dist/lib/esm/polyfills/css-shim.js +0 -1
  161. package/dist/lib/esm/polyfills/dom.js +0 -79
  162. package/dist/lib/esm/polyfills/es5-html-element.js +0 -1
  163. package/dist/lib/esm/polyfills/index.js +0 -34
  164. package/dist/lib/esm/polyfills/system.js +0 -6
  165. package/dist/lib/esm/session.query-0f1c9503.js +0 -1719
  166. package/dist/lib/esm/stencil-async-content.entry.js +0 -28
  167. package/dist/lib/esm/stencil-route-link.entry.js +0 -74
  168. package/dist/lib/esm/stencil-route-switch.entry.js +0 -100
  169. package/dist/lib/esm/stencil-route-title.entry.js +0 -28
  170. package/dist/lib/esm/stencil-route.entry.js +0 -93
  171. package/dist/lib/esm/stencil-router-prompt.entry.js +0 -55
  172. package/dist/lib/esm/stencil-router-redirect.entry.js +0 -28
  173. package/dist/lib/esm/stencil-router.entry.js +0 -636
  174. package/dist/lib/index.cjs.js +0 -1
  175. package/dist/lib/index.js +0 -1
  176. package/dist/lib/loader/cdn.js +0 -3
  177. package/dist/lib/loader/index.cjs.js +0 -3
  178. package/dist/lib/loader/index.d.ts +0 -13
  179. package/dist/lib/loader/index.es2017.js +0 -3
  180. package/dist/lib/loader/index.js +0 -4
  181. package/dist/lib/loader/package.json +0 -10
  182. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -45
  183. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
  184. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
  185. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
  186. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
  187. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
  188. package/dist/lib/node_modules/@stencil/router/dist/collection/components/route/route.css +0 -3
  189. package/dist/lib/types/components/cars-calculator-app/api/api-client.d.ts +0 -2
  190. package/dist/lib/types/components/cars-calculator-app/api/cars-calculator.api.d.ts +0 -99
  191. package/dist/lib/types/components/cars-calculator-app/cars-calculator-app.d.ts +0 -17
  192. package/dist/lib/types/components/cars-calculator-app/modal-section/modal-section.d.ts +0 -16
  193. package/dist/lib/types/components/cars-calculator-app/notifications-section/notifications-section.d.ts +0 -5
  194. package/dist/lib/types/components/cars-calculator-app/pages/choose-vehicle-section.component.d.ts +0 -23
  195. package/dist/lib/types/components/cars-calculator-app/pages/complete-section.component.d.ts +0 -5
  196. package/dist/lib/types/components/cars-calculator-app/pages/cost-breakdown-section.component.d.ts +0 -6
  197. package/dist/lib/types/components/cars-calculator-app/pages/model-variants-section.component.d.ts +0 -12
  198. package/dist/lib/types/components/cars-calculator-app/pages/personal-info-section.component.d.ts +0 -10
  199. package/dist/lib/types/components/cars-calculator-app/pages/quote-result-section.component.d.ts +0 -13
  200. package/dist/lib/types/components/cars-calculator-app/pages/submit-quote-section.component.d.ts +0 -10
  201. package/dist/lib/types/components/cars-calculator-app/services/app-configuration.service.d.ts +0 -7
  202. package/dist/lib/types/components/cars-calculator-app/services/cars-calculator.service.d.ts +0 -11
  203. package/dist/lib/types/components/cars-calculator-app/services/notifications.service.d.ts +0 -15
  204. package/dist/lib/types/components/cars-calculator-app/services/notifications.store.d.ts +0 -14
  205. package/dist/lib/types/components/cars-calculator-app/services/session.query.d.ts +0 -25
  206. package/dist/lib/types/components/cars-calculator-app/services/session.store.d.ts +0 -77
  207. package/dist/lib/types/components.d.ts +0 -170
  208. package/dist/lib/types/global/config.d.ts +0 -2
  209. package/dist/lib/types/global/main.d.ts +0 -1
  210. package/dist/lib/types/global/main.dev.d.ts +0 -1
  211. package/dist/lib/types/index.d.ts +0 -2
  212. package/dist/lib/types/stencil-public-runtime.d.ts +0 -1555
  213. package/dist/lib/types/utils/config.d.ts +0 -2
  214. package/dist/lib/types/utils/index.d.ts +0 -7
  215. package/dist/lib/types/utils/lazy.d.ts +0 -12
  216. package/readme.md +0 -1
@@ -0,0 +1 @@
1
+ import{G as lt,y as Ui,p as ke,q as k,k as Dt,l as Ni,T as Pe,F as Ft,n as Gi,o as Ht,V as Wi,w as ps,r as $i}from"./vendor-2d0139ca.js";const gs=lt({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),te=lt({}),Ee=lt(null),ee=typeof document<"u",ys=ee?Ui:ke,vs=lt({strict:!1});function Hi(t,e,n,s){const{visualElement:i}=k(te),o=k(vs),r=k(Ee),a=k(gs).reducedMotion,c=Dt();s=s||o.renderer,!c.current&&s&&(c.current=s(t,{visualState:e,parent:i,props:n,presenceContext:r,blockInitialAnimation:r?r.initial===!1:!1,reducedMotionConfig:a}));const l=c.current;Ni(()=>{l&&l.update(n,r)});const u=Dt(!!window.HandoffAppearAnimations);return ys(()=>{l&&(l.render(),u.current&&l.animationState&&l.animationState.animateChanges())}),ke(()=>{l&&(l.updateFeatures(),!u.current&&l.animationState&&l.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,u.current=!1)}),l}function dt(t){return typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function zi(t,e,n){return Pe(s=>{s&&t.mount&&t.mount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):dt(n)&&(n.current=s))},[e])}function Mt(t){return typeof t=="string"||Array.isArray(t)}function ne(t){return typeof t=="object"&&typeof t.start=="function"}const je=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Oe=["initial",...je];function se(t){return ne(t.animate)||Oe.some(e=>Mt(t[e]))}function xs(t){return!!(se(t)||t.variants)}function Ki(t,e){if(se(t)){const{initial:n,animate:s}=t;return{initial:n===!1||Mt(n)?n:void 0,animate:Mt(s)?s:void 0}}return t.inherit!==!1?e:{}}function _i(t){const{initial:e,animate:n}=Ki(t,k(te));return Ft(()=>({initial:e,animate:n}),[un(e),un(n)])}function un(t){return Array.isArray(t)?t.join(" "):t}const hn={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Lt={};for(const t in hn)Lt[t]={isEnabled:e=>hn[t].some(n=>!!e[n])};function Xi(t){for(const e in t)Lt[e]={...Lt[e],...t[e]}}const zt=lt({}),Ps=lt({}),Yi=Symbol.for("motionComponentSymbol");function qi({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:i}){t&&Xi(t);function o(a,c){let l;const u={...k(gs),...a,layoutId:Zi(a)},{isStatic:h}=u,f=_i(a),d=s(a,h);if(!h&&ee){f.visualElement=Hi(i,d,u,e);const m=k(Ps),p=k(vs).strict;f.visualElement&&(l=f.visualElement.loadFeatures(u,p,t,m))}return Ht(te.Provider,{value:f},l&&f.visualElement?Ht(l,{visualElement:f.visualElement,...u}):null,n(i,a,zi(d,f.visualElement,c),d,h,f.visualElement))}const r=Gi(o);return r[Yi]=i,r}function Zi({layoutId:t}){const e=k(zt).id;return e&&t!==void 0?e+"-"+t:t}function Qi(t){function e(s,i={}){return qi(t(s,i))}if(typeof Proxy>"u")return e;const n=new Map;return new Proxy(e,{get:(s,i)=>(n.has(i)||n.set(i,e(i)),n.get(i))})}const Ji=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function Ie(t){return typeof t!="string"||t.includes("-")?!1:!!(Ji.indexOf(t)>-1||/[A-Z]/.test(t))}const Kt={};function tr(t){Object.assign(Kt,t)}const Bt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ut=new Set(Bt);function Ts(t,{layout:e,layoutId:n}){return ut.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!Kt[t]||t==="opacity")}const O=t=>!!(t&&t.getVelocity),er={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nr=Bt.length;function sr(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},s,i){let o="";for(let r=0;r<nr;r++){const a=Bt[r];if(t[a]!==void 0){const c=er[a]||a;o+=`${c}(${t[a]}) `}}return e&&!t.z&&(o+="translateZ(0)"),o=o.trim(),i?o=i(t,s?"":o):n&&s&&(o="none"),o}const bs=t=>e=>typeof e=="string"&&e.startsWith(t),Vs=bs("--"),Te=bs("var(--"),ir=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,rr=(t,e)=>e&&typeof t=="number"?e.transform(t):t,et=(t,e,n)=>Math.min(Math.max(n,t),e),ht={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},St={...ht,transform:t=>et(0,1,t)},It={...ht,default:1},At=t=>Math.round(t*1e5)/1e5,ie=/(-)?([\d]*\.?[\d])+/g,Ss=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,or=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function kt(t){return typeof t=="string"}const Et=t=>({test:e=>kt(e)&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Z=Et("deg"),G=Et("%"),v=Et("px"),ar=Et("vh"),cr=Et("vw"),fn={...G,parse:t=>G.parse(t)/100,transform:t=>G.transform(t*100)},dn={...ht,transform:Math.round},As={borderWidth:v,borderTopWidth:v,borderRightWidth:v,borderBottomWidth:v,borderLeftWidth:v,borderRadius:v,radius:v,borderTopLeftRadius:v,borderTopRightRadius:v,borderBottomRightRadius:v,borderBottomLeftRadius:v,width:v,maxWidth:v,height:v,maxHeight:v,size:v,top:v,right:v,bottom:v,left:v,padding:v,paddingTop:v,paddingRight:v,paddingBottom:v,paddingLeft:v,margin:v,marginTop:v,marginRight:v,marginBottom:v,marginLeft:v,rotate:Z,rotateX:Z,rotateY:Z,rotateZ:Z,scale:It,scaleX:It,scaleY:It,scaleZ:It,skew:Z,skewX:Z,skewY:Z,distance:v,translateX:v,translateY:v,translateZ:v,x:v,y:v,z:v,perspective:v,transformPerspective:v,opacity:St,originX:fn,originY:fn,originZ:v,zIndex:dn,fillOpacity:St,strokeOpacity:St,numOctaves:dn};function Ue(t,e,n,s){const{style:i,vars:o,transform:r,transformOrigin:a}=t;let c=!1,l=!1,u=!0;for(const h in e){const f=e[h];if(Vs(h)){o[h]=f;continue}const d=As[h],m=rr(f,d);if(ut.has(h)){if(c=!0,r[h]=m,!u)continue;f!==(d.default||0)&&(u=!1)}else h.startsWith("origin")?(l=!0,a[h]=m):i[h]=m}if(e.transform||(c||s?i.transform=sr(t.transform,n,u,s):i.transform&&(i.transform="none")),l){const{originX:h="50%",originY:f="50%",originZ:d=0}=a;i.transformOrigin=`${h} ${f} ${d}`}}const Ne=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Cs(t,e,n){for(const s in e)!O(e[s])&&!Ts(s,n)&&(t[s]=e[s])}function lr({transformTemplate:t},e,n){return Ft(()=>{const s=Ne();return Ue(s,e,{enableHardwareAcceleration:!n},t),Object.assign({},s.vars,s.style)},[e])}function ur(t,e,n){const s=t.style||{},i={};return Cs(i,s,t),Object.assign(i,lr(t,e,n)),t.transformValues?t.transformValues(i):i}function hr(t,e,n){const s={},i=ur(t,e,n);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=i,s}const fr=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function _t(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||fr.has(t)}let ws=t=>!_t(t);function dr(t){t&&(ws=e=>e.startsWith("on")?!_t(e):t(e))}try{dr(require("@emotion/is-prop-valid").default)}catch{}function mr(t,e,n){const s={};for(const i in t)i==="values"&&typeof t.values=="object"||(ws(i)||n===!0&&_t(i)||!e&&!_t(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}function mn(t,e,n){return typeof t=="string"?t:v.transform(e+n*t)}function pr(t,e,n){const s=mn(e,t.x,t.width),i=mn(n,t.y,t.height);return`${s} ${i}`}const gr={offset:"stroke-dashoffset",array:"stroke-dasharray"},yr={offset:"strokeDashoffset",array:"strokeDasharray"};function vr(t,e,n=1,s=0,i=!0){t.pathLength=1;const o=i?gr:yr;t[o.offset]=v.transform(-s);const r=v.transform(e),a=v.transform(n);t[o.array]=`${r} ${a}`}function Ge(t,{attrX:e,attrY:n,attrScale:s,originX:i,originY:o,pathLength:r,pathSpacing:a=1,pathOffset:c=0,...l},u,h,f){if(Ue(t,l,u,f),h){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(i!==void 0||o!==void 0||m.transform)&&(m.transformOrigin=pr(p,i!==void 0?i:.5,o!==void 0?o:.5)),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),s!==void 0&&(d.scale=s),r!==void 0&&vr(d,r,a,c,!1)}const Ds=()=>({...Ne(),attrs:{}}),We=t=>typeof t=="string"&&t.toLowerCase()==="svg";function xr(t,e,n,s){const i=Ft(()=>{const o=Ds();return Ge(o,e,{enableHardwareAcceleration:!1},We(s),t.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(t.style){const o={};Cs(o,t.style,t),i.style={...o,...i.style}}return i}function Pr(t=!1){return(n,s,i,{latestValues:o},r)=>{const c=(Ie(n)?xr:hr)(s,o,r,n),u={...mr(s,typeof n=="string",t),...c,ref:i},{children:h}=s,f=Ft(()=>O(h)?h.get():h,[h]);return Ht(n,{...u,children:f})}}const $e=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Ms(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const o in n)t.style.setProperty(o,n[o])}const Ls=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Rs(t,e,n,s){Ms(t,e,void 0,s);for(const i in e.attrs)t.setAttribute(Ls.has(i)?i:$e(i),e.attrs[i])}function He(t,e){const{style:n}=t,s={};for(const i in n)(O(n[i])||e.style&&O(e.style[i])||Ts(i,t))&&(s[i]=n[i]);return s}function Fs(t,e){const n=He(t,e);for(const s in t)if(O(t[s])||O(e[s])){const i=Bt.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;n[i]=t[s]}return n}function ze(t,e,n,s={},i={}){return typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,i)),typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"&&(e=e(n!==void 0?n:t.custom,s,i)),e}function Tr(t){const e=Dt(null);return e.current===null&&(e.current=t()),e.current}const Xt=t=>Array.isArray(t),br=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Vr=t=>Xt(t)?t[t.length-1]||0:t;function Wt(t){const e=O(t)?t.get():t;return br(e)?e.toValue():e}function Sr({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},s,i,o){const r={latestValues:Ar(s,i,o,t),renderState:e()};return n&&(r.mount=a=>n(s,a,r)),r}const Bs=t=>(e,n)=>{const s=k(te),i=k(Ee),o=()=>Sr(t,e,s,i);return n?o():Tr(o)};function Ar(t,e,n,s){const i={},o=s(t,{});for(const f in o)i[f]=Wt(o[f]);let{initial:r,animate:a}=t;const c=se(t),l=xs(t);e&&l&&!c&&t.inherit!==!1&&(r===void 0&&(r=e.initial),a===void 0&&(a=e.animate));let u=n?n.initial===!1:!1;u=u||r===!1;const h=u?a:r;return h&&typeof h!="boolean"&&!ne(h)&&(Array.isArray(h)?h:[h]).forEach(d=>{const m=ze(t,d);if(!m)return;const{transitionEnd:p,transition:x,...b}=m;for(const y in b){let g=b[y];if(Array.isArray(g)){const P=u?g.length-1:0;g=g[P]}g!==null&&(i[y]=g)}for(const y in p)i[y]=p[y]}),i}const M=t=>t;class pn{constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){const n=this.order.indexOf(e);n!==-1&&(this.order.splice(n,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}function Cr(t){let e=new pn,n=new pn,s=0,i=!1,o=!1;const r=new WeakSet,a={schedule:(c,l=!1,u=!1)=>{const h=u&&i,f=h?e:n;return l&&r.add(c),f.add(c)&&h&&i&&(s=e.order.length),c},cancel:c=>{n.remove(c),r.delete(c)},process:c=>{if(i){o=!0;return}if(i=!0,[e,n]=[n,e],n.clear(),s=e.order.length,s)for(let l=0;l<s;l++){const u=e.order[l];u(c),r.has(u)&&(a.schedule(u),t())}i=!1,o&&(o=!1,a.process(c))}};return a}const Ut=["prepare","read","update","preRender","render","postRender"],wr=40;function Dr(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},o=Ut.reduce((h,f)=>(h[f]=Cr(()=>n=!0),h),{}),r=h=>o[h].process(i),a=()=>{const h=performance.now();n=!1,i.delta=s?1e3/60:Math.max(Math.min(h-i.timestamp,wr),1),i.timestamp=h,i.isProcessing=!0,Ut.forEach(r),i.isProcessing=!1,n&&e&&(s=!1,t(a))},c=()=>{n=!0,s=!0,i.isProcessing||t(a)};return{schedule:Ut.reduce((h,f)=>{const d=o[f];return h[f]=(m,p=!1,x=!1)=>(n||c(),d.schedule(m,p,x)),h},{}),cancel:h=>Ut.forEach(f=>o[f].cancel(h)),state:i,steps:o}}const{schedule:S,cancel:_,state:B,steps:ce}=Dr(typeof requestAnimationFrame<"u"?requestAnimationFrame:M,!0),Mr={useVisualState:Bs({scrapeMotionValuesFromProps:Fs,createRenderState:Ds,onMount:(t,e,{renderState:n,latestValues:s})=>{S.read(()=>{try{n.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{n.dimensions={x:0,y:0,width:0,height:0}}}),S.render(()=>{Ge(n,s,{enableHardwareAcceleration:!1},We(e.tagName),t.transformTemplate),Rs(e,n)})}})},Lr={useVisualState:Bs({scrapeMotionValuesFromProps:He,createRenderState:Ne})};function Rr(t,{forwardMotionProps:e=!1},n,s){return{...Ie(t)?Mr:Lr,preloadedFeatures:n,useRender:Pr(e),createVisualElement:s,Component:t}}function H(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}const ks=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1;function re(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const Fr=t=>e=>ks(e)&&t(e,re(e));function z(t,e,n,s){return H(t,e,Fr(n),s)}const Br=(t,e)=>n=>e(t(n)),J=(...t)=>t.reduce(Br);function Es(t){let e=null;return()=>{const n=()=>{e=null};return e===null?(e=t,n):!1}}const gn=Es("dragHorizontal"),yn=Es("dragVertical");function js(t){let e=!1;if(t==="y")e=yn();else if(t==="x")e=gn();else{const n=gn(),s=yn();n&&s?e=()=>{n(),s()}:(n&&n(),s&&s())}return e}function Os(){const t=js(!0);return t?(t(),!1):!0}class st{constructor(e){this.isMounted=!1,this.node=e}update(){}}function vn(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End"),i=(o,r)=>{if(o.type==="touch"||Os())return;const a=t.getProps();t.animationState&&a.whileHover&&t.animationState.setActive("whileHover",e),a[s]&&S.update(()=>a[s](o,r))};return z(t.current,n,i,{passive:!t.getProps()[s]})}class kr extends st{mount(){this.unmount=J(vn(this.node,!0),vn(this.node,!1))}unmount(){}}class Er extends st{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=J(H(this.node.current,"focus",()=>this.onFocus()),H(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const Is=(t,e)=>e?t===e?!0:Is(t,e.parentElement):!1;function le(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,re(n))}class jr extends st{constructor(){super(...arguments),this.removeStartListeners=M,this.removeEndListeners=M,this.removeAccessibleListeners=M,this.startPointerPress=(e,n)=>{if(this.removeEndListeners(),this.isPressing)return;const s=this.node.getProps(),o=z(window,"pointerup",(a,c)=>{if(!this.checkPressEnd())return;const{onTap:l,onTapCancel:u}=this.node.getProps();S.update(()=>{Is(this.node.current,a.target)?l&&l(a,c):u&&u(a,c)})},{passive:!(s.onTap||s.onPointerUp)}),r=z(window,"pointercancel",(a,c)=>this.cancelPress(a,c),{passive:!(s.onTapCancel||s.onPointerCancel)});this.removeEndListeners=J(o,r),this.startPress(e,n)},this.startAccessiblePress=()=>{const e=o=>{if(o.key!=="Enter"||this.isPressing)return;const r=a=>{a.key!=="Enter"||!this.checkPressEnd()||le("up",(c,l)=>{const{onTap:u}=this.node.getProps();u&&S.update(()=>u(c,l))})};this.removeEndListeners(),this.removeEndListeners=H(this.node.current,"keyup",r),le("down",(a,c)=>{this.startPress(a,c)})},n=H(this.node.current,"keydown",e),s=()=>{this.isPressing&&le("cancel",(o,r)=>this.cancelPress(o,r))},i=H(this.node.current,"blur",s);this.removeAccessibleListeners=J(n,i)}}startPress(e,n){this.isPressing=!0;const{onTapStart:s,whileTap:i}=this.node.getProps();i&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),s&&S.update(()=>s(e,n))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!Os()}cancelPress(e,n){if(!this.checkPressEnd())return;const{onTapCancel:s}=this.node.getProps();s&&S.update(()=>s(e,n))}mount(){const e=this.node.getProps(),n=z(this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),s=H(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=J(n,s)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}const be=new WeakMap,ue=new WeakMap,Or=t=>{const e=be.get(t.target);e&&e(t)},Ir=t=>{t.forEach(Or)};function Ur({root:t,...e}){const n=t||document;ue.has(n)||ue.set(n,{});const s=ue.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ir,{root:t,...e})),s[i]}function Nr(t,e,n){const s=Ur(e);return be.set(t,n),s.observe(t),()=>{be.delete(t),s.unobserve(t)}}const Gr={some:0,all:1};class Wr extends st{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:i="some",once:o}=e,r={root:n?n.current:void 0,rootMargin:s,threshold:typeof i=="number"?i:Gr[i]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,o&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),f=l?u:h;f&&f(c)};return Nr(this.node.current,r,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some($r(e,n))&&this.startObserver()}unmount(){}}function $r({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const Hr={inView:{Feature:Wr},tap:{Feature:jr},focus:{Feature:Er},hover:{Feature:kr}};function Us(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}function zr(t){const e={};return t.values.forEach((n,s)=>e[s]=n.get()),e}function Kr(t){const e={};return t.values.forEach((n,s)=>e[s]=n.getVelocity()),e}function oe(t,e,n){const s=t.getProps();return ze(s,e,n!==void 0?n:s.custom,zr(t),Kr(t))}const _r="framerAppearId",Xr="data-"+$e(_r);let Yr=M,Ke=M;const tt=t=>t*1e3,K=t=>t/1e3,qr={current:!1},Ns=t=>Array.isArray(t)&&typeof t[0]=="number";function Gs(t){return!!(!t||typeof t=="string"&&Ws[t]||Ns(t)||Array.isArray(t)&&t.every(Gs))}const Vt=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Ws={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Vt([0,.65,.55,1]),circOut:Vt([.55,0,1,.45]),backIn:Vt([.31,.01,.66,-.59]),backOut:Vt([.33,1.53,.69,.99])};function $s(t){if(t)return Ns(t)?Vt(t):Array.isArray(t)?t.map($s):Ws[t]}function Zr(t,e,n,{delay:s=0,duration:i,repeat:o=0,repeatType:r="loop",ease:a,times:c}={}){const l={[e]:n};c&&(l.offset=c);const u=$s(a);return Array.isArray(u)&&(l.easing=u),t.animate(l,{delay:s,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:o+1,direction:r==="reverse"?"alternate":"normal"})}function Qr(t,{repeat:e,repeatType:n="loop"}){const s=e&&n!=="loop"&&e%2===1?0:t.length-1;return t[s]}const Hs=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Jr=1e-7,to=12;function eo(t,e,n,s,i){let o,r,a=0;do r=e+(n-e)/2,o=Hs(r,s,i)-t,o>0?n=r:e=r;while(Math.abs(o)>Jr&&++a<to);return r}function jt(t,e,n,s){if(t===e&&n===s)return M;const i=o=>eo(o,0,1,t,n);return o=>o===0||o===1?o:Hs(i(o),e,s)}const no=jt(.42,0,1,1),so=jt(0,0,.58,1),zs=jt(.42,0,.58,1),io=t=>Array.isArray(t)&&typeof t[0]!="number",Ks=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,_s=t=>e=>1-t(1-e),Xs=t=>1-Math.sin(Math.acos(t)),_e=_s(Xs),ro=Ks(_e),Ys=jt(.33,1.53,.69,.99),Xe=_s(Ys),oo=Ks(Xe),ao=t=>(t*=2)<1?.5*Xe(t):.5*(2-Math.pow(2,-10*(t-1))),co={linear:M,easeIn:no,easeInOut:zs,easeOut:so,circIn:Xs,circInOut:ro,circOut:_e,backIn:Xe,backInOut:oo,backOut:Ys,anticipate:ao},xn=t=>{if(Array.isArray(t)){Ke(t.length===4);const[e,n,s,i]=t;return jt(e,n,s,i)}else if(typeof t=="string")return co[t];return t},Ye=(t,e)=>n=>!!(kt(n)&&or.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),qs=(t,e,n)=>s=>{if(!kt(s))return s;const[i,o,r,a]=s.match(ie);return{[t]:parseFloat(i),[e]:parseFloat(o),[n]:parseFloat(r),alpha:a!==void 0?parseFloat(a):1}},lo=t=>et(0,255,t),he={...ht,transform:t=>Math.round(lo(t))},ct={test:Ye("rgb","red"),parse:qs("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+he.transform(t)+", "+he.transform(e)+", "+he.transform(n)+", "+At(St.transform(s))+")"};function uo(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const Ve={test:Ye("#"),parse:uo,transform:ct.transform},mt={test:Ye("hsl","hue"),parse:qs("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+G.transform(At(e))+", "+G.transform(At(n))+", "+At(St.transform(s))+")"},j={test:t=>ct.test(t)||Ve.test(t)||mt.test(t),parse:t=>ct.test(t)?ct.parse(t):mt.test(t)?mt.parse(t):Ve.parse(t),transform:t=>kt(t)?t:t.hasOwnProperty("red")?ct.transform(t):mt.transform(t)},w=(t,e,n)=>-n*t+n*e+t;function fe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function ho({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let i=0,o=0,r=0;if(!e)i=o=r=n;else{const a=n<.5?n*(1+e):n+e-n*e,c=2*n-a;i=fe(c,a,t+1/3),o=fe(c,a,t),r=fe(c,a,t-1/3)}return{red:Math.round(i*255),green:Math.round(o*255),blue:Math.round(r*255),alpha:s}}const de=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},fo=[Ve,ct,mt],mo=t=>fo.find(e=>e.test(t));function Pn(t){const e=mo(t);let n=e.parse(t);return e===mt&&(n=ho(n)),n}const Zs=(t,e)=>{const n=Pn(t),s=Pn(e),i={...n};return o=>(i.red=de(n.red,s.red,o),i.green=de(n.green,s.green,o),i.blue=de(n.blue,s.blue,o),i.alpha=w(n.alpha,s.alpha,o),ct.transform(i))};function po(t){var e,n;return isNaN(t)&&kt(t)&&(((e=t.match(ie))===null||e===void 0?void 0:e.length)||0)+(((n=t.match(Ss))===null||n===void 0?void 0:n.length)||0)>0}const Qs={regex:ir,countKey:"Vars",token:"${v}",parse:M},Js={regex:Ss,countKey:"Colors",token:"${c}",parse:j.parse},ti={regex:ie,countKey:"Numbers",token:"${n}",parse:ht.parse};function me(t,{regex:e,countKey:n,token:s,parse:i}){const o=t.tokenised.match(e);o&&(t["num"+n]=o.length,t.tokenised=t.tokenised.replace(e,s),t.values.push(...o.map(i)))}function Yt(t){const e=t.toString(),n={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&me(n,Qs),me(n,Js),me(n,ti),n}function ei(t){return Yt(t).values}function ni(t){const{values:e,numColors:n,numVars:s,tokenised:i}=Yt(t),o=e.length;return r=>{let a=i;for(let c=0;c<o;c++)c<s?a=a.replace(Qs.token,r[c]):c<s+n?a=a.replace(Js.token,j.transform(r[c])):a=a.replace(ti.token,At(r[c]));return a}}const go=t=>typeof t=="number"?0:t;function yo(t){const e=ei(t);return ni(t)(e.map(go))}const nt={test:po,parse:ei,createTransformer:ni,getAnimatableNone:yo},si=(t,e)=>n=>`${n>0?e:t}`;function ii(t,e){return typeof t=="number"?n=>w(t,e,n):j.test(t)?Zs(t,e):t.startsWith("var(")?si(t,e):oi(t,e)}const ri=(t,e)=>{const n=[...t],s=n.length,i=t.map((o,r)=>ii(o,e[r]));return o=>{for(let r=0;r<s;r++)n[r]=i[r](o);return n}},vo=(t,e)=>{const n={...t,...e},s={};for(const i in n)t[i]!==void 0&&e[i]!==void 0&&(s[i]=ii(t[i],e[i]));return i=>{for(const o in s)n[o]=s[o](i);return n}},oi=(t,e)=>{const n=nt.createTransformer(e),s=Yt(t),i=Yt(e);return s.numVars===i.numVars&&s.numColors===i.numColors&&s.numNumbers>=i.numNumbers?J(ri(s.values,i.values),n):si(t,e)},Rt=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s},Tn=(t,e)=>n=>w(t,e,n);function xo(t){return typeof t=="number"?Tn:typeof t=="string"?j.test(t)?Zs:oi:Array.isArray(t)?ri:typeof t=="object"?vo:Tn}function Po(t,e,n){const s=[],i=n||xo(t[0]),o=t.length-1;for(let r=0;r<o;r++){let a=i(t[r],t[r+1]);if(e){const c=Array.isArray(e)?e[r]||M:e;a=J(c,a)}s.push(a)}return s}function ai(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const o=t.length;if(Ke(o===e.length),o===1)return()=>e[0];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=Po(e,s,i),a=r.length,c=l=>{let u=0;if(a>1)for(;u<t.length-2&&!(l<t[u+1]);u++);const h=Rt(t[u],t[u+1],l);return r[u](h)};return n?l=>c(et(t[0],t[o-1],l)):c}function To(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Rt(0,e,s);t.push(w(n,1,i))}}function bo(t){const e=[0];return To(e,t.length-1),e}function Vo(t,e){return t.map(n=>n*e)}function So(t,e){return t.map(()=>e||zs).splice(0,t.length-1)}function qt({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=io(s)?s.map(xn):xn(s),o={done:!1,value:e[0]},r=Vo(n&&n.length===e.length?n:bo(e),t),a=ai(r,e,{ease:Array.isArray(i)?i:So(e,i)});return{calculatedDuration:t,next:c=>(o.value=a(c),o.done=c>=t,o)}}function ci(t,e){return e?t*(1e3/e):0}const Ao=5;function li(t,e,n){const s=Math.max(e-Ao,0);return ci(n-t(s),e-s)}const pe=.001,Co=.01,bn=10,wo=.05,Do=1;function Mo({duration:t=800,bounce:e=.25,velocity:n=0,mass:s=1}){let i,o;Yr(t<=tt(bn));let r=1-e;r=et(wo,Do,r),t=et(Co,bn,K(t)),r<1?(i=l=>{const u=l*r,h=u*t,f=u-n,d=Se(l,r),m=Math.exp(-h);return pe-f/d*m},o=l=>{const h=l*r*t,f=h*n+n,d=Math.pow(r,2)*Math.pow(l,2)*t,m=Math.exp(-h),p=Se(Math.pow(l,2),r);return(-i(l)+pe>0?-1:1)*((f-d)*m)/p}):(i=l=>{const u=Math.exp(-l*t),h=(l-n)*t+1;return-pe+u*h},o=l=>{const u=Math.exp(-l*t),h=(n-l)*(t*t);return u*h});const a=5/t,c=Ro(i,o,a);if(t=tt(t),isNaN(c))return{stiffness:100,damping:10,duration:t};{const l=Math.pow(c,2)*s;return{stiffness:l,damping:r*2*Math.sqrt(s*l),duration:t}}}const Lo=12;function Ro(t,e,n){let s=n;for(let i=1;i<Lo;i++)s=s-t(s)/e(s);return s}function Se(t,e){return t*Math.sqrt(1-e*e)}const Fo=["duration","bounce"],Bo=["stiffness","damping","mass"];function Vn(t,e){return e.some(n=>t[n]!==void 0)}function ko(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Vn(t,Bo)&&Vn(t,Fo)){const n=Mo(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}function ui({keyframes:t,restDelta:e,restSpeed:n,...s}){const i=t[0],o=t[t.length-1],r={done:!1,value:i},{stiffness:a,damping:c,mass:l,velocity:u,duration:h,isResolvedFromDuration:f}=ko(s),d=u?-K(u):0,m=c/(2*Math.sqrt(a*l)),p=o-i,x=K(Math.sqrt(a/l)),b=Math.abs(p)<5;n||(n=b?.01:2),e||(e=b?.005:.5);let y;if(m<1){const g=Se(x,m);y=P=>{const T=Math.exp(-m*x*P);return o-T*((d+m*x*p)/g*Math.sin(g*P)+p*Math.cos(g*P))}}else if(m===1)y=g=>o-Math.exp(-x*g)*(p+(d+x*p)*g);else{const g=x*Math.sqrt(m*m-1);y=P=>{const T=Math.exp(-m*x*P),E=Math.min(g*P,300);return o-T*((d+m*x*p)*Math.sinh(E)+g*p*Math.cosh(E))/g}}return{calculatedDuration:f&&h||null,next:g=>{const P=y(g);if(f)r.done=g>=h;else{let T=d;g!==0&&(m<1?T=li(y,g,P):T=0);const E=Math.abs(T)<=n,A=Math.abs(o-P)<=e;r.done=E&&A}return r.value=r.done?o:P,r}}}function Sn({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:c,restDelta:l=.5,restSpeed:u}){const h=t[0],f={done:!1,value:h},d=V=>a!==void 0&&V<a||c!==void 0&&V>c,m=V=>a===void 0?c:c===void 0||Math.abs(a-V)<Math.abs(c-V)?a:c;let p=n*e;const x=h+p,b=r===void 0?x:r(x);b!==x&&(p=b-h);const y=V=>-p*Math.exp(-V/s),g=V=>b+y(V),P=V=>{const D=y(V),W=g(V);f.done=Math.abs(D)<=l,f.value=f.done?b:W};let T,E;const A=V=>{d(f.value)&&(T=V,E=ui({keyframes:[f.value,m(f.value)],velocity:li(g,V,f.value),damping:i,stiffness:o,restDelta:l,restSpeed:u}))};return A(0),{calculatedDuration:null,next:V=>{let D=!1;return!E&&T===void 0&&(D=!0,P(V),A(V)),T!==void 0&&V>T?E.next(V-T):(!D&&P(V),f)}}}const Eo=t=>{const e=({timestamp:n})=>t(n);return{start:()=>S.update(e,!0),stop:()=>_(e),now:()=>B.isProcessing?B.timestamp:performance.now()}},An=2e4;function Cn(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<An;)e+=n,s=t.next(e);return e>=An?1/0:e}const jo={decay:Sn,inertia:Sn,tween:qt,keyframes:qt,spring:ui};function Zt({autoplay:t=!0,delay:e=0,driver:n=Eo,keyframes:s,type:i="keyframes",repeat:o=0,repeatDelay:r=0,repeatType:a="loop",onPlay:c,onStop:l,onComplete:u,onUpdate:h,...f}){let d=1,m=!1,p,x;const b=()=>{x=new Promise(C=>{p=C})};b();let y;const g=jo[i]||qt;let P;g!==qt&&typeof s[0]!="number"&&(P=ai([0,100],s,{clamp:!1}),s=[0,100]);const T=g({...f,keyframes:s});let E;a==="mirror"&&(E=g({...f,keyframes:[...s].reverse(),velocity:-(f.velocity||0)}));let A="idle",V=null,D=null,W=null;T.calculatedDuration===null&&o&&(T.calculatedDuration=Cn(T));const{calculatedDuration:$}=T;let X=1/0,Y=1/0;$!==null&&(X=$+r,Y=X*(o+1)-r);let F=0;const R=C=>{if(D===null)return;d>0&&(D=Math.min(D,C)),d<0&&(D=Math.min(C-Y/d,D)),V!==null?F=V:F=Math.round(C-D)*d;const xt=F-e*(d>=0?1:-1),sn=d>=0?xt<0:xt>Y;F=Math.max(xt,0),A==="finished"&&V===null&&(F=Y);let rn=F,on=T;if(o){const ae=F/X;let Ot=Math.floor(ae),it=ae%1;!it&&ae>=1&&(it=1),it===1&&Ot--,Ot=Math.min(Ot,o+1);const cn=!!(Ot%2);cn&&(a==="reverse"?(it=1-it,r&&(it-=r/X)):a==="mirror"&&(on=E));let ln=et(0,1,it);F>Y&&(ln=a==="reverse"&&cn?1:0),rn=ln*X}const Pt=sn?{done:!1,value:s[0]}:on.next(rn);P&&(Pt.value=P(Pt.value));let{done:an}=Pt;!sn&&$!==null&&(an=d>=0?F>=Y:F<=0);const Ii=V===null&&(A==="finished"||A==="running"&&an);return h&&h(Pt.value),Ii&&Oi(),Pt},q=()=>{y&&y.stop(),y=void 0},ft=()=>{A="idle",q(),p(),b(),D=W=null},Oi=()=>{A="finished",u&&u(),q(),p()},en=()=>{if(m)return;y||(y=n(R));const C=y.now();c&&c(),V!==null?D=C-V:(!D||A==="finished")&&(D=C),A==="finished"&&b(),W=D,V=null,A="running",y.start()};t&&en();const nn={then(C,xt){return x.then(C,xt)},get time(){return K(F)},set time(C){C=tt(C),F=C,V!==null||!y||d===0?V=C:D=y.now()-C/d},get duration(){const C=T.calculatedDuration===null?Cn(T):T.calculatedDuration;return K(C)},get speed(){return d},set speed(C){C===d||!y||(d=C,nn.time=K(F))},get state(){return A},play:en,pause:()=>{A="paused",V=F},stop:()=>{m=!0,A!=="idle"&&(A="idle",l&&l(),ft())},cancel:()=>{W!==null&&R(W),ft()},complete:()=>{A="finished"},sample:C=>(D=0,R(C))};return nn}function Oo(t){let e;return()=>(e===void 0&&(e=t()),e)}const Io=Oo(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Uo=new Set(["opacity","clipPath","filter","transform","backgroundColor"]),Nt=10,No=2e4,Go=(t,e)=>e.type==="spring"||t==="backgroundColor"||!Gs(e.ease);function Wo(t,e,{onUpdate:n,onComplete:s,...i}){if(!(Io()&&Uo.has(e)&&!i.repeatDelay&&i.repeatType!=="mirror"&&i.damping!==0&&i.type!=="inertia"))return!1;let r=!1,a,c;const l=()=>{c=new Promise(y=>{a=y})};l();let{keyframes:u,duration:h=300,ease:f,times:d}=i;if(Go(e,i)){const y=Zt({...i,repeat:0,delay:0});let g={done:!1,value:u[0]};const P=[];let T=0;for(;!g.done&&T<No;)g=y.sample(T),P.push(g.value),T+=Nt;d=void 0,u=P,h=T-Nt,f="linear"}const m=Zr(t.owner.current,e,u,{...i,duration:h,ease:f,times:d});i.syncStart&&(m.startTime=B.isProcessing?B.timestamp:document.timeline?document.timeline.currentTime:performance.now());const p=()=>m.cancel(),x=()=>{S.update(p),a(),l()};return m.onfinish=()=>{t.set(Qr(u,i)),s&&s(),x()},{then(y,g){return c.then(y,g)},attachTimeline(y){return m.timeline=y,m.onfinish=null,M},get time(){return K(m.currentTime||0)},set time(y){m.currentTime=tt(y)},get speed(){return m.playbackRate},set speed(y){m.playbackRate=y},get duration(){return K(h)},play:()=>{r||(m.play(),_(p))},pause:()=>m.pause(),stop:()=>{if(r=!0,m.playState==="idle")return;const{currentTime:y}=m;if(y){const g=Zt({...i,autoplay:!1});t.setWithVelocity(g.sample(y-Nt).value,g.sample(y).value,Nt)}x()},complete:()=>m.finish(),cancel:x}}function $o({keyframes:t,delay:e,onUpdate:n,onComplete:s}){const i=()=>(n&&n(t[t.length-1]),s&&s(),{time:0,speed:1,duration:0,play:M,pause:M,stop:M,then:o=>(o(),Promise.resolve()),cancel:M,complete:M});return e?Zt({keyframes:[0,1],duration:0,delay:e,onComplete:i}):i()}const Ho={type:"spring",stiffness:500,damping:25,restSpeed:10},zo=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),Ko={type:"keyframes",duration:.8},_o={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Xo=(t,{keyframes:e})=>e.length>2?Ko:ut.has(t)?t.startsWith("scale")?zo(e[1]):Ho:_o,Ae=(t,e)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(nt.test(e)||e==="0")&&!e.startsWith("url(")),Yo=new Set(["brightness","contrast","saturate","opacity"]);function qo(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(ie)||[];if(!s)return t;const i=n.replace(s,"");let o=Yo.has(e)?1:0;return s!==n&&(o*=100),e+"("+o+i+")"}const Zo=/([a-z-]*)\(.*?\)/g,Ce={...nt,getAnimatableNone:t=>{const e=t.match(Zo);return e?e.map(qo).join(" "):t}},Qo={...As,color:j,backgroundColor:j,outlineColor:j,fill:j,stroke:j,borderColor:j,borderTopColor:j,borderRightColor:j,borderBottomColor:j,borderLeftColor:j,filter:Ce,WebkitFilter:Ce},qe=t=>Qo[t];function hi(t,e){let n=qe(t);return n!==Ce&&(n=nt),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const fi=t=>/^0[^.\s]+$/.test(t);function Jo(t){if(typeof t=="number")return t===0;if(t!==null)return t==="none"||t==="0"||fi(t)}function ta(t,e,n,s){const i=Ae(e,n);let o;Array.isArray(n)?o=[...n]:o=[null,n];const r=s.from!==void 0?s.from:t.get();let a;const c=[];for(let l=0;l<o.length;l++)o[l]===null&&(o[l]=l===0?r:o[l-1]),Jo(o[l])&&c.push(l),typeof o[l]=="string"&&o[l]!=="none"&&o[l]!=="0"&&(a=o[l]);if(i&&c.length&&a)for(let l=0;l<c.length;l++){const u=c[l];o[u]=hi(e,a)}return o}function ea({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}function di(t,e){return t[e]||t.default||t}const Ze=(t,e,n,s={})=>i=>{const o=di(s,t)||{},r=o.delay||s.delay||0;let{elapsed:a=0}=s;a=a-tt(r);const c=ta(e,t,n,o),l=c[0],u=c[c.length-1],h=Ae(t,l),f=Ae(t,u);let d={keyframes:c,velocity:e.getVelocity(),ease:"easeOut",...o,delay:-a,onUpdate:m=>{e.set(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(ea(o)||(d={...d,...Xo(t,d)}),d.duration&&(d.duration=tt(d.duration)),d.repeatDelay&&(d.repeatDelay=tt(d.repeatDelay)),!h||!f||qr.current||o.type===!1)return $o(d);if(e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const m=Wo(e,t,d);if(m)return m}return Zt(d)};function Qt(t){return!!(O(t)&&t.add)}const mi=t=>/^\-?\d*\.?\d+$/.test(t);function Qe(t,e){t.indexOf(e)===-1&&t.push(e)}function Je(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class tn{constructor(){this.subscriptions=[]}add(e){return Qe(this.subscriptions,e),()=>Je(this.subscriptions,e)}notify(e,n,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](e,n,s);else for(let o=0;o<i;o++){const r=this.subscriptions[o];r&&r(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const na=t=>!isNaN(parseFloat(t));class sa{constructor(e,n={}){this.version="10.16.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(s,i=!0)=>{this.prev=this.current,this.current=s;const{delta:o,timestamp:r}=B;this.lastUpdated!==r&&(this.timeDelta=o,this.lastUpdated=r,S.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>S.postRender(this.velocityCheck),this.velocityCheck=({timestamp:s})=>{s!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=e,this.canTrackVelocity=na(this.current),this.owner=n.owner}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new tn);const s=this.events[e].add(n);return e==="change"?()=>{s(),S.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=e,this.timeDelta=s}jump(e){this.updateAndNotify(e),this.prev=e,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ci(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function yt(t,e){return new sa(t,e)}const pi=t=>e=>e.test(t),ia={test:t=>t==="auto",parse:t=>t},gi=[ht,v,G,Z,cr,ar,ia],Tt=t=>gi.find(pi(t)),ra=[...gi,j,nt],oa=t=>ra.find(pi(t));function aa(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,yt(n))}function ca(t,e){const n=oe(t,e);let{transitionEnd:s={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...s};for(const r in o){const a=Vr(o[r]);aa(t,r,a)}}function la(t,e,n){var s,i;const o=Object.keys(e).filter(a=>!t.hasValue(a)),r=o.length;if(r)for(let a=0;a<r;a++){const c=o[a],l=e[c];let u=null;Array.isArray(l)&&(u=l[0]),u===null&&(u=(i=(s=n[c])!==null&&s!==void 0?s:t.readValue(c))!==null&&i!==void 0?i:e[c]),u!=null&&(typeof u=="string"&&(mi(u)||fi(u))?u=parseFloat(u):!oa(u)&&nt.test(l)&&(u=hi(c,l)),t.addValue(c,yt(u,{owner:t})),n[c]===void 0&&(n[c]=u),u!==null&&t.setBaseTarget(c,u))}}function ua(t,e){return e?(e[t]||e.default||e).from:void 0}function ha(t,e,n){const s={};for(const i in t){const o=ua(i,e);if(o!==void 0)s[i]=o;else{const r=n.getValue(i);r&&(s[i]=r.get())}}return s}function fa({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function yi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const c=t.getValue("willChange");s&&(o=s);const l=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const h in a){const f=t.getValue(h),d=a[h];if(!f||d===void 0||u&&fa(u,h))continue;const m={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!f.hasAnimated){const x=t.getProps()[Xr];x&&(m.elapsed=window.HandoffAppearAnimations(x,h,f,S),m.syncStart=!0)}f.start(Ze(h,f,d,t.shouldReduceMotion&&ut.has(h)?{type:!1}:m));const p=f.animation;Qt(c)&&(c.add(h),p.then(()=>c.remove(h))),l.push(p)}return r&&Promise.all(l).then(()=>{r&&ca(t,r)}),l}function we(t,e,n={}){const s=oe(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>Promise.all(yi(t,s,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=i;return da(t,e,l+c,u,h,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[c,l]=a==="beforeChildren"?[o,r]:[r,o];return c().then(()=>l())}else return Promise.all([o(),r(n.delay)])}function da(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,c=i===1?(l=0)=>l*s:(l=0)=>a-l*s;return Array.from(t.variantChildren).sort(ma).forEach((l,u)=>{l.notify("AnimationStart",e),r.push(we(l,e,{...o,delay:n+c(u)}).then(()=>l.notify("AnimationComplete",e)))}),Promise.all(r)}function ma(t,e){return t.sortNodePosition(e)}function pa(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const i=e.map(o=>we(t,o,n));s=Promise.all(i)}else if(typeof e=="string")s=we(t,e,n);else{const i=typeof e=="function"?oe(t,e,n.custom):e;s=Promise.all(yi(t,i,n))}return s.then(()=>t.notify("AnimationComplete",e))}const ga=[...je].reverse(),ya=je.length;function va(t){return e=>Promise.all(e.map(({animation:n,options:s})=>pa(t,n,s)))}function xa(t){let e=va(t);const n=Ta();let s=!0;const i=(c,l)=>{const u=oe(t,l);if(u){const{transition:h,transitionEnd:f,...d}=u;c={...c,...d,...f}}return c};function o(c){e=c(t)}function r(c,l){const u=t.getProps(),h=t.getVariantContext(!0)||{},f=[],d=new Set;let m={},p=1/0;for(let b=0;b<ya;b++){const y=ga[b],g=n[y],P=u[y]!==void 0?u[y]:h[y],T=Mt(P),E=y===l?g.isActive:null;E===!1&&(p=b);let A=P===h[y]&&P!==u[y]&&T;if(A&&s&&t.manuallyAnimateOnMount&&(A=!1),g.protectedKeys={...m},!g.isActive&&E===null||!P&&!g.prevProp||ne(P)||typeof P=="boolean")continue;const V=Pa(g.prevProp,P);let D=V||y===l&&g.isActive&&!A&&T||b>p&&T;const W=Array.isArray(P)?P:[P];let $=W.reduce(i,{});E===!1&&($={});const{prevResolvedValues:X={}}=g,Y={...X,...$},F=R=>{D=!0,d.delete(R),g.needsAnimating[R]=!0};for(const R in Y){const q=$[R],ft=X[R];m.hasOwnProperty(R)||(q!==ft?Xt(q)&&Xt(ft)?!Us(q,ft)||V?F(R):g.protectedKeys[R]=!0:q!==void 0?F(R):d.add(R):q!==void 0&&d.has(R)?F(R):g.protectedKeys[R]=!0)}g.prevProp=P,g.prevResolvedValues=$,g.isActive&&(m={...m,...$}),s&&t.blockInitialAnimation&&(D=!1),D&&!A&&f.push(...W.map(R=>({animation:R,options:{type:y,...c}})))}if(d.size){const b={};d.forEach(y=>{const g=t.getBaseTarget(y);g!==void 0&&(b[y]=g)}),f.push({animation:b})}let x=!!f.length;return s&&u.initial===!1&&!t.manuallyAnimateOnMount&&(x=!1),s=!1,x?e(f):Promise.resolve()}function a(c,l,u){var h;if(n[c].isActive===l)return Promise.resolve();(h=t.variantChildren)===null||h===void 0||h.forEach(d=>{var m;return(m=d.animationState)===null||m===void 0?void 0:m.setActive(c,l)}),n[c].isActive=l;const f=r(u,c);for(const d in n)n[d].protectedKeys={};return f}return{animateChanges:r,setActive:a,setAnimateFunction:o,getState:()=>n}}function Pa(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!Us(e,t):!1}function rt(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ta(){return{animate:rt(!0),whileInView:rt(),whileHover:rt(),whileTap:rt(),whileDrag:rt(),whileFocus:rt(),exit:rt()}}class ba extends st{constructor(e){super(e),e.animationState||(e.animationState=xa(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();this.unmount(),ne(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){}}let Va=0;class Sa extends st{constructor(){super(...arguments),this.id=Va++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n,custom:s}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const o=this.node.animationState.setActive("exit",!e,{custom:s??this.node.getProps().custom});n&&!e&&o.then(()=>n(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const Aa={animation:{Feature:ba},exit:{Feature:Sa}},wn=(t,e)=>Math.abs(t-e);function Ca(t,e){const n=wn(t.x,e.x),s=wn(t.y,e.y);return Math.sqrt(n**2+s**2)}class vi{constructor(e,n,{transformPagePoint:s}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const l=ye(this.lastMoveEventInfo,this.history),u=this.startEvent!==null,h=Ca(l.offset,{x:0,y:0})>=3;if(!u&&!h)return;const{point:f}=l,{timestamp:d}=B;this.history.push({...f,timestamp:d});const{onStart:m,onMove:p}=this.handlers;u||(m&&m(this.lastMoveEvent,l),this.startEvent=this.lastMoveEvent),p&&p(this.lastMoveEvent,l)},this.handlePointerMove=(l,u)=>{this.lastMoveEvent=l,this.lastMoveEventInfo=ge(u,this.transformPagePoint),S.update(this.updatePoint,!0)},this.handlePointerUp=(l,u)=>{if(this.end(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const{onEnd:h,onSessionEnd:f}=this.handlers,d=ye(l.type==="pointercancel"?this.lastMoveEventInfo:ge(u,this.transformPagePoint),this.history);this.startEvent&&h&&h(l,d),f&&f(l,d)},!ks(e))return;this.handlers=n,this.transformPagePoint=s;const i=re(e),o=ge(i,this.transformPagePoint),{point:r}=o,{timestamp:a}=B;this.history=[{...r,timestamp:a}];const{onSessionStart:c}=n;c&&c(e,ye(o,this.history)),this.removeListeners=J(z(window,"pointermove",this.handlePointerMove),z(window,"pointerup",this.handlePointerUp),z(window,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),_(this.updatePoint)}}function ge(t,e){return e?{point:e(t.point)}:t}function Dn(t,e){return{x:t.x-e.x,y:t.y-e.y}}function ye({point:t},e){return{point:t,delta:Dn(t,xi(e)),offset:Dn(t,wa(e)),velocity:Da(e,.1)}}function wa(t){return t[0]}function xi(t){return t[t.length-1]}function Da(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=xi(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>tt(e)));)n--;if(!s)return{x:0,y:0};const o=K(i.timestamp-s.timestamp);if(o===0)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function I(t){return t.max-t.min}function De(t,e=0,n=.01){return Math.abs(t-e)<=n}function Mn(t,e,n,s=.5){t.origin=s,t.originPoint=w(e.min,e.max,t.origin),t.scale=I(n)/I(e),(De(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=w(n.min,n.max,t.origin)-t.originPoint,(De(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Ct(t,e,n,s){Mn(t.x,e.x,n.x,s?s.originX:void 0),Mn(t.y,e.y,n.y,s?s.originY:void 0)}function Ln(t,e,n){t.min=n.min+e.min,t.max=t.min+I(e)}function Ma(t,e,n){Ln(t.x,e.x,n.x),Ln(t.y,e.y,n.y)}function Rn(t,e,n){t.min=e.min-n.min,t.max=t.min+I(e)}function wt(t,e,n){Rn(t.x,e.x,n.x),Rn(t.y,e.y,n.y)}function La(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?w(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?w(n,t,s.max):Math.min(t,n)),t}function Fn(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function Ra(t,{top:e,left:n,bottom:s,right:i}){return{x:Fn(t.x,n,i),y:Fn(t.y,e,s)}}function Bn(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function Fa(t,e){return{x:Bn(t.x,e.x),y:Bn(t.y,e.y)}}function Ba(t,e){let n=.5;const s=I(t),i=I(e);return i>s?n=Rt(e.min,e.max-s,t.min):s>i&&(n=Rt(t.min,t.max-i,e.min)),et(0,1,n)}function ka(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Me=.35;function Ea(t=Me){return t===!1?t=0:t===!0&&(t=Me),{x:kn(t,"left","right"),y:kn(t,"top","bottom")}}function kn(t,e,n){return{min:En(t,e),max:En(t,n)}}function En(t,e){return typeof t=="number"?t:t[e]||0}const jn=()=>({translate:0,scale:1,origin:0,originPoint:0}),pt=()=>({x:jn(),y:jn()}),On=()=>({min:0,max:0}),L=()=>({x:On(),y:On()});function N(t){return[t("x"),t("y")]}function Pi({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function ja({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function Oa(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}function ve(t){return t===void 0||t===1}function Le({scale:t,scaleX:e,scaleY:n}){return!ve(t)||!ve(e)||!ve(n)}function ot(t){return Le(t)||Ti(t)||t.z||t.rotate||t.rotateX||t.rotateY}function Ti(t){return In(t.x)||In(t.y)}function In(t){return t&&t!=="0%"}function Jt(t,e,n){const s=t-n,i=e*s;return n+i}function Un(t,e,n,s,i){return i!==void 0&&(t=Jt(t,i,s)),Jt(t,n,s)+e}function Re(t,e=0,n=1,s,i){t.min=Un(t.min,e,n,s,i),t.max=Un(t.max,e,n,s,i)}function bi(t,{x:e,y:n}){Re(t.x,e.translate,e.scale,e.originPoint),Re(t.y,n.translate,n.scale,n.originPoint)}function Ia(t,e,n,s=!1){const i=n.length;if(!i)return;e.x=e.y=1;let o,r;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const c=o.instance;c&&c.style&&c.style.display==="contents"||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&gt(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,bi(t,r)),s&&ot(o.latestValues)&&gt(t,o.latestValues))}e.x=Nn(e.x),e.y=Nn(e.y)}function Nn(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Q(t,e){t.min=t.min+e,t.max=t.max+e}function Gn(t,e,[n,s,i]){const o=e[i]!==void 0?e[i]:.5,r=w(t.min,t.max,o);Re(t,e[n],e[s],r,e.scale)}const Ua=["x","scaleX","originX"],Na=["y","scaleY","originY"];function gt(t,e){Gn(t.x,e,Ua),Gn(t.y,e,Na)}function Vi(t,e){return Pi(Oa(t.getBoundingClientRect(),e))}function Ga(t,e,n){const s=Vi(t,n),{scroll:i}=e;return i&&(Q(s.x,i.offset.x),Q(s.y,i.offset.y)),s}const Wa=new WeakMap;class $a{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=L(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=c=>{this.stopAnimation(),n&&this.snapToCursor(re(c,"page").point)},o=(c,l)=>{const{drag:u,dragPropagation:h,onDragStart:f}=this.getProps();if(u&&!h&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=js(u),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),N(m=>{let p=this.getAxisMotionValue(m).get()||0;if(G.test(p)){const{projection:x}=this.visualElement;if(x&&x.layout){const b=x.layout.layoutBox[m];b&&(p=I(b)*(parseFloat(p)/100))}}this.originPoint[m]=p}),f&&S.update(()=>f(c,l),!1,!0);const{animationState:d}=this.visualElement;d&&d.setActive("whileDrag",!0)},r=(c,l)=>{const{dragPropagation:u,dragDirectionLock:h,onDirectionLock:f,onDrag:d}=this.getProps();if(!u&&!this.openGlobalLock)return;const{offset:m}=l;if(h&&this.currentDirection===null){this.currentDirection=Ha(m),this.currentDirection!==null&&f&&f(this.currentDirection);return}this.updateAxis("x",l.point,m),this.updateAxis("y",l.point,m),this.visualElement.render(),d&&d(c,l)},a=(c,l)=>this.stop(c,l);this.panSession=new vi(e,{onSessionStart:i,onStart:o,onMove:r,onSessionEnd:a},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:i}=n;this.startAnimation(i);const{onDragEnd:o}=this.getProps();o&&S.update(()=>o(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:i}=this.getProps();if(!s||!Gt(e,i,this.currentDirection))return;const o=this.getAxisMotionValue(e);let r=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(r=La(r,this.constraints[e],this.elastic[e])),o.set(r)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),{layout:s}=this.visualElement.projection||{},i=this.constraints;e&&dt(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=Ra(s.layoutBox,e):this.constraints=!1,this.elastic=Ea(n),i!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&N(o=>{this.getAxisMotionValue(o)&&(this.constraints[o]=ka(s.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!dt(e))return!1;const s=e.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const o=Ga(s,i.root,this.visualElement.getTransformPagePoint());let r=Fa(i.layout.layoutBox,o);if(n){const a=n(ja(r));this.hasMutatedConstraints=!!a,a&&(r=Pi(a))}return r}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:i,dragTransition:o,dragSnapToOrigin:r,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=N(u=>{if(!Gt(u,n,this.currentDirection))return;let h=c&&c[u]||{};r&&(h={min:0,max:0});const f=i?200:1e6,d=i?40:1e7,m={type:"inertia",velocity:s?e[u]:0,bounceStiffness:f,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(u,m)});return Promise.all(l).then(a)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return s.start(Ze(e,s,0,n))}stopAnimation(){N(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const n="_drag"+e.toUpperCase(),s=this.visualElement.getProps(),i=s[n];return i||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){N(n=>{const{drag:s}=this.getProps();if(!Gt(n,s,this.currentDirection))return;const{projection:i}=this.visualElement,o=this.getAxisMotionValue(n);if(i&&i.layout){const{min:r,max:a}=i.layout.layoutBox[n];o.set(e[n]-w(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!dt(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};N(r=>{const a=this.getAxisMotionValue(r);if(a){const c=a.get();i[r]=Ba({min:c,max:c},this.constraints[r])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),N(r=>{if(!Gt(r,e,null))return;const a=this.getAxisMotionValue(r),{min:c,max:l}=this.constraints[r];a.set(w(c,l,i[r]))})}addListeners(){if(!this.visualElement.current)return;Wa.set(this.visualElement,this);const e=this.visualElement.current,n=z(e,"pointerdown",c=>{const{drag:l,dragListener:u=!0}=this.getProps();l&&u&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();dt(c)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,o=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),s();const r=H(window,"resize",()=>this.scalePositionWithinConstraints()),a=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(N(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=c[u].translate,h.set(h.get()+c[u].translate))}),this.visualElement.render())});return()=>{r(),n(),o(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:i=!1,dragConstraints:o=!1,dragElastic:r=Me,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:i,dragConstraints:o,dragElastic:r,dragMomentum:a}}}function Gt(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Ha(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class za extends st{constructor(e){super(e),this.removeGroupControls=M,this.removeListeners=M,this.controls=new $a(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||M}unmount(){this.removeGroupControls(),this.removeListeners()}}const Wn=t=>(e,n)=>{t&&S.update(()=>t(e,n))};class Ka extends st{constructor(){super(...arguments),this.removePointerDownListener=M}onPointerDown(e){this.session=new vi(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:i}=this.node.getProps();return{onSessionStart:Wn(e),onStart:Wn(n),onMove:s,onEnd:(o,r)=>{delete this.session,i&&S.update(()=>i(o,r))}}}mount(){this.removePointerDownListener=z(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}function _a(){const t=k(Ee);if(t===null)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=Wi();return ke(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}const $t={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function $n(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const bt={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(v.test(t))t=parseFloat(t);else return t;const n=$n(t,e.target.x),s=$n(t,e.target.y);return`${n}% ${s}%`}},Xa={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=nt.parse(t);if(i.length>5)return s;const o=nt.createTransformer(t),r=typeof i[0]!="number"?1:0,a=n.x.scale*e.x,c=n.y.scale*e.y;i[0+r]/=a,i[1+r]/=c;const l=w(a,c,.5);return typeof i[2+r]=="number"&&(i[2+r]/=l),typeof i[3+r]=="number"&&(i[3+r]/=l),o(i)}};class Ya extends ps.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:i}=this.props,{projection:o}=e;tr(qa),o&&(n.group&&n.group.add(o),s&&s.register&&i&&s.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),$t.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:i,isPresent:o}=this.props,r=s.projection;return r&&(r.isPresent=o,i||e.layoutDependency!==n||n===void 0?r.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?r.promote():r.relegate()||S.postRender(()=>{const a=r.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),queueMicrotask(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:i}=e;i&&(i.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(i),s&&s.deregister&&s.deregister(i))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Si(t){const[e,n]=_a(),s=k(zt);return ps.createElement(Ya,{...t,layoutGroup:s,switchLayoutGroup:k(Ps),isPresent:e,safeToRemove:n})}const qa={borderRadius:{...bt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:bt,borderTopRightRadius:bt,borderBottomLeftRadius:bt,borderBottomRightRadius:bt,boxShadow:Xa},Ai=["TopLeft","TopRight","BottomLeft","BottomRight"],Za=Ai.length,Hn=t=>typeof t=="string"?parseFloat(t):t,zn=t=>typeof t=="number"||v.test(t);function Qa(t,e,n,s,i,o){i?(t.opacity=w(0,n.opacity!==void 0?n.opacity:1,Ja(s)),t.opacityExit=w(e.opacity!==void 0?e.opacity:1,0,tc(s))):o&&(t.opacity=w(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let r=0;r<Za;r++){const a=`border${Ai[r]}Radius`;let c=Kn(e,a),l=Kn(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||zn(c)===zn(l)?(t[a]=Math.max(w(Hn(c),Hn(l),s),0),(G.test(l)||G.test(c))&&(t[a]+="%")):t[a]=l}(e.rotate||n.rotate)&&(t.rotate=w(e.rotate||0,n.rotate||0,s))}function Kn(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Ja=Ci(0,.5,_e),tc=Ci(.5,.95,M);function Ci(t,e,n){return s=>s<t?0:s>e?1:n(Rt(t,e,s))}function _n(t,e){t.min=e.min,t.max=e.max}function U(t,e){_n(t.x,e.x),_n(t.y,e.y)}function Xn(t,e,n,s,i){return t-=e,t=Jt(t,1/n,s),i!==void 0&&(t=Jt(t,1/i,s)),t}function ec(t,e=0,n=1,s=.5,i,o=t,r=t){if(G.test(e)&&(e=parseFloat(e),e=w(r.min,r.max,e/100)-r.min),typeof e!="number")return;let a=w(o.min,o.max,s);t===o&&(a-=e),t.min=Xn(t.min,e,n,a,i),t.max=Xn(t.max,e,n,a,i)}function Yn(t,e,[n,s,i],o,r){ec(t,e[n],e[s],e[i],e.scale,o,r)}const nc=["x","scaleX","originX"],sc=["y","scaleY","originY"];function qn(t,e,n,s){Yn(t.x,e,nc,n?n.x:void 0,s?s.x:void 0),Yn(t.y,e,sc,n?n.y:void 0,s?s.y:void 0)}function Zn(t){return t.translate===0&&t.scale===1}function wi(t){return Zn(t.x)&&Zn(t.y)}function ic(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Di(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function Qn(t){return I(t.x)/I(t.y)}class rc{constructor(){this.members=[]}add(e){Qe(this.members,e),e.scheduleRender()}remove(e){if(Je(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(i=>e===i);if(n===0)return!1;let s;for(let i=n;i>=0;i--){const o=this.members[i];if(o.isPresent!==!1){s=o;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:i}=e.options;i===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Jn(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(s=`translate3d(${i}px, ${o}px, 0) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:c,rotateX:l,rotateY:u}=n;c&&(s+=`rotate(${c}deg) `),l&&(s+=`rotateX(${l}deg) `),u&&(s+=`rotateY(${u}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return(r!==1||a!==1)&&(s+=`scale(${r}, ${a})`),s||"none"}const oc=(t,e)=>t.depth-e.depth;class ac{constructor(){this.children=[],this.isDirty=!1}add(e){Qe(this.children,e),this.isDirty=!0}remove(e){Je(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(oc),this.isDirty=!1,this.children.forEach(e)}}function cc(t,e){const n=performance.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(_(s),t(o-e))};return S.read(s,!0),()=>_(s)}function lc(t){window.MotionDebug&&window.MotionDebug.record(t)}function uc(t){return t instanceof SVGElement&&t.tagName!=="svg"}function hc(t,e,n){const s=O(t)?t:yt(t);return s.start(Ze("",s,e,n)),s.animation}const ts=["","X","Y","Z"],es=1e3;let fc=0;const at={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function Mi({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(r={},a=e==null?void 0:e()){this.id=fc++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{at.totalNodes=at.resolvedTargetDeltas=at.recalculatedProjection=0,this.nodes.forEach(pc),this.nodes.forEach(Pc),this.nodes.forEach(Tc),this.nodes.forEach(gc),lc(at)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new ac)}addEventListener(r,a){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new tn),this.eventHandlers.get(r).add(a)}notifyListeners(r,...a){const c=this.eventHandlers.get(r);c&&c.notify(...a)}hasListeners(r){return this.eventHandlers.has(r)}mount(r,a=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=uc(r),this.instance=r;const{layoutId:c,layout:l,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),a&&(l||c)&&(this.isLayoutDirty=!0),t){let h;const f=()=>this.root.updateBlockedByResize=!1;t(r,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=cc(f,250),$t.hasAnimatedSinceResize&&($t.hasAnimatedSinceResize=!1,this.nodes.forEach(ss))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||l)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:f,hasRelativeTargetChanged:d,layout:m})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||u.getDefaultTransition()||Cc,{onLayoutAnimationStart:x,onLayoutAnimationComplete:b}=u.getProps(),y=!this.targetLayout||!Di(this.targetLayout,m)||d,g=!f&&d;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||g||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,g);const P={...di(p,"layout"),onPlay:x,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(P.delay=0,P.type=!1),this.startAnimation(P)}else f||ss(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=m})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,_(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(bc),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(ns);return}this.isUpdating||this.nodes.forEach(vc),this.isUpdating=!1,this.nodes.forEach(xc),this.nodes.forEach(dc),this.nodes.forEach(mc),this.clearAllSnapshots();const a=performance.now();B.delta=et(0,1e3/60,a-B.timestamp),B.timestamp=a,B.isProcessing=!0,ce.update.process(B),ce.preRender.process(B),ce.render.process(B),B.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask(()=>this.update()))}clearAllSnapshots(){this.nodes.forEach(yc),this.sharedNodes.forEach(Vc)}scheduleUpdateProjection(){S.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){S.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=L(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let a=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(a=!1),a&&(this.scroll={animationId:this.root.animationId,phase:r,isRoot:s(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const r=this.isLayoutDirty||this.shouldResetTransform,a=this.projectionDelta&&!wi(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;r&&(a||ot(this.latestValues)||u)&&(i(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return r&&(c=this.removeTransform(c)),wc(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return L();const a=r.measureViewportBox(),{scroll:c}=this.root;return c&&(Q(a.x,c.offset.x),Q(a.y,c.offset.y)),a}removeElementScroll(r){const a=L();U(a,r);for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:h}=l;if(l!==this.root&&u&&h.layoutScroll){if(u.isRoot){U(a,r);const{scroll:f}=this.root;f&&(Q(a.x,-f.offset.x),Q(a.y,-f.offset.y))}Q(a.x,u.offset.x),Q(a.y,u.offset.y)}}return a}applyTransform(r,a=!1){const c=L();U(c,r);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&gt(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),ot(u.latestValues)&&gt(c,u.latestValues)}return ot(this.latestValues)&&gt(c,this.latestValues),c}removeTransform(r){const a=L();U(a,r);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!ot(l.latestValues))continue;Le(l.latestValues)&&l.updateSnapshot();const u=L(),h=l.measurePageBox();U(u,h),qn(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return ot(this.latestValues)&&qn(a,this.latestValues),a}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==B.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){var a;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const l=!!this.resumingFrom||this!==c;if(!(r||l&&this.isSharedProjectionDirty||this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty||this.attemptToResolveRelativeTarget))return;const{layout:h,layoutId:f}=this.options;if(!(!this.layout||!(h||f))){if(this.resolvedRelativeTargetAt=B.timestamp,!this.targetDelta&&!this.relativeTarget){const d=this.getClosestProjectingParent();d&&d.layout&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=L(),this.relativeTargetOrigin=L(),wt(this.relativeTargetOrigin,this.layout.layoutBox,d.layout.layoutBox),U(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=L(),this.targetWithTransforms=L()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Ma(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):U(this.target,this.layout.layoutBox),bi(this.target,this.targetDelta)):U(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const d=this.getClosestProjectingParent();d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?(this.relativeParent=d,this.forceRelativeParentToResolveTarget(),this.relativeTarget=L(),this.relativeTargetOrigin=L(),wt(this.relativeTargetOrigin,this.target,d.target),U(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}at.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||Le(this.parent.latestValues)||Ti(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var r;const a=this.getLead(),c=!!this.resumingFrom||this!==a;let l=!0;if((this.isProjectionDirty||!((r=this.parent)===null||r===void 0)&&r.isProjectionDirty)&&(l=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(l=!1),this.resolvedRelativeTargetAt===B.timestamp&&(l=!1),l)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;U(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,d=this.treeScale.y;Ia(this.layoutCorrected,this.treeScale,this.path,c),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox);const{target:m}=a;if(!m){this.projectionTransform&&(this.projectionDelta=pt(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=pt(),this.projectionDeltaWithTransform=pt());const p=this.projectionTransform;Ct(this.projectionDelta,this.layoutCorrected,m,this.latestValues),this.projectionTransform=Jn(this.projectionDelta,this.treeScale),(this.projectionTransform!==p||this.treeScale.x!==f||this.treeScale.y!==d)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m)),at.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),r){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(r,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},h=pt();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const f=L(),d=c?c.source:void 0,m=this.layout?this.layout.source:void 0,p=d!==m,x=this.getStack(),b=!x||x.members.length<=1,y=!!(p&&!b&&this.options.crossfade===!0&&!this.path.some(Ac));this.animationProgress=0;let g;this.mixTargetDelta=P=>{const T=P/1e3;is(h.x,r.x,T),is(h.y,r.y,T),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(wt(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Sc(this.relativeTarget,this.relativeTargetOrigin,f,T),g&&ic(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=L()),U(g,this.relativeTarget)),p&&(this.animationValues=u,Qa(u,l,this.latestValues,T,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=T},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(_(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=S.update(()=>{$t.hasAnimatedSinceResize=!0,this.currentAnimation=hc(0,es,{...r,onUpdate:a=>{this.mixTargetDelta(a),r.onUpdate&&r.onUpdate(a)},onComplete:()=>{r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(es),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=r;if(!(!a||!c||!l)){if(this!==r&&this.layout&&l&&Li(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||L();const h=I(this.layout.layoutBox.x);c.x.min=r.target.x.min,c.x.max=c.x.min+h;const f=I(this.layout.layoutBox.y);c.y.min=r.target.y.min,c.y.max=c.y.min+f}U(a,c),gt(a,u),Ct(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(r,a){this.sharedNodes.has(r)||this.sharedNodes.set(r,new rc),this.sharedNodes.get(r).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){var r;const{layoutId:a}=this.options;return a?((r=this.getStack())===null||r===void 0?void 0:r.lead)||this:this}getPrevLead(){var r;const{layoutId:a}=this.options;return a?(r=this.getStack())===null||r===void 0?void 0:r.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),r&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetRotation(){const{visualElement:r}=this.options;if(!r)return;let a=!1;const{latestValues:c}=r;if((c.rotate||c.rotateX||c.rotateY||c.rotateZ)&&(a=!0),!a)return;const l={};for(let u=0;u<ts.length;u++){const h="rotate"+ts[u];c[h]&&(l[h]=c[h],r.setStaticValue(h,0))}r.render();for(const u in l)r.setStaticValue(u,l[u]);r.scheduleRender()}getProjectionStyles(r={}){var a,c;const l={};if(!this.instance||this.isSVG)return l;if(this.isVisible)l.visibility="";else return{visibility:"hidden"};const u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=Wt(r.pointerEvents)||"",l.transform=u?u(this.latestValues,""):"none",l;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const p={};return this.options.layoutId&&(p.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,p.pointerEvents=Wt(r.pointerEvents)||""),this.hasProjected&&!ot(this.latestValues)&&(p.transform=u?u({},""):"none",this.hasProjected=!1),p}const f=h.animationValues||h.latestValues;this.applyTransformsToTarget(),l.transform=Jn(this.projectionDeltaWithTransform,this.treeScale,f),u&&(l.transform=u(f,l.transform));const{x:d,y:m}=this.projectionDelta;l.transformOrigin=`${d.origin*100}% ${m.origin*100}% 0`,h.animationValues?l.opacity=h===this?(c=(a=f.opacity)!==null&&a!==void 0?a:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:f.opacityExit:l.opacity=h===this?f.opacity!==void 0?f.opacity:"":f.opacityExit!==void 0?f.opacityExit:0;for(const p in Kt){if(f[p]===void 0)continue;const{correct:x,applyTo:b}=Kt[p],y=l.transform==="none"?f[p]:x(f[p],h);if(b){const g=b.length;for(let P=0;P<g;P++)l[b[P]]=y}else l[p]=y}return this.options.layoutId&&(l.pointerEvents=h===this?Wt(r.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>{var a;return(a=r.currentAnimation)===null||a===void 0?void 0:a.stop()}),this.root.nodes.forEach(ns),this.root.sharedNodes.clear()}}}function dc(t){t.updateLayout()}function mc(t){var e;const n=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:i}=t.layout,{animationType:o}=t.options,r=n.source!==t.layout.source;o==="size"?N(h=>{const f=r?n.measuredBox[h]:n.layoutBox[h],d=I(f);f.min=s[h].min,f.max=f.min+d}):Li(o,n.layoutBox,s)&&N(h=>{const f=r?n.measuredBox[h]:n.layoutBox[h],d=I(s[h]);f.max=f.min+d,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+d)});const a=pt();Ct(a,s,n.layoutBox);const c=pt();r?Ct(c,t.applyTransform(i,!0),n.measuredBox):Ct(c,s,n.layoutBox);const l=!wi(a);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:d}=h;if(f&&d){const m=L();wt(m,n.layoutBox,f.layoutBox);const p=L();wt(p,s,d.layoutBox),Di(m,p)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=p,t.relativeTargetOrigin=m,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:s,snapshot:n,delta:c,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:s}=t.options;s&&s()}t.options.transition=void 0}function pc(t){at.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function gc(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function yc(t){t.clearSnapshot()}function ns(t){t.clearMeasurements()}function vc(t){t.isLayoutDirty=!1}function xc(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ss(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Pc(t){t.resolveTargetDelta()}function Tc(t){t.calcProjection()}function bc(t){t.resetRotation()}function Vc(t){t.removeLeadSnapshot()}function is(t,e,n){t.translate=w(e.translate,0,n),t.scale=w(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function rs(t,e,n,s){t.min=w(e.min,n.min,s),t.max=w(e.max,n.max,s)}function Sc(t,e,n,s){rs(t.x,e.x,n.x,s),rs(t.y,e.y,n.y,s)}function Ac(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const Cc={duration:.45,ease:[.4,0,.1,1]},os=t=>typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes(t),as=os("applewebkit/")&&!os("chrome/")?Math.round:M;function cs(t){t.min=as(t.min),t.max=as(t.max)}function wc(t){cs(t.x),cs(t.y)}function Li(t,e,n){return t==="position"||t==="preserve-aspect"&&!De(Qn(e),Qn(n),.2)}const Dc=Mi({attachResizeListener:(t,e)=>H(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),xe={current:void 0},Ri=Mi({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!xe.current){const t=new Dc({});t.mount(window),t.setOptions({layoutScroll:!0}),xe.current=t}return xe.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Mc={pan:{Feature:Ka},drag:{Feature:za,ProjectionNode:Ri,MeasureLayout:Si}},Lc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Rc(t){const e=Lc.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}function Fe(t,e,n=1){const[s,i]=Rc(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);if(o){const r=o.trim();return mi(r)?parseFloat(r):r}else return Te(i)?Fe(i,e,n+1):i}function Fc(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(i=>{const o=i.get();if(!Te(o))return;const r=Fe(o,s);r&&i.set(r)});for(const i in e){const o=e[i];if(!Te(o))continue;const r=Fe(o,s);r&&(e[i]=r,n||(n={}),n[i]===void 0&&(n[i]=o))}return{target:e,transitionEnd:n}}const Bc=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Fi=t=>Bc.has(t),kc=t=>Object.keys(t).some(Fi),ls=t=>t===ht||t===v,us=(t,e)=>parseFloat(t.split(", ")[e]),hs=(t,e)=>(n,{transform:s})=>{if(s==="none"||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/);if(i)return us(i[1],e);{const o=s.match(/^matrix\((.+)\)$/);return o?us(o[1],t):0}},Ec=new Set(["x","y","z"]),jc=Bt.filter(t=>!Ec.has(t));function Oc(t){const e=[];return jc.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}const vt={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:hs(4,13),y:hs(5,14)};vt.translateX=vt.x;vt.translateY=vt.y;const Ic=(t,e,n)=>{const s=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:r}=o,a={};r==="none"&&e.setStaticValue("display",t.display||"block"),n.forEach(l=>{a[l]=vt[l](s,o)}),e.render();const c=e.measureViewportBox();return n.forEach(l=>{const u=e.getValue(l);u&&u.jump(a[l]),t[l]=vt[l](c,o)}),t},Uc=(t,e,n={},s={})=>{e={...e},s={...s};const i=Object.keys(e).filter(Fi);let o=[],r=!1;const a=[];if(i.forEach(c=>{const l=t.getValue(c);if(!t.hasValue(c))return;let u=n[c],h=Tt(u);const f=e[c];let d;if(Xt(f)){const m=f.length,p=f[0]===null?1:0;u=f[p],h=Tt(u);for(let x=p;x<m&&f[x]!==null;x++)d?Ke(Tt(f[x])===d):d=Tt(f[x])}else d=Tt(f);if(h!==d)if(ls(h)&&ls(d)){const m=l.get();typeof m=="string"&&l.set(parseFloat(m)),typeof f=="string"?e[c]=parseFloat(f):Array.isArray(f)&&d===v&&(e[c]=f.map(parseFloat))}else h!=null&&h.transform&&(d!=null&&d.transform)&&(u===0||f===0)?u===0?l.set(d.transform(u)):e[c]=h.transform(f):(r||(o=Oc(t),r=!0),a.push(c),s[c]=s[c]!==void 0?s[c]:e[c],l.jump(f))}),a.length){const c=a.indexOf("height")>=0?window.pageYOffset:null,l=Ic(e,t,a);return o.length&&o.forEach(([u,h])=>{t.getValue(u).set(h)}),t.render(),ee&&c!==null&&window.scrollTo({top:c}),{target:l,transitionEnd:s}}else return{target:e,transitionEnd:s}};function Nc(t,e,n,s){return kc(e)?Uc(t,e,n,s):{target:e,transitionEnd:s}}const Gc=(t,e,n,s)=>{const i=Fc(t,e,s);return e=i.target,s=i.transitionEnd,Nc(t,e,n,s)},Be={current:null},Bi={current:!1};function Wc(){if(Bi.current=!0,!!ee)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Be.current=t.matches;t.addListener(e),e()}else Be.current=!1}function $c(t,e,n){const{willChange:s}=e;for(const i in e){const o=e[i],r=n[i];if(O(o))t.addValue(i,o),Qt(s)&&s.add(i);else if(O(r))t.addValue(i,yt(o,{owner:t})),Qt(s)&&s.remove(i);else if(r!==o)if(t.hasValue(i)){const a=t.getValue(i);!a.hasAnimated&&a.set(o)}else{const a=t.getStaticValue(i);t.addValue(i,yt(a!==void 0?a:o,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const fs=new WeakMap,ki=Object.keys(Lt),Hc=ki.length,ds=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],zc=Oe.length;class Kc{constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:i,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>S.render(this.render,!1,!0);const{latestValues:a,renderState:c}=o;this.latestValues=a,this.baseTarget={...a},this.initialValues=n.initial?{...a}:{},this.renderState=c,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=i,this.options=r,this.isControllingVariants=se(n),this.isVariantNode=xs(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(n,{});for(const h in u){const f=u[h];a[h]!==void 0&&O(f)&&(f.set(a[h],!1),Qt(l)&&l.add(h))}}scrapeMotionValuesFromProps(e,n){return{}}mount(e){this.current=e,fs.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),Bi.current||Wc(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Be.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){fs.delete(this.current),this.projection&&this.projection.unmount(),_(this.notifyUpdate),_(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,n){const s=ut.has(e),i=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&S.update(this.notifyUpdate,!1,!0),s&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{i(),o()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}loadFeatures({children:e,...n},s,i,o){let r,a;for(let c=0;c<Hc;c++){const l=ki[c],{isEnabled:u,Feature:h,ProjectionNode:f,MeasureLayout:d}=Lt[l];f&&(r=f),u(n)&&(!this.features[l]&&h&&(this.features[l]=new h(this)),d&&(a=d))}if(!this.projection&&r){this.projection=new r(this.latestValues,this.parent&&this.parent.projection);const{layoutId:c,layout:l,drag:u,dragConstraints:h,layoutScroll:f,layoutRoot:d}=n;this.projection.setOptions({layoutId:c,layout:l,alwaysMeasureLayout:!!u||h&&dt(h),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:typeof l=="string"?l:"both",initialPromotionConfig:o,layoutScroll:f,layoutRoot:d})}return a}updateFeatures(){for(const e in this.features){const n=this.features[e];n.isMounted?n.update():(n.mount(),n.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):L()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}makeTargetAnimatable(e,n=!0){return this.makeTargetAnimatableFromInstance(e,this.props,n)}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<ds.length;s++){const i=ds[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const o=e["on"+i];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=$c(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const s=this.parent?this.parent.getVariantContext()||{}:{};return this.props.initial!==void 0&&(s.initial=this.props.initial),s}const n={};for(let s=0;s<zc;s++){const i=Oe[s],o=this.props[i];(Mt(o)||o===!1)&&(n[i]=o)}return n}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){n!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,n)),this.values.set(e,n),this.latestValues[e]=n.get()}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=yt(n,{owner:this}),this.addValue(e,s)),s}readValue(e){var n;return this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(n=this.getBaseTargetFromProps(this.props,e))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,e,this.options)}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var n;const{initial:s}=this.props,i=typeof s=="string"||typeof s=="object"?(n=ze(this.props,s))===null||n===void 0?void 0:n[e]:void 0;if(s&&i!==void 0)return i;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!O(o)?o:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new tn),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class Ei extends Kc{sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:n,...s},{transformValues:i},o){let r=ha(s,e||{},this);if(i&&(n&&(n=i(n)),s&&(s=i(s)),r&&(r=i(r))),o){la(this,s,r);const a=Gc(this,s,r,n);n=a.transitionEnd,s=a.target}return{transition:e,transitionEnd:n,...s}}}function _c(t){return window.getComputedStyle(t)}class Xc extends Ei{readValueFromInstance(e,n){if(ut.has(n)){const s=qe(n);return s&&s.default||0}else{const s=_c(e),i=(Vs(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return Vi(e,n)}build(e,n,s,i){Ue(e,n,s,i.transformTemplate)}scrapeMotionValuesFromProps(e,n){return He(e,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;O(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}renderInstance(e,n,s,i){Ms(e,n,s,i)}}class Yc extends Ei{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(ut.has(n)){const s=qe(n);return s&&s.default||0}return n=Ls.has(n)?n:$e(n),e.getAttribute(n)}measureInstanceViewportBox(){return L()}scrapeMotionValuesFromProps(e,n){return Fs(e,n)}build(e,n,s,i){Ge(e,n,s,this.isSVGTag,i.transformTemplate)}renderInstance(e,n,s,i){Rs(e,n,s,i)}mount(e){this.isSVGTag=We(e.tagName),super.mount(e)}}const qc=(t,e)=>Ie(t)?new Yc(e,{enableHardwareAcceleration:!1}):new Xc(e,{enableHardwareAcceleration:!0}),Zc={layout:{ProjectionNode:Ri,MeasureLayout:Si}},Qc={...Aa,...Hr,...Mc,...Zc},ol=Qi((t,e)=>Rr(t,e,Qc,qc));function Jc(){const t=Dt(!1);return ys(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function tl(){const t=Jc(),[e,n]=$i(0),s=Pe(()=>{t.current&&n(e+1)},[e]);return[Pe(()=>S.postRender(s),[s]),e]}const el=lt(null),nl=t=>!t.isLayoutDirty&&t.willUpdate(!1);function ms(){const t=new Set,e=new WeakMap,n=()=>t.forEach(nl);return{add:s=>{t.add(s),e.set(s,s.addEventListener("willUpdate",n))},remove:s=>{t.delete(s);const i=e.get(s);i&&(i(),e.delete(s)),n()},dirty:n}}const ji=t=>t===!0,sl=t=>ji(t===!0)||t==="id",al=({children:t,id:e,inherit:n=!0})=>{const s=k(zt),i=k(el),[o,r]=tl(),a=Dt(null),c=s.id||i;a.current===null&&(sl(n)&&c&&(e=e?c+"-"+e:c),a.current={id:e,group:ji(n)&&s.group||ms()});const l=Ft(()=>({...a.current,forceRender:o}),[r]);return Ht(zt.Provider,{value:l},t)};export{al as L,ol as m};
@@ -0,0 +1,5 @@
1
+ var En=Object.defineProperty;var Tn=(t,n,s)=>n in t?En(t,n,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[n]=s;var h=(t,n,s)=>(Tn(t,typeof n!="symbol"?n+"":n,s),s);import{Q as Be,t as Ln,v as Rn,E as On,x as _n,z as jt,A as tt,B as e,S as nt,C as x,D as fe,H as be,I as Ie,J as Ue,K as Wt,L as ie,M as $n,N as Ee,O as C,P as $,R as V,U as Q,W as Mn,r as m,p as d,T as pe,X as yt,F as Te,Y as p,Z as He,$ as zt,a0 as Bn,a1 as me,a2 as ke,w as ye,a3 as Un,q as st,a4 as Vn,o as Dn,a5 as T,a6 as le,a7 as at,a8 as Fn,a9 as Hn,aa as jn,ab as Wn,ac as zn,k as J,ad as vt,ae as Gn,af as qn,ag as Kn,ah as Le,ai as Gt,aj as Yn,ak as qt,al as Ne,am as Ae,an as wt,ao as xt,ap as Qn,aq as Kt,ar as Jn,as as Xn,at as Zn,au as es,av as ts,aw as rt,ax as it,ay as _,n as ns,az as ss,aA as as,aB as rs,aC as is,aD as cs,aE as ls,aF as os,aG as ds,aH as ms}from"./vendor-2d0139ca.js";import{O as we}from"./oidc-client-6f6e47c2.js";import{u as us,a as hs,S as ps}from"./@splitsoftware-7d799540.js";import{f as se,p as gs,a as kt}from"./date-fns-c5d8fbc0.js";import{m as Nt}from"./framer-motion-bb8d6b82.js";import{i as fs}from"./datadog-ff247651.js";import"./lodash-5d893f8c.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const c of i.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function s(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function a(r){if(r.ep)return;r.ep=!0;const i=s(r);fetch(r.href,i)}})();Be.prototype.selectCached=function(t,n=s=>null){return this.selectHasCache().pipe(Ln(0),Rn(s=>s?On:_n(t()).pipe(jt(n))))};class R{static setParameters(n,s){this._apiBaseUrl=n,this._jwt=s}static get instance(){return tt(this._apiBaseUrl).headers({Authorization:`Bearer ${this._jwt}`,"X-APP-VERSION":"0.3.53405"})}}h(R,"_apiBaseUrl"),h(R,"_jwt");class bs extends R{}class re extends R{}class he{static setParameters(n,s,a){this._apiBaseUrl=n,this._jwt=s,this._profileId=a}static get instance(){return tt(this._apiBaseUrl).headers({Authorization:`Bearer ${this._jwt}`,"X-PROFILE-ID":this._profileId,"X-APP-VERSION":"0.3.53405"})}}h(he,"_apiBaseUrl"),h(he,"_jwt"),h(he,"_profileId");const Yt=({size:t})=>e("svg",{className:`animate-spin h-${t??5} w-${t??5}`,viewBox:"0 0 24 24",fill:"none",children:[e("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor","stroke-width":"4"}),e("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),Ve=()=>e("div",{className:"flex justify-center items-center h-screen text-primary",children:[e(Yt,{size:5}),e("div",{className:"pl-3 text-xl font-light text-primary",children:"Loading..."})]}),Qt="/benefits/app/assets/logo-a34e9b4b.png",ys=()=>e("div",{className:"flex flex-col justify-center items-center h-screen text-grey-900",children:[e("img",{className:"block h-8 w-auto",src:Qt,alt:"Flare Benefits"}),e("h1",{className:"mt-8",children:"You have been successfully logged out of Flare Benefits"})]});var At,Ct;const Re=["money","mind","body","work","life"];var Jt=(t=>(t.WellbeingHub="wellbeing",t.FlareApp="flareMobileApp",t.SalaryPackagingCars="salaryPackagingCars",t))(Jt||{});const vs=["default","pba"];function ws(){return{user:x,config:x,navTab:"benefits",appView:"employee",redirectPath:x,mode:"default",shopifyUrl:x,isWelcomeModalOpen:!1}}let xs=(At=fe({name:"benefits-app",resettable:!0,producerFn:be}),At(Ct=class extends nt{constructor(){super(ws())}})||Ct);const I=new xs;class ks extends Be{constructor(s){super(s);h(this,"signedInUser$",this.select(s=>s.user));h(this,"appConfig$",this.select(s=>s.config));h(this,"navPage$",this.select(s=>s.navTab));h(this,"appView$",this.select(s=>s.appView));h(this,"signedInUserRole$",this.select(s=>Ie.pipe(s.user,Ue(()=>"user",a=>a.benefitsProfile.role))));this.store=s}}const G=new ks(I);function S(t,n){return Wt(t,$n(()=>n))}function ct(t){return S(t,null)}function Qe(t,n="Option value is none."){if(ie(t))throw new Error(n);return t.value}function Pt(t,n){return Wt(t,Ue(()=>n===null,s=>s===n))}const Ns=()=>{const t=async()=>{const a=await tt(`${window.location.origin}/benefits/app/config.json`).get().json();I.update({config:Ee(a)})},n=()=>Qe(G.getValue().config);return{fetchConfigAsync:t,getConfig:n,getPublicBackendUrl:()=>n().apiBaseUrl.replace("backend","public")}},B=Ns();function Oe(t,n){const s=new URLSearchParams(n);return C(s.get(t))}function je(t,n){const s=new URLSearchParams(n.replace(/^#+/,""));return C(s.get(t))}const Je=t=>{if(t!=null&&t.startsWith(B.getConfig().apiGatewayBaseUrl+"/benefits/app/#"))return t.split("#")[1]},As=()=>{const t="redirectPath",n="mode",s=r=>{I.update({redirectPath:r})},a=r=>{I.update({mode:r})};return{extractRedirectPath:()=>{const r=Oe(t,window.location.search);$(r)&&s(r)},extractMode(){const r=Oe(n,window.location.search);$(r)&&vs.includes(r.value)&&a(r.value)},redirectToPathIfExists(){const r=G.getValue().redirectPath;$(r)&&(s(x),V(r.value))}}},Xe=As();class Xt{constructor(n){h(this,"_value",x);this.factory=n}get value(){if($(this._value))return this._value.value;const n=this.factory();return this._value=Ee(n),n}}var St,It,U=(t=>(t[t.Unauthorized=0]="Unauthorized",t[t.SignInPending=1]="SignInPending",t[t.Authenticated=2]="Authenticated",t[t.SignOutPending=3]="SignOutPending",t[t.Error=4]="Error",t))(U||{});function Cs(){return{authStatus:0,jwt:x}}let Ps=(St=fe({name:"authentication",resettable:!0,producerFn:be}),St(It=class extends nt{constructor(){super(Cs())}})||It);const ee=new Ps;var Ce=(t=>(t.SignIn="callback",t.SignOut="logout",t.SilentRefresh="silent-refresh",t))(Ce||{});class Ss{constructor(){h(this,"userManager");h(this,"tokenQueryParameter","token");h(this,"b2cJwtQueryParameter","b2cJwt");h(this,"profileIdQueryParameter","profileId");h(this,"getHostOidcUrl",()=>`${window.location.origin}/benefits/app/#/oidc`);this.userManager=new Xt(()=>{const n=new we.UserManager(this.userManagerSettings());return n.events.addAccessTokenExpired(()=>this.signOutRedirectAsync()),n.events.addUserLoaded(this.sessionUpdatedHandler),this.configureLogging(),n})}async refreshIfExpired(){const n=await this.userManager.value.getUser();n!=null&&n.expired&&this.userManager.value.signinSilent()}tokenExists(n){const s=Oe(this.tokenQueryParameter,n);return Q.isSome(s)}b2cJwtExists(n){const s=je(this.b2cJwtQueryParameter,n);return Q.isSome(s)}isOidcRoute(n){return n.includes("callback")||n.includes("logout")||n.includes("silent-refresh")}async initFromB2cJwt(n,s){const a=Qe(je(this.b2cJwtQueryParameter,s),`"${this.b2cJwtQueryParameter}" fragment is required`),r=Qe(je(this.profileIdQueryParameter,s),`"${this.profileIdQueryParameter}" fragment is required`);he.setParameters(B.getConfig().workplaceBackendUrl,a,r);const i=await he.instance.url("token").get().json();window.location.href=n+"?token="+i.token}async initFromToken(n,s){if(this.isOidcRoute(n))return;const a=Oe(this.tokenQueryParameter,s);if(Q.isNone(a))throw ee.update({authStatus:U.Error}),Error(`"${this.tokenQueryParameter}" URL query parameter is required`);await this.signInRedirectAsync(a)}signOutRedirectAsync(){return ee.update({authStatus:U.SignOutPending}),this.userManager.value.signoutRedirect()}async signInRedirectCallbackAsync(){await this.userManager.value.signinRedirectCallback(window.location.href.replace("/oidc/callback?","")),ee.update({authStatus:U.Authenticated})}async signOutRedirectCallbackAsync(){await this.userManager.value.signoutRedirectCallback(),Mn()}async silentRefreshCallbackAsync(){await this.userManager.value.signinSilentCallback()}async signOut(){return ee.update({authStatus:U.Unauthorized,jwt:Q.none})}async signInRedirectAsync(n){ee.update({authStatus:U.SignInPending}),await this.userManager.value.signinRedirect({extraQueryParams:{irt:n.value}})}sessionUpdatedHandler(n){ee.update({jwt:Q.fromNullable(n.access_token)})}userManagerSettings(){return{authority:B.getConfig().oidcAuthority,client_id:"apollo-benefits-ui",redirect_uri:`${this.getHostOidcUrl()}/callback?`,response_type:"id_token token",scope:"openid",post_logout_redirect_uri:`${this.getHostOidcUrl()}/logout?`,silent_redirect_uri:`${this.getHostOidcUrl()}/silent-refresh?`,automaticSilentRenew:!0,accessTokenExpiringNotificationTime:10,filterProtocolClaims:!0,loadUserInfo:!0,clockSkew:2592e3}}configureLogging(){we.Log.logger=console,we.Log.level=we.Log.DEBUG}}const H=new Ss,Is=({mode:t})=>{const[n,s]=m(!1);return d(()=>{(async()=>{switch(t){case Ce.SignIn:await H.signInRedirectCallbackAsync(),window.location.hash="#",V("/"),Xe.redirectToPathIfExists();break;case Ce.SignOut:await H.signOutRedirectCallbackAsync(),s(!0);break;case Ce.SilentRefresh:await H.silentRefreshCallbackAsync();break}})()},[]),n?e(ys,{}):e(Ve,{})},Es=({fragment:t})=>(d(()=>{(async()=>await H.initFromB2cJwt(window.location.pathname,t))()},[]),e(Ve,{}));class Ts extends Be{constructor(s){super(s);h(this,"authState$",this.select());this.store=s}get isUnauthorized(){return this.getValue().authStatus===U.Unauthorized||this.getValue().authStatus===U.Error}get isAuthorized(){return this.getValue().authStatus===U.Authenticated}get jwt(){const s=this.getValue().jwt;return $(s)?s.value:""}}const Zt=new Ts(ee);class Ls{async postTrackEventAsync(n){return R.instance.url("benefits/track-event").post(n).res()}}const en=new Ls,Et=t=>{switch(t){case"cars-calculator-gated":case"cars-calculator-ungated":return"cars-calculator";case"typeform":return"typeform";case"external-link":case"activity-advertisement":return"advertisement";case void 0:return"unknown";default:return t}};class tn{constructor(n){h(this,"trackEventAsync");this.trackEventAsync=n}async trackAppLoadedAsync(){return this.trackEventAsync("appLoaded")}async trackBenefitsOpenedAsync(){return this.trackEventAsync("benefitsOpened")}async trackAppOfferViewedAsync(){return this.trackEventAsync("appOfferViewed")}async trackAppOfferAcceptedAsync(){return this.trackEventAsync("appOfferAccepted")}async trackWellbeingOpenedAsync(){return this.trackEventAsync("wellbeingOpened")}async trackAdminOpenedAsync(){return this.trackEventAsync("adminOpened")}async trackConsentStartedAsync(){return this.trackEventAsync("consentStarted")}async trackConsentCompletedAsync(){return this.trackEventAsync("consentCompleted")}async trackRegistrationStartedAsync(){return this.trackEventAsync("registrationStarted")}async trackRegistrationSubmittedAsync(){return this.trackEventAsync("registrationSubmitted")}async trackRegistrationResentAsync(){return this.trackEventAsync("registrationResent")}async trackRegistrationVerifiedAsync(){return this.trackEventAsync("registrationVerified")}async trackRegistrationFailedAsync(n){return this.trackEventAsync({registrationFailed:{reason:n}})}async trackRegistrationCompletedAsync(){return this.trackEventAsync("registrationCompleted")}async trackRegistrationErrorViewedAsync(n){return this.trackEventAsync({registrationErrorViewed:{reason:n}})}async trackRegistrationErrorDismissedAsync(){return this.trackEventAsync("registrationErrorDismissed")}async trackMarketplaceOfferViewedAsync(n,s,a){const r={offer:n,experiment:s,treatment:a};return this.trackEventAsync({marketplaceOfferViewed:r})}async trackMarketplaceOfferAcceptedAsync(n,s,a){const r={offer:n,experiment:s,treatment:a};return this.trackEventAsync({marketplaceOfferAccepted:r})}async trackPerksListViewedAsync(n){const s={pillar:n};return this.trackEventAsync({perksListViewed:s})}async trackEntriesListViewedAsync(n){const s={pillar:n};return this.trackEventAsync({entriesListViewed:s})}async trackFeaturePerkViewedAsync({benefitId:n,benefit:s}){const a={perkId:n,perkPillar:s.category,perkTitle:s.title,placement:"feature"};return this.trackEventAsync({perkViewed:a})}async trackExplorePerkViewedAsync({benefitId:n,benefit:s}){const a={perkId:n,perkPillar:s.category,perkTitle:s.title,placement:"explore"};return this.trackEventAsync({perkViewed:a})}async trackDocumentClickedAsync({benefitId:n,benefit:s}){const a={perkId:n,perkPillar:s.category,perkTitle:s.title,type:"document"};return this.trackEventAsync({attachmentOpened:a})}async trackPerkVisitedAsync({benefitId:n,benefit:s}){const a={perkId:n,perkPillar:s.category,perkTitle:s.title};return this.trackEventAsync({perkVisited:a})}async trackPerksListSearched(n){const s={query:n};return this.trackEventAsync({perksListSearched:s})}async trackRoleAssignedAsync(n){return this.trackEventAsync({roleAssigned:n})}async trackEntryViewed(n){return this.trackEventAsync({entryViewed:n})}async trackEntriesListSearchedAsync(n){const s={query:n};return this.trackEventAsync({entriesListSearched:s})}async trackCategoryOpenedAsync(n,s){const a={categoryId:n,categoryName:s};return this.trackEventAsync({categoryOpened:a})}async trackCategoryClosedAsync(n,s,a){const r={categoryId:n,categoryName:s,screen:a};return this.trackEventAsync({categoryClosed:r})}async trackDiscountsOpenedAsync(n,s){const a={categoryId:n,categoryName:s};return this.trackEventAsync({discountsOpened:a})}async trackActivityActionedAsync(n,s,a,r){r==="external-link"?this.trackActivityCompletedAsync(n,s,a,r):this.trackActivityStartedAsync(n,s,a,r)}async trackActivityStartedAsync(n,s,a,r){const i={categoryId:n,id:s,name:a,type:Et(r)};return this.trackEventAsync({activityStarted:i})}async trackActivityCompletedAsync(n,s,a,r){const i={categoryId:n,id:s,name:a,type:Et(r)};return this.trackEventAsync({activityCompleted:i})}async trackBenefitsPlanViewedAsync(n){const s={categories:n};return this.trackEventAsync({benefitsPlanViewed:s})}}const Rs=async t=>{try{await en.postTrackEventAsync({event:t,treatments:[]})}catch{return}},Ze=new tn(Rs);var ae=(t=>(t.Consent="apollo-benefits-consent",t.CustomerRegistration="apollo-benefits-customer-registration",t))(ae||{});const Os=t=>{if(t){const n=[];return Object.values(ae).map(s=>{var a;n.push({featureFlag:s,treatment:(a=t[s])==null?void 0:a.treatment})}),n}return[]},P=()=>{const[t,n]=m(),{isReady:s,client:a}=us(),[r,i]=m(Ze);d(()=>{(async()=>{if(s){a==null||a.setMaxListeners(30);const l=a==null?void 0:a.getTreatmentsWithConfig(Object.values(ae)),y=Os(l);n(y)}})()},[s]);const c=pe(async l=>{try{await en.postTrackEventAsync({event:l,treatments:t||[]})}catch{return}},[t]);return d(()=>{i(new tn(c))},[c]),{service:r}};const _s="/benefits/app/assets/external_link-599a0aec.svg";class $s{async getBenefitsAsync(){return R.instance.url("benefits").get().json()}async postDocumentAsync(n){return R.instance.url("document").addon(yt).formData(n).post().badRequest(s=>{throw new Error(s.message)}).json()}async postImageAsync(n){return R.instance.url("image").addon(yt).formData(n).post().badRequest(s=>{throw new Error(s.message)}).json()}async getShopifyUrl(){return R.instance.url("shopify-url").get().json()}}const nn=new $s;class Ms{async setShopifyUrl(){const n=await this.fetchShopifyUrl();I.update({shopifyUrl:n})}getShopifyUrl(){return G.getValue().shopifyUrl}updateIsWelcomeModalOpen(n){I.update({isWelcomeModalOpen:n})}getIsWelcomeModalOpen(){return I.getValue().isWelcomeModalOpen}async fetchShopifyUrl(){return C((await nn.getShopifyUrl()).redirectUrl)}}const oe=new Ms;function W(...t){return t.filter(Boolean).join(" ")}const Bs=t=>`${t[0].toUpperCase()}${t.slice(1)}`,Tt=({user:{featureFlags:t}})=>{const[n,s]=m(x),{service:a}=P(),r=Te(()=>{const i=new Map([["benefits","/"]]);return t.wellbeing&&i.set("wellbeing","/wellbeing-hub"),Array.from(i)},[]);return d(()=>{const i=[G.navPage$.subscribe(c=>{s(C(c))})];return()=>{i.map(c=>c.unsubscribe())}},[]),e("nav",{className:"-mb-px flex","aria-label":"Tabs",children:[r.map(([i,c])=>e("div",{onClick:async()=>{s(C(i)),V(c)},className:W(Pt(n,i)?"border-primary text-primary":"border-transparent text-gray-500","cursor-pointer hover:text-gray-700 hover:border-gray-300 px-4 md:ml-4 flex-grow md:flex-grow-0","py-4 text-center border-b-4 text-base leading-6 font-semibold cursor-pointer capitalize"),"aria-current":Pt(n,i)?"page":void 0,children:e("span",{children:i})},i)),e("div",{className:"border-transparent text-gray-500 cursor-pointer hover:text-gray-700 hover:border-gray-300 px-4 md:ml-4 flex-grow md:flex-grow-0 py-4 text-center border-b-4 text-base leading-6 font-semibold cursor-pointer capitalize",children:e("a",{className:"inline-flex",href:S(oe.getShopifyUrl(),"#"),target:"_blank",rel:"noreferrer",onClick:()=>{a.trackDiscountsOpenedAsync("discounts","Discounts")},children:[e("span",{children:"discounts"}),e("img",{className:"ml-2",src:_s})]})})]})},Us=()=>{const[t,n]=m("employee");return d(()=>{const s=[G.appView$.subscribe(n)];return()=>{s.map(a=>a.unsubscribe())}},[]),e("span",{className:"relative z-0 inline-flex shadow-sm rounded-md",children:[e("button",{type:"button",className:W(t==="admin"?"text-primary bg-white cursor-default":"text-gray-700 bg-gray-50","relative inline-flex items-center px-4 py-1 rounded-l-md border border-gray-300 text-sm font-medium hover:bg-white focus:z-10 focus:outline-none"),onClick:()=>{t!=="admin"&&V("/admin")},children:"Admin view"}),e("button",{type:"button",className:W(t==="employee"?"text-primary bg-white cursor-default":"text-gray-700 bg-gray-50","-ml-px relative inline-flex items-center px-4 py-1 rounded-r-md border border-gray-300 text-sm font-medium hover:bg-white focus:z-10 focus:outline-none"),onClick:()=>{t!=="employee"&&V("/")},children:"Employee view"})]})},Vs=[{name:"Admin view",href:"#/admin"},{name:"Employee view",href:"#/"}],sn=()=>e("span",{className:"inline-block h-8 w-8 rounded-full overflow-hidden bg-white border",children:e("svg",{className:"h-full w-full text-gray-300",fill:"currentColor",viewBox:"0 0 24 24",children:e("path",{d:"M24 20.993V24H0v-2.996A14.977 14.977 0 0112.004 15c4.904 0 9.26 2.354 11.996 5.993zM16.002 8.999a4 4 0 11-8 0 4 4 0 018 0z"})})}),Ds=({user:t})=>e(p,{children:e(me,{as:"div","data-dd-action-name":"User menu",className:"z-30 relative inline-block text-left",children:({open:n})=>e(p,{children:[e("div",{children:e(me.Button,{className:`max-w-xs bg-white flex items-center text-sm rounded-full hover:outline-none hover:ring-2 hover:ring-offset-2 hover:ring-primary ${n?"outline-none ring-2 ring-offset-2 ring-primary":""} `,children:e(sn,{})})}),e(ke,{enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",children:e(me.Items,{className:"absolute right-0 mt-2 w-56 divide-y divide-gray-100 rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",children:e("div",{className:"px-1 py-1 ",children:[e(me.Item,{children:()=>e("div",{className:"mx-3 py-2",children:[e("div",{className:"text-base font-medium text-gray-800 dd-privacy-mask",children:t.basicProfile.firstName}),e("div",{className:"text-sm font-medium text-gray-500 dd-privacy-mask",children:t.basicProfile.email})]})}),e("div",{className:"border-t border-grey-900",children:e(me.Item,{children:({active:s})=>e("button",{onClick:()=>H.signOutRedirectAsync(),className:`${s?"bg-secondary text-primary rounded-md":"text-gray-900 "} group flex w-full items-center mt-2 mb-1 px-3 py-2 text-sm font-medium`,children:"Logout"})})})]})})})]})})}),lt=t=>{const n=t.user;if(ie(n))return e(p,{});const[s,a]=m(!1),r=n.value.benefitsProfile.role!=="user";return d(()=>{const i=[G.appView$.subscribe(c=>{a(c==="employee")})];return()=>{i.map(c=>c.unsubscribe())}},[]),e(p,{children:e(He,{as:"nav",className:"bg-gray-50 border-0 md:border-b md:border-gray-200",children:({open:i})=>e(p,{children:[e("div",{className:`mx-auto px-4 sm:px-6 lg:px-8 border-b border-gray-200 md:border-none ${r&&!s?"":"max-w-[90rem]"}`,children:e("div",{className:"flex justify-between h-16",children:[e("div",{className:"flex",children:e("a",{href:"#",onClick:()=>V("/"),className:"flex-shrink-0 flex items-center",children:e("img",{className:"block h-8 w-auto",src:Qt,alt:"Flare Benefits"})})}),e("div",{className:"ml-10 flex flex-wrap flex-grow content-end",children:e("div",{className:"hidden sm:block",children:s&&e(Tt,{user:n.value})})}),e("div",{className:"flex flex-wrap content-center",children:e("div",{className:"hidden md:block",children:r&&e(Us,{})})}),e("div",{className:"hidden md:ml-6 md:flex md:items-center",children:e(Ds,{user:n.value})}),e("div",{className:"-mr-2 flex items-center md:hidden",children:e(He.Button,{className:"bg-white inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary",children:[e("span",{className:"sr-only",children:"Open main menu"}),i?e(zt,{className:"block h-6 w-6","aria-hidden":"true"}):e(Bn,{className:"block h-6 w-6","aria-hidden":"true"})]})})]})}),e(He.Panel,{className:"md:hidden",children:e("div",{className:"pt-4 pb-3 border-b border-gray-200",children:[e("div",{className:"flex items-center px-4",children:[e("div",{className:"flex-shrink-0",children:e(sn,{})}),e("div",{className:"ml-3",children:[e("div",{className:"text-base font-medium text-gray-800 dd-privacy-mask",children:n.value.basicProfile.firstName}),e("div",{className:"text-sm font-medium text-gray-500 dd-privacy-mask",children:n.value.basicProfile.email})]})]}),e("div",{className:"mt-3 space-y-1",children:[r&&e(p,{children:Vs.map(c=>e("a",{href:c.href,className:"block px-4 py-2 text-base font-medium text-gray-500 hover:text-primary hover:bg-secondary",children:c.name},c.name))}),e("a",{onClick:()=>H.signOutRedirectAsync(),className:"block cursor-pointer px-4 py-2 text-base font-medium text-gray-500 hover:text-primary hover:bg-secondary",children:"Logout"})]})]})}),s&&e("div",{className:"sm:hidden bg-white border-b border-gray-200",children:e(Tt,{user:n.value})})]})})})},Fs="/customer-profile/backend/v1.0/workplace-link/config";class Hs{async getConfigAsync(){return re.instance.url(Fs).get().json()}}const js=new Hs,Ws=t=>({identityProvider:t==null?void 0:t.identityProvider,isEstablished:t==null?void 0:t.isEstablished});class zs{async getUserProfile(){return await R.instance.url("users/self").get().json()}async getBasicProfileByEmail(n){const s=await R.instance.url(`users?email=${n}`).get().notFound(()=>null).json();return C(s)}saveConsent(){R.instance.url("users/consent").post()}}const We=new zs;class Lt{constructor(){h(this,"basicProfile");h(this,"benefitsProfile");h(this,"featureFlags");h(this,"account")}static toDomain(n){return{basicProfile:n.basicProfile,benefitsProfile:n.benefitsProfile,featureFlags:n.featureFlags,accountName:n.account?n.account.name+(n.account.legalEntityName?" - "+n.account.legalEntityName:""):void 0}}}const ne=class ne{static get profileId(){if(ie(this._profileId))throw Error("ProfileId is missing.");return this._profileId.value}static set profileId(n){this._profileId=C(n)}static set accountId(n){this._accountId=C(n)}static get profileIdOrDefault(){return S(this._profileId,"")}static get accountIdOrDefault(){return S(this._accountId,"")}static get partnerIdOrDefault(){return S(this._partnerId,"")}extractProfileId(n){const s=C(Un(n).sub);if(ie(s))throw Error("profileId property is missing.");ne.profileId=s.value}async loadSignedInUserProfileAsync(){const n=Lt.toDomain(await We.getUserProfile());ne.accountId=n.basicProfile.accountId,I.update(s=>{s.user=C(n)})}saveUserConsent(){return We.saveConsent(),I.update(n=>{const s=S(n.user,void 0);s&&(n.user=C({...s,benefitsProfile:{...s.benefitsProfile,hasConsent:!0}}))}),Promise.resolve()}async setWorkplaceLinkConfig(){const n=Ws(await js.getConfigAsync());I.update(s=>{const a=S(s.user,void 0);a&&(s.user=C({...a,workplaceLinkConfig:n}))})}setIsEstablished(){I.update(n=>{const s=S(n.user,void 0);s&&(n.user=C({...s,workplaceLinkConfig:{...s.workplaceLinkConfig,isEstablished:!0}}))})}async updateCustomerIdAsync(){const n=Lt.toDomain(await We.getUserProfile());I.update(s=>{const a=S(s.user,void 0);a&&(s.user=C({...a,basicProfile:{...a.basicProfile,customerId:n.basicProfile.customerId}}))})}};h(ne,"_profileId",x),h(ne,"_accountId",x),h(ne,"_partnerId",x);let et=ne;const de=ye.createContext(x),an=ye.createContext(!1),te=new et,Pe=()=>{const t=st(de),{service:n}=P();return d(()=>{n.trackAppOfferAcceptedAsync()},[]),e(p,{children:[e(lt,{user:t}),e("div",{className:"p-4",children:e("workplace-link",{"access-token":Zt.jwt,"backend-url":B.getConfig().apiGatewayBaseUrl,source:"WebBenefits",channel:"web"})})]})},rn=()=>{const t=Vn(),n=t.startsWith("state")||t.startsWith("code")||t.startsWith("error");return e(p,{children:n?e(Pe,{}):e("div",{className:"notfound",children:[e("h1",{children:"Error 404"}),e("p",{children:"That page doesn't exist."}),e("a",{href:"#/",children:e("h4",{children:"Back to Home"})})]})})};function xe(t){return ye.useContext(an)?Dn(t.component,t):e(Ve,{})}const ot=t=>({listen:n=>t.listen(({location:s})=>n(s)),location:t.location,push:t.push,replace:t.replace}),Gs=()=>{const t=st(de),n=Te(()=>ct(t),[t]),s=pe(r=>{if(!n)return!1;const{featureFlags:i}=n;return i[r]},[n]),a=pe(()=>n?n.featureFlags:{},[n]);return{getTreatment:s,getAllTreatments:a}},qs=()=>{const n=window.setInterval(async()=>{oe.setShopifyUrl()},12e4);return C(n)},Ks=()=>{d(()=>{let t=x;return(async()=>(await oe.setShopifyUrl(),t=qs()))(),()=>{$(t)&&window.clearInterval(t.value)}},[])},Ys=()=>{const t=()=>G.getValue().mode;return{isDefault:()=>t()==="default",isPba:()=>t()==="pba"}},cn=Ys(),Qs="/benefits/app/assets/external_link_white-55111b2e.svg",Js="/benefits/app/assets/workplace_link_banner_mobile-6ebaa24b.png",Xs="/benefits/app/assets/workplace_link_banner_v2-c81ed849.png",ln=({bgImageUrl:t,className:n,children:s,excludeGradient:a})=>{const r=t?{backgroundImage:`url(${t})`}:{};return e("div",{className:W("relative w-full rounded-lg bg-cover bg-center",n??""),style:r,children:[!a&&e(p,{children:[e("div",{className:"absolute inset-0 rounded-lg bg-black bg-opacity-10"}),e("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-r from-black opacity-80"})]}),e("div",{className:"relative h-full rounded-lg overflow-hidden",children:s})]})},Zs=()=>{const{service:t}=P();return d(()=>{t.trackAppOfferViewedAsync()},[]),e(p,{children:e(ln,{excludeGradient:!0,className:"w-full py-4 px-4 md:py-0 md:pl-9 md:pr-0 bg-gray-50 text-gray-900 border-grey-100 border",children:e("div",{className:"grid grid-cols-1 md:grid-cols-2 place-items-center md:h-72",children:[e("div",{className:"md:hidden w-full px-2",children:e("img",{src:Js})}),e("div",{className:"w-full flex-1 flex-grow justify-self-start",children:[e("div",{className:"text-2xl leading-8 lg:text-3xl xl:text-4xl lg:leading-10 font-extrabold pt-4",children:"Workplace benefits in your pocket!"}),e("div",{className:"text-md md:text-lg leading-6 mt-2 font-medium max-w-lg",children:"Download the Flare app for easy access to your workplace benefits and much more."}),e("div",{className:"pt-5",children:e("button",{type:"button",className:"block w-full mx-auto md:w-auto text-center md:inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm leading-6 font-semibold rounded-md text-white bg-primary",onClick:()=>V("/workplace-link"),children:[e("span",{children:"Get Flare App"}),e("span",{children:e("img",{className:"ml-2 inline-flex mb-1",src:Qs})})]})})]}),e("div",{className:"hidden md:block overflow-hidden mt-10 w-[53rem] ml-32 lg:ml-0",children:e("img",{src:Xs})})]})})})};const ea=({children:t,className:n})=>e("div",{className:"gradient-tile "+n,children:t}),ta=({title:t,subtitle:n,externalUrl:s,icon:a,onClick:r})=>e("a",{className:"w-full cursor-pointer",href:s,target:s&&"_blank"||void 0,onClick:r,children:e(ea,{className:"pl-6 pr-4 py-4 md:w-48 md:h-48 md:px-4 md:py-6 bg-white bg-opacity-50 hover:bg-opacity-100 shadow hover:shadow-lg border-2 rounded-md flex md:flex-col md:justify-items-center md:items-center",children:[e("div",{className:"flex justify-start item-center self-center",children:a}),e("div",{className:"ml-6 md:ml-0 md:text-center md:mt-auto",children:[e("div",{className:"text-blue-600 text-l md:text-xl font-bold leading-7",children:t}),e("div",{className:"text-gray-900 text-base font-medium leading-normal",children:n})]})]})}),na={renderText:t=>t.split(`
2
+ `).flatMap((n,s)=>[s>0&&e("br",{}),n]),renderNode:{[T.BLOCKS.PARAGRAPH]:(t,n)=>e("p",{className:"relative text-gray-500 text-sm font-normal leading-5",children:n}),[T.INLINES.HYPERLINK]:(t,n)=>e("a",{className:"text-blue-600 underline",href:t.data.uri,target:"_blank",rel:"noopener noreferrer",children:n})}},sa=({body:t})=>e(p,{children:le.documentToReactComponents(t,na)}),E=({height:t,width:n,className:s})=>e("div",{className:s,children:e("div",{className:"flex animate-pulse flex-row h-full",children:e("div",{style:{width:`${n?`${n}rem`:"100%"}`,height:`${t}rem`},className:"bg-gray-300 rounded"})})}),aa=()=>e(p,{children:[e(E,{className:"mb-1 md:mb-2",width:20,height:4}),e(E,{className:"mb-5 md:mb-10",width:40,height:2}),e("div",{className:"flex flex-col md:flex-row gap-3 md:gap-8 flex-wrap",children:[e(E,{className:"hidden md:block",width:12,height:12}),e(E,{className:"md:hidden block",height:6}),e(E,{className:"hidden md:block",width:12,height:12}),e(E,{className:"md:hidden block",height:6}),e(E,{className:"hidden md:block",width:12,height:12}),e(E,{className:"md:hidden block",height:6}),e(E,{className:"hidden md:block",width:12,height:12}),e(E,{className:"md:hidden block",height:6}),e(E,{className:"hidden md:block",width:12,height:12}),e(E,{className:"md:hidden block",height:6}),e(E,{className:"hidden md:block",width:12,height:12}),e(E,{className:"md:hidden block",height:6})]})]}),ra=({categories:t,content:n})=>{const{service:s}=P(),[a,r]=m(!0),i=oe.getIsWelcomeModalOpen();return d(()=>{if(!a&&!i){const c=t?t.map(l=>l.title):[];s.trackBenefitsPlanViewedAsync(c)}},[a,i]),d(()=>{t&&(n!=null&&n.title)?r(!1):r(!0)},[t,n==null?void 0:n.title]),e("div",{className:"relative",children:[e("div",{className:"bg-[linear-gradient(0deg,_#2E66F7_0%,_#0005D2_100%)] absolute w-full h-full blur-[250px] opacity-10"}),t&&(n!=null&&n.title)?e(p,{children:[e("div",{className:"text-gray-700 text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 mb-1 md:mb-2",children:n.title}),n.subtitle&&e("div",{className:"text-black text-base md:text-2xl font-normal leading-normal md:leading-loose mb-5 md:mb-10",children:n.subtitle}),e("div",{className:"flex flex-col md:flex-row gap-3 md:gap-8 flex-wrap mb-6",children:t==null?void 0:t.map(c=>e("div",{className:"category-container flex md:flex-col",children:e(ta,{title:c.displayTitle||c.title,subtitle:c.subtitle,icon:e("img",{src:c.iconUrl,className:"w-10 h-10 md:w-16 md:h-16"}),onClick:()=>V("/categories/"+c.title.toLocaleLowerCase())},c.id)}))}),n.disclaimer&&e(sa,{body:n.disclaimer})]}):e(aa,{})]})},ia="/benefits/app/assets/all_tab_color-548783b9.svg",ca="/benefits/app/assets/all_tab_gray-a5051313.svg",on={money:"text-blue-400",mind:"text-green-400",body:"text-red-400",work:"text-orange-400",life:"text-yellow-400"},Rt=["all",...Re],la=({children:t})=>e("nav",{className:"flex p-2 space-x-8 bg-gray-50","aria-label":"Tabs",children:t}),oa=t=>{const{children:n,onClick:s,className:a,selected:r}=t;return e("div",{onClick:s,className:W(a??"",r?"bg-white shadow-md text-gray-800":"text-gray-600 hover:bg-gray-100","w-full py-2 capitalize text-base leading-6 font-semibold rounded-lg focus:outline-none","cursor-pointer flex items-center justify-center"),"aria-current":r?"page":void 0,children:n})},da=({currentTab:t,tabNameList:n,onTabClicked:s})=>e(p,{children:[e("label",{htmlFor:"tabs",className:"sr-only",children:"Select a tab"}),e("select",{id:"tabs",name:"tabs",className:"block w-full pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-primary focus:border-primary sm:text-sm rounded-md",value:t,onChange:a=>{const r=a.currentTarget.value;s(r)},children:n.map(a=>e("option",{value:a,children:Bs(a)}))})]}),ma={money:Fn.faUsdSquare,mind:Hn.faSpa,body:jn.faHeartbeat,work:Wn.faBriefcase,life:zn.faUmbrellaBeach},dn=(t,n)=>e(at,{size:n??"lg",icon:ma[t]}),mn=({currentTab:t,onTabClicked:n})=>{const s=c=>dn(c,"1x"),a=c=>e("div",{className:on[c],children:s(c)}),r={all:e("img",{className:"h-3.5 w-3.5",src:ca,alt:""}),...Object.fromEntries(Re.map(c=>[c,s(c)]))},i={all:e("img",{className:"h-3.5 w-3.5",src:ia,alt:""}),...Object.fromEntries(Re.map(c=>[c,a(c)]))};return e(p,{children:[e("div",{className:"sm:hidden",children:e(da,{currentTab:t,onTabClicked:c=>n(c),tabNameList:[...Rt]})}),e("div",{className:"hidden sm:block",children:e(la,{children:Rt.map(c=>e(oa,{onClick:()=>{n(c)},selected:t===c,className:"uiid-explore-perks-tabs",children:[t===c?i[c]:r[c],e("span",{className:"uiid-explore-tab-name ml-3",children:c})]},c))})})]})},un=({onSearchEvent:t})=>{const n=J(null),s=J(null),[a,r]=m(!1);return d(()=>{const i=[n.current&&vt(n.current,"input").pipe(Gn("target","value"),jt(c=>{r(!!c)}),qn(500)).subscribe(async c=>{t(c)}),s.current&&vt(s.current,"click").subscribe(()=>{n.current.value="",r(!1),t("")})];return()=>{i.map(c=>c==null?void 0:c.unsubscribe())}},[]),e("div",{className:"flex relative rounded-md shadow-sm",children:[e("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none","aria-hidden":"true",children:e(Kn,{className:"mr-3 h-4 w-4 text-gray-400","aria-hidden":"true"})}),e("input",{type:"text",name:"search",id:"search",ref:n,placeholder:"Search perks",className:"uiid-search-bar-input block w-full pl-9 rounded-none rounded-md sm:text-sm border-gray-300"}),e("div",{className:W(a?"":"hidden","absolute inset-y-0 right-0 pr-3 flex items-center z-10 cursor-pointer"),ref:s,children:e(Le,{className:"h-5 w-5 text-gray-400 ","aria-hidden":"true"})})]})};var Ot,_t;const ua=()=>({all:[],money:[],mind:[],body:[],work:[],life:[]}),ha=()=>({perksTab:"all",searchString:""});let pa=(Ot=fe({name:"explore-perks",cache:{ttl:"3600000"},idKey:"benefitId",resettable:!0,producerFn:be}),Ot(_t=class extends Gt{constructor(){super(ha())}})||_t);const ge=new pa,ga=()=>({setTab:t=>{ge.update(n=>{n.perksTab=t})},searchPerks:t=>{ge.update(n=>{n.searchString=t,n.perksTab="all"})}}),ze=ga(),hn=({children:t,className:n})=>e("div",{className:W(n??"","grid items-stretch sm:grid-cols-2 lg:grid-cols-3 gap-8"),children:t}),pn=({children:t})=>e("div",{className:"uiid-preview-empty flex items-center justify-center sm:col-span-2 lg:col-span-3 justify-items-center content-center bg-gray-100 rounded-lg overflow-hidden h-72",children:e("div",{className:"text-xl font-medium text-gray-400 text-center",children:t})}),fa="/benefits-plan/backend/v1.0/categories",ba=(t,n)=>`/benefits-plan/backend/v1.0/categories/${t}/products/${n}`;class ya{async getCategoriesAsync(){return re.instance.url(fa).get().json()}async getProductActivitesAsync(n,s){const a=ba(n,s);return re.instance.url(a).get().json()}}const gn=new ya,dt=async(t,n)=>{const[s]=await Promise.all([t,new Promise(a=>window.setTimeout(a,n))]);return s};class va{constructor(){h(this,"client",new Xt(()=>{const n=B.getConfig();return Yn({space:n.contentfulSpace,environment:n.contentfulEnvironment,accessToken:n.contentfulApiKey})}))}async loadCollectionsAsync(){return(await this.client.value.getEntries({content_type:"benefitsCollection"})).items.map(s=>{var r,i,c,l,y;const{fields:a}=s;return{id:s.sys.id,title:a.title,description:a.description,coverPhotoUrl:((c=(i=(r=a.coverPhoto)==null?void 0:r.fields)==null?void 0:i.file)==null?void 0:c.url)??"",pillar:((l=a.pillar)==null?void 0:l.toLowerCase())??"money",articles:((y=a.contentLibrary)==null?void 0:y.map(u=>({id:u.sys.id,title:u.fields.title,subtitle:u.fields.subtitle,coverPhotoUrl:u.fields.coverPhoto.fields.file.url,pillar:u.fields.pillar.toLowerCase(),primaryContentType:u.fields.primaryContentType.toLowerCase(),slug:"",externalLink:""})))??[],state:"visible"}})}async loadAvailableEntryPreviewsAsync(){return(await this.client.value.getEntries({"sys.contentType.sys.id[in]":"benefitsWellbeingArticle,benefitsExternalLink",select:"sys.id,fields"})).items.map(s=>{const{fields:a}=s;return{id:s.sys.id,title:a.title,subtitle:a.subtitle,coverPhotoUrl:a.coverPhoto.fields.file.url,pillar:a.pillar.toLowerCase(),primaryContentType:a.primaryContentType.toLowerCase(),slug:a.slug,externalLink:a.externalLink}})}async loadArticleAsync(n){const s=await this.client.value.getEntries({content_type:"benefitsWellbeingArticle",limit:1,include:10,"fields.slug":n});if(s.items.length===0)throw Error("Couldn't find this article");return s.items[0].fields}async loadBenefitsPlanCategoryAsync(){return(await this.client.value.getEntries({content_type:"benefitsPlanCategory"})).items.map(s=>s.fields)}async loadBenefitsPlanWebHomeAsync(){const n=await this.client.value.getEntries({content_type:"benefitsBenefitsPlanWeb",limit:1,"fields.slug":"home"});if(n.items.length===0)throw Error("Couldn't find benefits plan home.");return n.items[0].fields}async tryLoadActivityAdvertisementAsync(n){var s;try{return(s=(await this.client.value.getEntry(n)).fields.webBenefitsContent)==null?void 0:s.fields}catch{return}}}const ve=new va,wa=["Start","Get Estimate","View","Ineligible"],xa=async()=>dt(ve.loadBenefitsPlanCategoryAsync(),700),ka=async()=>dt(ve.loadBenefitsPlanWebHomeAsync(),700),fn=t=>{switch(t.component){case"cars-calculator-ungated":return"cars-calculator-ungated";case"cars-calculator-gated":return"cars-calculator-gated";case"typeform":return t.typeformId?"typeform":"none";case"shopify":return"shopify";case"external-link":return"external-link";case"activity-advertisement":return"activity-advertisement";default:return"none"}},Na=async t=>{const n=t.products.length>0?await gn.getProductActivitesAsync(t.id,t.products[0].id):{activities:[]};return(await Promise.all(n.activities.filter(a=>a.activityType==="Advertisement").map(async a=>{const r=await ve.tryLoadActivityAdvertisementAsync(a.articleId);return r?{...r,id:a.id,title:a.title}:void 0}))).filter(a=>!!a)},$t=(t,n,s)=>{const a=s.map(r=>{var i;return{id:r.id,title:r.title,displayTitle:r.displayTitle,subtitle:r.subtitle,tileImage:r.tileImage,modalBody:r.landingModal,disclaimer:r.landingDisclaimer,heroImageDesktop:r.heroImageDesktop,heroImageMobile:r.heroImageMobile,buttonText:r.landingButtonText,component:fn(r),typeformId:r.typeformId,order:r.positionInList,externalUrl:((i=r.link)==null?void 0:i.replace(/\s+/g,""))||void 0}});return{id:t.id,title:n.title,displayTitle:n.displayTitle,trackingId:n.trackingId,subtitle:n.subtitle,iconUrl:t.iconUrl,order:n.positionInList,landings:a.filter(r=>r.component!=="none").sort((r,i)=>r.order-i.order)}},Aa=async()=>{try{const t=await gn.getCategoriesAsync(),n=await xa();return(await Promise.all(t.categories.filter(a=>n.find(i=>i.title.toLowerCase()===a.title.toLowerCase())&&wa.includes(a.status)).map(async a=>{try{const r=n.find(i=>i.title.toLowerCase()===a.title.toLowerCase());switch(fn(r)){case"activity-advertisement":{const i=await Na(a);return i.length>0?$t(a,r,i):void 0}default:return $t(a,r,[r])}}catch{return}}))).filter(a=>!!a&&a.landings.length>0).sort((a,r)=>a.order-r.order)}catch{return[]}},Ca="/workplace-link";class Y extends qt{constructor(s){super(s);h(this,"perksTab$",this.select(s=>s.perksTab));h(this,"all$",Ne([this.selectAll()]).pipe(Ae(([s])=>Y.filterPerks(s,"","all"))));h(this,"classifiedPerks$",Ne([this.selectAll(),this.select(s=>s.searchString)]).pipe(Ae(([s,a])=>{const r=a?Y.searchPerks(s,a):s;return Y.classifyPerks(r)})));h(this,"perksOnStage$",Ne([this.selectAll(),this.select(s=>s.searchString),this.select(s=>s.perksTab)]).pipe(Ae(([s,a,r])=>this.getHasCache()?Q.fromNullable(Y.filterPerks(s,a,r)):x)));this.store=s}static filterPerks(s,a,r){const i=Y.searchPerks(s,a).filter(c=>r==="all"||c.benefit.category===r);return Y.excludeLocalPerk(i,Ca)}static searchPerks(s,a){return s.filter(r=>r.benefit.title.toLowerCase().includes(a.toLowerCase())||r.benefit.subtitle.toLowerCase().includes(a.toLowerCase()))}static classifyPerks(s){const a=ua();return s.forEach(r=>{const i=r.benefit.category;a[i].push(r)}),a.all=s,a}static findLocalPerk(s,a){const r=s.filter(i=>{var c;return(c=Je(i.benefit.url))==null?void 0:c.startsWith(a)});return r.length===0?void 0:r[0]}static excludeLocalPerk(s,a){return s.filter(i=>{var c;return!((c=Je(i.benefit.url))!=null&&c.startsWith(a))})}}const _e=new Y(ge);var Mt,Bt;function Pa(){return{loading:!1,featuredPerks:x,viewPerk:{isOpen:!1,perk:x},viewCategory:{isOpen:!1,category:x},categories:void 0,benefitsPlanHome:void 0}}let Sa=(Mt=fe({name:"home-page",resettable:!0,producerFn:be}),Mt(Bt=class extends nt{constructor(){super(Pa())}})||Bt);const K=new Sa;class Ia extends Be{constructor(s){super(s);h(this,"homePageState$",this.select(s=>s.featuredPerks));h(this,"viewPerkState$",this.select(s=>s.viewPerk));h(this,"viewCategoryState$",this.select(s=>s.viewCategory));h(this,"categoryState$",this.select(s=>s.categories));h(this,"benefitsPlanHomeState$",this.select(s=>s.benefitsPlanHome));this.store=s}}const X=new Ia(K),Ea=()=>({getViewPageState:()=>{const t=n=>{K.update(s=>{s.featuredPerks=C(n)}),ge.set(n.availableBenefits)};return _e.selectCached(()=>nn.getBenefitsAsync(),t)},getMarketplaceCategoryState:()=>{const t=n=>{K.update(s=>{s.categories=n})};return X.selectCached(()=>Aa(),t)},getBenefitsPlanHome:()=>{const t=n=>{K.update(s=>{s.benefitsPlanHome=n})};return X.selectCached(()=>ka(),t)},reloadViewPageState:()=>{ge.setHasCache(!1)},openPerk:t=>{K.update(n=>{n.viewCategory.isOpen=!1,n.viewPerk={isOpen:!0,perk:Ee(t)}})},closePerk:()=>{K.update(t=>{t.viewPerk.isOpen=!1})},openCategory:t=>{K.update(n=>{n.viewPerk.isOpen=!1,n.viewCategory={isOpen:!0,category:Ee(t)}})},closeCategory:()=>{K.update(t=>{t.viewCategory.isOpen=!1})}}),z=Ea(),bn="/benefits/app/assets/default_backdrop-fdd955b8.png",mt=t=>{const n=e(p,{children:[e("div",{className:"flex-shrink-0",children:e("img",{className:W(t.imageClassName??"h-48 w-full object-cover"),src:t.imageUrl,alt:""})}),e("div",{className:"flex-1 bg-white p-4 flex flex-col justify-between",children:t.children})]});return e("div",{onClick:t.onClick,className:W(t.className??"",t.onClick?"cursor-pointer":"","flex flex-col rounded-lg shadow-lg overflow-hidden"),children:t.externalLink?e("a",{href:t.externalLink,target:"_blank",rel:"noopener noreferrer",children:n}):n})},Ta=t=>wt.match(t.toLowerCase()).with("body",()=>"bg-pink-100 text-pink-800").with("life",()=>"bg-yellow-100 text-yellow-800").with("mind",()=>"bg-green-100 text-green-800").with("money",()=>"bg-blue-100 text-blue-800").with("work",()=>"bg-orange-100 text-orange-800").with(wt.__,()=>"bg-gray-100 text-gray-800").exhaustive(),ut=t=>{const n=Ta(t.name),s=t.size==="xs"?"text-xs":"text-sm";return e("div",{className:W(t.className??"","capitalize inline-flex items-center px-2 py-0.5 rounded font-medium",n,s),children:t.name})},yn=({perk:t,onClick:n,className:s})=>{var a;return e(mt,{className:s,imageUrl:((a=t.backdrop)==null?void 0:a.downloadUrl)??bn,onClick:n,children:e("div",{className:"flex-1 pt-2 pb-7 px-2",children:[e(ut,{className:"uiid-perk-tag",name:t.category}),e("div",{className:"block mt-2",children:[e("p",{className:"uiid-perk-item-title text-xl font-semibold text-gray-900",children:t.title}),e("p",{className:"uiid-perk-item-subtitle mt-1 text-sm text-gray-500",children:t.subtitle})]})]})})},vn=()=>e("div",{className:"flex flex-col animate-pulse shadow-lg rounded-lg overflow-hidden",children:[e("div",{className:"flex-shrink-0",children:e("div",{className:"h-48 bg-gray-300"})}),e("div",{className:"flex-1 bg-white p-6 pb-9 flex flex-col justify-between",children:e("div",{className:"flex-1",children:[e("div",{className:"h-6 bg-gray-300 rounded w-12"}),e("div",{className:"block mt-2",children:[e("div",{className:"h-4 mt-4 bg-gray-300 rounded w-1/2"}),e("div",{className:"h-4 mt-2 bg-gray-300 rounded w-3/4"})]})]})})]}),wn=()=>e(p,{children:[...Array(3).keys()].map((t,n)=>e(vn,{},n))}),La=()=>{const[t,n]=m(x),{service:s}=P();d(()=>{const i=[_e.perksOnStage$.subscribe(n)];return()=>{i.map(c=>c.unsubscribe())}},[]);const a=async i=>{z.openPerk(i),await s.trackExplorePerkViewedAsync(i)},r=S(t,[]).length>0?S(t,[]).map(i=>{const{benefit:c,benefitId:l}=i;return e(yn,{className:"uiid-explore-perk",perk:c,onClick:()=>a(i)},l)}):e(pn,{children:[e("p",{children:"Sorry, no entries were found matching your search request."}),e("p",{children:"Please try another search."})]});return e(hn,{className:"uiid-perks-grid",children:ie(t)?e(wn,{}):r})},Ra=()=>{const[t,n]=m(0),[s,a]=m("all"),{service:r}=P();d(()=>{(async()=>r.trackPerksListViewedAsync(s))();const c=[_e.all$.subscribe(l=>{n(l.length)}),_e.perksTab$.subscribe(a)];return()=>{c.map(l=>l.unsubscribe())}},[]),d(()=>()=>{ze.searchPerks("")},[]);const i=async c=>{ze.setTab(c),await r.trackPerksListViewedAsync(c)};return e("div",{className:"flex flex-col",style:{minHeight:window.innerHeight},children:[e("div",{className:"sm:flex sm:items-center sm:justify-between",children:[e("div",{className:"flex",children:[e("div",{className:"text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 text-gray-700",children:"Explore other perks"}),e("div",{className:"text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 text-gray-500 ml-2",children:["(",t,")"]})]}),e("div",{className:"mt-4 sm:mt-0",children:e(un,{onSearchEvent:async c=>{ze.searchPerks(c),c&&await r.trackPerksListSearched(c)}})})]}),e("div",{className:"mt-4",children:e(mn,{currentTab:s,onTabClicked:i})}),e("div",{className:"mt-6",children:e(La,{})})]})},Oa=t=>{const{perks:n}=t,[s,a]=m(!0),{service:r}=P();d(()=>{a(ie(n))},[n]);const i=l=>{z.openPerk(l),r.trackFeaturePerkViewedAsync(l)},c=S(n,[]).map(l=>{const{benefit:y,benefitId:u}=l;return e(yn,{className:"uiid-featured-perk",perk:y,onClick:()=>i(l)},u)});return e("div",{className:"flex flex-col",children:[e("div",{className:"text-2xl md:text-4xl font-bold md:font-extrabold leading-loose md:leading-10 text-gray-700",children:"Featured Perks"}),e("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-8 pt-6",children:s?e(wn,{}):c})]})},ht=({isOpen:t,fullWidthMobile:n,onClose:s,children:a})=>e(ke.Root,{show:t,as:p,children:e(xt,{as:"div",static:!0,className:"modal fixed z-40 inset-0 overflow-y-auto",open:t,onClose:s,children:e("div",{className:`flex items-center justify-center min-h-screen md:max-h-screen mt-auto text-center ${n?"w-screen md:w-auto md:p-4":"p-4"}`,children:[e(ke.Child,{as:p,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:e(xt.Overlay,{className:"fixed inset-0 bg-black bg-opacity-75 transition-opacity"})}),e("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:"​"}),e(ke.Child,{as:p,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:e("div",{className:`inline-block align-bottom transition-all md:align-middle bg-white text-left shadow-xl transform ${n?"mt-auto md:mb-auto md:rounded-lg overflow-visible":"rounded-lg overflow-hidden"}`,children:a})})]})})}),_a=t=>n=>!!n&&t(n),pt=t=>_a(t.test.bind(t)),gt=/^\+?(614|6104|04)([0-9]{2})([0-9]{3})([0-9]{3})$/,$a=/^[0-9]{6}$/,Ma=/^[0-9]*$/,xn=t=>{if(!t)return;const n=t.replace(/\s/g,""),s=t.replace(/\s/g,"").match(gt);return s==null?n:`04${s[2]} ${s[3]} ${s[4]}`},Ba=t=>{const n=t.replace(/\s/g,""),s=t.replace(/\s/g,"").match(gt);return s==null?n:`+614${s[2]}${s[3]}${s[4]}`},kn=pt(gt),Nn=pt($a),Ua=pt(Ma),Va=({formId:t,profile:n,categoryId:s,categoryName:a})=>{const{service:r}=P(),i=()=>{r.trackActivityCompletedAsync(s,s,a,"typeform")};let c={};return n&&(c={email:n.email,first_name:n.firstName,last_name:n.lastName,mobile:xn(n.mobilePhone),profile_id:n.profileId,account_id:n.accountId,partner_id:n.partnerId,customer_id:n.customerId,campaign_class:"Platform",campaign_source:"Flare",campaign_medium:"Web Benefits",campaign_name:"Benefits Assessment",skip_welcome:"true"}),e(Qn.Widget,{id:t,className:"mx-auto w-screen h-screen md:h-[40rem] md:w-[95vw] md:max-w-[70rem]",hidden:c,inlineOnMobile:!0,onSubmit:i})},Da=(t,n,s)=>{const a=st(de),r=$(a)?a.value.basicProfile:void 0,i=$(a)?a.value.accountName:void 0;let c={};switch(r&&(c={email:r.email,"first-name":r.firstName,"last-name":r.lastName,mobile:r.mobilePhone,"employer-name":i,"profile-id":r.profileId,"account-id":r.accountId,"partner-id":r.partnerId,"customer-id":r==null?void 0:r.customerId,"sf-class":"Platform","sf-source":"Flare","sf-medium":"Web Benefits","sf-name":"Benefits Assessment"}),s.component){case"cars-calculator-ungated":return e("div",{className:"md:p-1",children:e("cars-calculator",{"datadog-disabled":!0,...c,"backend-url":t,"hide-employer-name":!0})});case"cars-calculator-gated":return e("div",{className:"md:p-1",children:e("cars-calculator",{"datadog-disabled":!0,...c,"backend-url":t,"is-gated":!0,"hide-employer-name":!0})});case"typeform":return s.typeformId?e(Va,{formId:s.typeformId,profile:r,categoryId:n.id,categoryName:s.title}):e(p,{});default:return e(p,{})}},Fa=({category:t,landing:n,apolloBaseUrl:s})=>Da(s,t,n),$e=t=>{const n=Je(t.href);return e(p,{children:n?e("a",{className:t.className,onClick:t.onClick,href:`/benefits/app/#${n}`,children:t.children}):e("a",{href:t.href,className:t.className,onClick:t.onClick,target:"_blank",rel:"noopener noreferrer",children:t.children})})},Z=({url:t,children:n,className:s,type:a,disabled:r,onClick:i})=>{const c=`block w-full mx-auto md:w-auto md:ml-0 text-center px-4 py-2 border border-transparent shadow-sm
3
+ text-sm leading-6 font-semibold rounded-md text-white bg-primary disabled:bg-gray-100 disabled:border-gray-300 disabled:text-gray-400 ${s}`;return t?e($e,{className:c,href:t,onClick:i,children:n}):e("button",{type:a||"button",className:c,disabled:r,onClick:i,children:n})},Ha={renderText:t=>t.split(`
4
+ `).flatMap((n,s)=>[s>0&&e("br",{}),n]),renderNode:{[T.BLOCKS.PARAGRAPH]:(t,n)=>e("p",{className:"text-xs leading-4 font-normal text-gray-600",children:n}),[T.INLINES.HYPERLINK]:(t,n)=>e("a",{className:"text-blue-600",href:t.data.uri,target:"_blank",rel:"noopener noreferrer",children:n}),[T.BLOCKS.LIST_ITEM]:(t,n)=>le.documentToReactComponents(t,{renderNode:{[T.BLOCKS.PARAGRAPH]:(s,a)=>e("p",{className:"text-gray-600 leading-5 text-sm ",children:a}),[T.BLOCKS.LIST_ITEM]:(s,a)=>e("li",{className:"flex gap-2",children:[e(at,{className:"text-primary w-3 h-5",icon:Kt}),a]})}})}},ja=({body:t})=>e(p,{children:le.documentToReactComponents(t,Ha)}),Wa={renderText:t=>t.split(`
5
+ `).flatMap((n,s)=>[s>0&&e("br",{}),n]),renderNode:{[T.BLOCKS.HEADING_1]:(t,n)=>e("h1",{className:"text-2xl leading-8 font-bold pb-2",children:n}),[T.BLOCKS.PARAGRAPH]:(t,n)=>e("p",{className:"text-base leading-6 font-normal text-gray-600 pb-4",children:n}),[T.BLOCKS.UL_LIST]:(t,n)=>e("ul",{className:"py-4 px-3 md:px-8 rounded-lg border-gray-200 border-2 shadow-sm flex flex-col space-y-2 mb-4",children:n}),[T.BLOCKS.LIST_ITEM]:(t,n)=>le.documentToReactComponents(t,{renderNode:{[T.BLOCKS.PARAGRAPH]:(s,a)=>e("p",{className:"text-gray-600 leading-5 text-sm ",children:a}),[T.BLOCKS.LIST_ITEM]:(s,a)=>e("li",{className:"flex gap-2",children:[e(at,{className:"text-primary w-3 h-5",icon:Kt}),a]})}})}},za=({body:t})=>e(p,{children:le.documentToReactComponents(t,Wa)}),Ga=({data:t,onClick:n,onClose:s,onPrevious:a})=>{let r;return(t==null?void 0:t.component)==="shopify"?r=S(oe.getShopifyUrl(),"#"):(t==null?void 0:t.component)==="external-link"&&(t!=null&&t.externalUrl)&&(r=t==null?void 0:t.externalUrl),t?e("div",{className:a?"absolute md:relative bg-white rounded-lg":"rounded-lg",children:e("div",{className:"relative",children:[s&&e("div",{className:"absolute top-0 right-0 pt-2 md:pt-4 pr-4 z-30",children:e("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:s,children:[e("span",{className:"sr-only",children:"Close"}),e(Le,{className:"h-6 w-6 border-0","aria-hidden":"true"})]})}),a&&e("div",{className:"absolute top-0 left-0 pl-4 pt-4 md:pl-4 md:pt-5 lg:pl-16 lg:pt-8 xl:pl-20 xl:pt-12 z-30",children:e("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:a,children:e("span",{className:"inline-flex text-sm leading-5 font-medium text-gray-600",children:[e(Jn,{className:"h-5 w-5 border-0 mr-2","aria-hidden":"true"}),"Back"]})})}),e("div",{className:"w-full grid grid-cols-1 md:grid-cols-2 md:gap-10 lg:gap-14 xl:gap-16 p-0 md:p-10 lg:p-16 xl:p-20 md:relative",children:[t.heroImageDesktop&&e("img",{src:`${t.heroImageDesktop.fields.file.url}?fm=jpg&q=90&w=640&h=480`,className:"mx-auto w-full order-2 self-start hidden md:block"}),t.heroImageMobile&&e("img",{src:`${t.heroImageMobile.fields.file.url}?fm=jpg&q=90&w=640&h=480`,className:"mx-auto mt-10 w-full self-start block md:hidden"}),e("div",{className:"flex flex-col self-start p-4 md:p-0 md: mt-4",children:[e(za,{body:t.modalBody}),e(Z,{className:"mb-6",onClick:n,url:r,children:t.buttonText}),t.disclaimer&&e(ja,{body:t.disclaimer})]})]})]})}):e(p,{})},qa=({items:t,onClick:n})=>e("div",{className:"mx-auto w-screen md:h-auto md:w-[95vw] md:max-w-[70rem] lg:px-16 px-6 py-6 md:py-16",children:[e("h1",{className:"text-2xl leading-8 font-bold text-gray-600 text-center",children:"Offers available"}),e("div",{className:"w-full mx-auto flex flex-wrap items-stretch justify-center gap-8 gap-y-8 md:gap-x-24 py-10",children:t.map((s,a)=>e(mt,{imageUrl:s.imageUrl,className:"md:w-80 w-full",imageClassName:"md:h-32 w-full object-cover",children:[e("div",{children:[e("h2",{className:"text-lg font-bold text-gray-900 pb-0",children:s.title}),e("h3",{className:"text-sm text-gray-600 pb-2",children:s.subtitle}),e("div",{className:"flex pb-4",children:e("div",{className:"w-auto px-2 py-0.5 rounded text-xs font-medium bg-blue-100 text-blue-800",children:s.type})})]}),e(Z,{className:"md:w-full mx-0 mb-1",onClick:()=>n(s.id),children:s.buttonText})]},s.id))})]}),Ka=()=>{const[t,n]=m(!1),[s,a]=m(),[r,i]=m(),[c,l]=m("SELECTION"),y=J(null),u=J(null),v=J(null),{service:A}=P(),k=()=>{var N;return(N=y.current)==null?void 0:N.scrollIntoView({behavior:"smooth",block:"start"})},w=()=>{var N;return(N=u.current)==null?void 0:N.scrollIntoView({behavior:"smooth",block:"start"})},b=()=>{var N;return(N=v.current)==null?void 0:N.scrollIntoView({behavior:"smooth",block:"start"})},g=()=>c==="SELECTION",D=()=>c==="LANDING",o=()=>c==="ACTION",f=()=>{o()?w():(r==null?void 0:r.component)!=="shopify"&&(r==null?void 0:r.component)!=="external-link"&&l("ACTION"),r&&s&&A.trackActivityActionedAsync(s.id,r.id,r.title,r.component)},M=()=>{s&&A.trackCategoryClosedAsync(s.id,s.title,c),V("/")},F=N=>{const L=s==null?void 0:s.landings.filter(Fe=>Fe.title===N)[0];N===(r==null?void 0:r.title)?l("LANDING"):i(L),L&&s&&A.trackActivityStartedAsync(s.id,L.id,L.title,L.component)},q=()=>{l("SELECTION")};d(()=>{o()&&w(),D()&&b(),g()&&k()},[c,r]),d(()=>{r&&setTimeout(()=>l("LANDING"),100)},[r]),d(()=>{t&&s&&s.landings.length>0&&(s.landings.length===1?(i(s.landings[0]),l("LANDING")):l("SELECTION"))},[t,s]),d(()=>{t&&s&&A.trackCategoryOpenedAsync(s.id,s.title)},[s,t]),d(()=>{const N=[X.viewCategoryState$.subscribe(({isOpen:L,category:Fe})=>{const ce=ct(Fe);if(ce&&ce.landings.length>0)n(L),a(ce),i(void 0);else if(L)throw new Error("Category is not configured for view: "+(ce==null?void 0:ce.title))})];return()=>{N.map(L=>L.unsubscribe())}},[]);const bt=(s==null?void 0:s.landings.map(N=>{var L;return{title:N.displayTitle,id:N.title,subtitle:N.subtitle,buttonText:N.buttonText||"Learn more",type:"Advertisement",imageUrl:`${(L=N.tileImage)==null?void 0:L.fields.file.url}?fm=jpg&q=90&w=640&h=480`}}))||[],De=bt.length>1;return e(ht,{isOpen:t,fullWidthMobile:!0,onClose:M,children:e("div",{className:"w-screen md:w-auto md:max-w-[70rem] md:rounded-lg",children:[e("div",{className:`${t?"block":"hidden"} absolute top-0 right-0 pt-4 pr-4 z-30`,children:e("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:M,children:[e("span",{className:"sr-only",children:"Close"}),e(Le,{className:"h-6 w-6 border-0","aria-hidden":"true"})]})}),De&&e("div",{ref:y,className:g()?"md:grid":"md:hidden",children:e(qa,{items:bt,onClick:F})}),e("div",{ref:v,className:D()?"md:grid":"md:hidden",children:e(Ga,{data:r,onClick:f,onClose:De&&M||void 0,onPrevious:De&&q||void 0})}),e("div",{ref:u,className:`${o()?"block":"hidden"} h-screen md:h-auto absolute md:relative md:rounded-lg bg-white`,children:e("div",{className:"m-auto relative",children:[e("div",{className:"md:hidden absolute top-0 right-0 pt-4 pr-4 z-30",children:e("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:M,children:[e("span",{className:"sr-only",children:"Close"}),e(Le,{className:"h-6 w-6 border-0","aria-hidden":"true"})]})}),s&&r&&e(Fa,{apolloBaseUrl:B.getConfig().apolloBaseUrl,category:s,landing:r})]})})]})})},An="dd/MM/yyyy",Cn="hh:mm a",Ge="ccc d MMM",Ya="p",Qa=(t,n,s)=>{if(t.data.dateRange){const a=j(s,!1),r=j(new Date(t.data.dateRange.end),t.data.dateRange.allDay);switch(n){case"Upcoming":return t.type==="customEvent"&&a<=r;case"Past":return t.type==="customEvent"&&a>r;case"Library":return t.type==="eventTemplate"}}else switch(n){case"Library":return t.type==="eventTemplate"}return!1},si=(t,n)=>t.filter(s=>Qa(s,n,new Date)),j=(t,n)=>n?new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate(),0,0,0,0):new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0,0),ai=(t,n)=>{const s=new Date,a=gs(`${t} ${n||"12:00 AM"}`,`${An} ${Cn}`,s);return n?kt(a):(s.setUTCFullYear(a.getFullYear()),s.setUTCMonth(a.getMonth()),s.setUTCDate(a.getDate()),s.setUTCHours(0,0,0,0),kt(s))},ri=(t,n)=>({date:se(j(t,n),An),time:n?void 0:se(t,Cn)}),ii=(t,n,s)=>{if(!t.data.dateRange)return 1;if(!n.data.dateRange)return-1;if(t.data.dateRange&&n.data.dateRange){const a=j(new Date(t.data.dateRange.start),t.data.dateRange.allDay),r=j(new Date(n.data.dateRange.start),n.data.dateRange.allDay),i=a<r?-1:1;return s.filter==="Past"?i*-1:i}else return 0},Ja=(t,n,s)=>{const a=j(new Date(t),s),r=j(new Date(n),s),i=a.getTime()===r.getTime()?se(a,Ge):`${se(a,Ge)} - ${se(r,Ge)}`,c=s?"":`, ${se(new Date(t),Ya)}`;return`${i}${c}`},ci=(t,n)=>n?t?t.getMonth()!==n.getMonth()?Ut(t):void 0:"More":t?Ut(t):void 0,li=(t,n)=>t&&n?t.getFullYear()!==n.getFullYear()?t.getFullYear().toString():void 0:t==null?void 0:t.getFullYear().toString(),oi=(t,n,s)=>{const a=t[n],r=t[n-1];if(n===0){if(a.data.dateRange){const i=j(new Date(a.data.dateRange.start),a.data.dateRange.allDay);return s(i,void 0)}}else if(r.data.dateRange){const i=j(new Date(r.data.dateRange.start),r.data.dateRange.allDay);if(a.data.dateRange){const c=j(new Date(a.data.dateRange.start),a.data.dateRange.allDay);return s(c,i)}else return s(void 0,i)}},Ut=t=>t.toLocaleString("default",{month:"long"})+" "+(t==null?void 0:t.getFullYear().toString()),Xa=({actionButton:t,item:n,itemId:s,onClose:a})=>{var c,l;const r=((c=n.backdrop)==null?void 0:c.downloadUrl)??bn,i=(l=n.icon)==null?void 0:l.downloadUrl;return e("div",{className:"uiid-perk-details md:w-160 first-letter:overflow-hidden",children:[e("div",{className:"absolute top-0 right-0 pt-4 pr-4 z-30",children:e("button",{type:"button",className:"uiid-perk-details-close-button focus:outline-none bg-white rounded-md text-gray-500",onClick:a,children:[e("span",{className:"sr-only",children:"Close"}),e(zt,{className:"h-6 w-6 border-0","aria-hidden":"true"})]})}),t&&e("div",{className:"absolute top-0 left-0 pt-4 pl-4 z-30",children:t}),e("div",{className:"relative bg-cover bg-center",style:`background-image: url(${r})`,children:[e("div",{className:"absolute inset-0 bg-gradient-to-t from-black opacity-90"}),e("div",{className:"relative flex items-end py-4 px-8 h-64",children:e("div",{className:"flex items-center",children:[!n.dateRange&&e("div",{className:"h-24 w-24 flex-shrink-0",children:e("div",{className:"bg-gray-200 rounded-lg",children:i?e("img",{className:"h-24 w-24 object-contain rounded-lg",src:i,alt:""}):e("div",{className:"h-24 w-24 rounded-lg text-gray-800 grid",children:e("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-12 w-12 place-self-center",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M12 8v13m0-13V6a2 2 0 112 2h-2zm0 0V5.5A2.5 2.5 0 109.5 8H12zm-7 4h14M5 12a2 2 0 110-4h14a2 2 0 110 4M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"})})})})}),e("div",{className:`text-white ${n.dateRange?"":"pl-4"}`,children:[e("div",{className:"uiid-perk-details-title text-xl leading-6 md:text-3xl md:leading-9 font-extrabold",children:n.title}),e("div",{className:"relative text-sm leading-4 md:text-base md:leading-6 font-medium",children:[n.dateRange?Ja(n.dateRange.start,n.dateRange.end,n.dateRange.allDay):n.subtitle,n.dateRange&&n.location&&e(p,{children:[e("span",{className:"pipe pipe-white pipe-medium mx-3"}),e("span",{children:n.location})]})]}),e(ut,{className:"uiid-perk-details-tag",name:n.category,size:"xs"})]})]})})]}),e("div",{className:"flex flex-col p-8",children:[e("div",{className:"flex-grow",children:[n.dateRange&&e("p",{className:"text-lg leading-8 font-semibold mb-4",children:n.subtitle}),e("p",{className:"whitespace-pre-wrap",children:n.description}),n.linkLabel&&n.url&&e($e,{href:n.url,onClick:()=>s&&Ze.trackPerkVisitedAsync({benefit:n,benefitId:s}),className:"w-auto mt-6 inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 text-sm leading-5 font-medium",children:n.linkLabel})]}),n.attachments&&n.attachments.length>0&&e("div",{className:"border border-gray-200 rounded-md mt-8",children:e("div",{className:"pl-3 pr-4 py-3 flex items-center justify-between text-sm",children:[e("div",{className:"w-0 flex-1 flex items-center",children:[e(Xn,{className:"flex-shrink-0 h-5 w-5 text-gray-400","aria-hidden":"true"}),e("span",{className:"ml-2 flex-1 w-0 truncate",children:n.attachments[0].title})]}),e("div",{className:"ml-4 flex-shrink-0",children:e("a",{href:n.attachments[0].downloadUrl,target:"_blank",className:"font-medium text-primary",onClick:()=>s&&Ze.trackDocumentClickedAsync({benefit:n,benefitId:s}),children:"View"})})]})})]})]})},Za=()=>{const[t,n]=m(!1),[s,a]=m(x);d(()=>{const i=[X.viewPerkState$.subscribe(({isOpen:c,perk:l})=>{n(c),a(l)})];return()=>{i.map(c=>c.unsubscribe())}},[]);const r=ct(s);return r?e(ht,{isOpen:t,onClose:z.closePerk,children:e(Xa,{item:r.benefit,itemId:r.benefitId,onClose:z.closePerk})}):e("div",{})},qe=({category:t})=>{const n=ye.useContext(de),[s,a]=m(x),[r,i]=m(),[c,l]=m();Ks();const{service:y}=P();d(()=>{y.trackBenefitsOpenedAsync()},[]),d(()=>{const b=[X.homePageState$.subscribe(g=>{a(g)}),X.categoryState$.subscribe(g=>{i(g)}),X.benefitsPlanHomeState$.subscribe(g=>{l(g)}),z.getViewPageState().subscribe(),z.getMarketplaceCategoryState().subscribe(),z.getBenefitsPlanHome().subscribe()];return()=>{b.map(g=>g.unsubscribe())}},[]),d(()=>{const b=r==null?void 0:r.find(g=>g.title.toLocaleLowerCase()===(t==null?void 0:t.toLocaleLowerCase()));b?z.openCategory(b):z.closeCategory()},[r,t]);const u=Ie.pipe(s,Zn(b=>b.promotedBenefits)),v=Ie.pipe(u,Ue(()=>!1,b=>b.length>0)),A=cn.isPba(),{getTreatment:k}=Gs(),w=k(Jt.FlareApp);return e(p,{children:[!A&&e(lt,{user:n}),e("div",{className:"max-w-[90rem] min-w-5xl mx-auto py-8 px-4 sm:px-6 lg:px-8",children:[w&&e("div",{className:"md:mb-16 mb-5",children:e(Zs,{})}),(!r||r.length>0&&c)&&e("div",{className:"md:mb-16 mb-5",children:e(ra,{categories:r,content:c})}),v&&e("div",{className:"md:mb-16 mb-5",children:e(Oa,{perks:u})}),e("div",{children:e(Ra,{})})]}),e(Za,{}),e(Ka,{})]})};var Vt,Dt;const er=()=>({all:[],money:[],mind:[],body:[],work:[],life:[]}),tr=()=>({currentTab:"all",searchString:""});let nr=(Vt=fe({name:"explore-wellbeing",cache:{ttl:"3600000"},resettable:!0,producerFn:be}),Vt(Dt=class extends Gt{constructor(){super(tr())}})||Dt);const Se=new nr;class Me extends qt{constructor(s){super(s);h(this,"currentTab$",this.select(s=>s.currentTab));h(this,"previewsOnStage$",Ne([this.selectAll(),this.select(s=>s.searchString),this.select(s=>s.currentTab)]).pipe(Ae(([s,a,r])=>this.getHasCache()?Q.fromNullable(Me.filterPreviews(s,a,r)):x)));this.store=s}get isPreviewsLoaded(){var s;return(((s=this.getValue().ids)==null?void 0:s.length)??0)>0}static filterPreviews(s,a,r){return Me.searchPreviews(s,a).filter(i=>r==="all"||i.pillar===r)}static searchPreviews(s,a){return s.filter(r=>r.title.toLowerCase().includes(a.toLowerCase())||r.subtitle.toLowerCase().includes(a.toLowerCase()))}static classifyPreviews(s){const a=er();return s.forEach(r=>{const i=r.pillar;a[i].push(r)}),a.all=s,a}}const ft=new Me(Se),sr=()=>({setTab:t=>{Se.update(n=>{n.currentTab=t})},searchPreviews:t=>{Se.update(n=>{n.searchString=t,n.currentTab="all"})},loadEntryPreviews:()=>ft.selectCached(()=>ve.loadAvailableEntryPreviewsAsync(),t=>Se.set(t))}),ue=sr(),ar=()=>e(p,{children:[...Array(3).keys()].map((t,n)=>e(vn,{},n))}),rr=()=>{const[t,n]=m(x),{service:s}=P();d(()=>{const i=[ft.previewsOnStage$.subscribe(n)];return()=>{i.map(c=>c.unsubscribe())}},[]);const a=async i=>{i.externalLink||V(`/wellbeing-hub/articles/${i.slug}`),s.trackEntryViewed({contentId:i.id,contentTitle:i.slug,contentType:i.primaryContentType,contentPillar:i.pillar})},r=S(t,[]).length>0?S(t,[]).map(i=>e(mt,{className:"uiid-preview-item",imageUrl:`${i.coverPhotoUrl}?fm=jpg&q=50&w=640&h=480`,externalLink:i.externalLink,onClick:()=>a(i),children:e("div",{className:"flex-1 pb-7 pt-2 px-2",children:[e("div",{className:"flex items-center",children:[e(ut,{className:"uiid-preview-tag",name:i.pillar}),e("div",{className:"text-sm leading-5 font-normal px-2 text-gray-300",children:"|"}),e("div",{className:"text-xs leading-4 font-semibold tracking-wider uppercase text-gray-400",children:i.primaryContentType}),e("div",{className:"flex-grow"}),i.externalLink&&e(es,{className:"h-5 w-5 text-gray-400 border-0"})]}),e("div",{className:"block mt-2",children:[e("p",{className:"uiid-preview-item-title text-xl font-semibold text-gray-900",children:i.title}),e("p",{className:"uiid-preview-item-subtitle mt-1 text-sm text-gray-500",children:i.subtitle})]})]})},i.id)):e(pn,{children:[e("p",{children:"Sorry, no entries were found matching your search request."}),e("p",{children:"Please try another search."})]});return e(hn,{className:"uiid-preview-grid",children:ie(t)?e(ar,{}):r})},ir=()=>{const[t,n]=m("all"),{service:s}=P();d(()=>{const i=[ft.currentTab$.subscribe(n),ue.loadEntryPreviews().subscribe()];return()=>{i.map(c=>c.unsubscribe())}},[]),d(()=>()=>{ue.searchPreviews("")},[]);const a=async i=>{ue.setTab(i),V(`/wellbeing-hub/${i}`),s.trackEntriesListViewedAsync(i)},r=async i=>{ue.searchPreviews(i),s.trackEntriesListSearchedAsync(i)};return e("div",{className:"flex flex-col",style:{minHeight:window.innerHeight},children:[e("div",{className:"sm:flex sm:items-center sm:justify-between",children:[e("div",{className:"flex",children:e("div",{className:"text-3xl leading-9 font-semibold text-gray-700",children:"Explore the 5 pillars of wellness"})}),e("div",{className:"mt-4 sm:mt-0",children:e(un,{onSearchEvent:r})})]}),e("div",{className:"mt-4",children:e(mn,{currentTab:t,onTabClicked:a})}),e("div",{className:"mt-6",children:e(rr,{})})]})},cr="/benefits/app/assets/wellbeing_banner-6903d615.png",lr=({children:t})=>e("div",{className:"relative filter inline-flex items-center w-12 h-12 rounded-lg text-md font-medium bg-black bg-opacity-40 text-gray-800",children:[e("div",{className:"absolute inset-0 rounded-lg bg-gradient-to-b from-black bg-opacity-50"}),e("div",{className:"relative h-full w-full flex flex-wrap content-center justify-center",children:t})]}),or=()=>e("div",{className:"flex gap-4",children:Re.map(t=>e(lr,{children:e("div",{className:on[t],children:dn(t)})}))}),dr=()=>e(ln,{className:"h-full",bgImageUrl:cr,children:e("div",{className:"px-4 py-10 md:px-8 md:py-24 text-white",children:[e("div",{className:"text-2xl leading-8 font-bold",children:"Wellbeing Hub"}),e("div",{className:"max-w-sm text-md md:text-lg leading-6 mt-1 font-medium hidden md:block",children:"Providing education, support and tools to help you live a healthier and happier life!"}),e("div",{className:"pt-4 hidden md:block",children:e(or,{})})]})}),Ft=({pillarFilter:t})=>{const n=J(null),{service:s}=P();return d(()=>{s.trackWellbeingOpenedAsync()},[]),d(()=>{var a;ue.setTab(t??"all"),s.trackEntriesListViewedAsync(t??"all"),t&&((a=n.current)==null||a.scrollIntoView({behavior:"smooth"}))},[t,n]),e("div",{className:"max-w-7xl min-w-5xl mx-auto px-4 py-8 sm:px-6 lg:px-8 mb-20",children:[e("div",{className:"flex flex-col md:flex-row",children:e("div",{className:"w-full",children:e(dr,{})})}),e("div",{className:"mt-8 pt-4",ref:n,children:e(ir,{})})]})},mr=({pages:t,homePageUrl:n})=>e("nav",{className:"bg-white border-b border-gray-200 flex","aria-label":"Breadcrumb",children:e("ol",{role:"list",className:"max-w-screen-xl w-full mx-auto px-4 flex space-x-4 sm:px-6 lg:px-8",children:[e("li",{className:"flex",children:e("div",{className:"flex items-center",children:e("a",{href:n??"#",className:"text-gray-400 hover:text-gray-500",children:[e(ts,{className:"flex-shrink-0 h-5 w-5","aria-hidden":"true"}),e("span",{className:"sr-only",children:"Home"})]})})}),t.map((s,a)=>e("li",{className:"flex",children:e("div",{className:"flex items-center",children:[e("svg",{className:"flex-shrink-0 w-6 h-full text-gray-200",viewBox:"0 0 24 44",preserveAspectRatio:"none",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:e("path",{d:"M.293 0l22 22-22 22h1.414l22-22-22-22H.293z"})}),e("a",{href:s.href,className:"ml-4 text-sm font-medium text-gray-500 hover:text-gray-700","aria-current":t.length===a+1?"page":void 0,children:s.name})]})},s.name))]})}),ur=(t,n,s)=>{d(()=>{let a=!0;return t(()=>a),()=>{a=!1,Ie.pipe(n,Ue(()=>{},r=>r()))}},s)},hr=(t,n)=>{d(()=>{window.scrollTo(t)},n)},pr=(t,n)=>{hr({top:0,...t},n)},gr={renderNode:{[T.BLOCKS.EMBEDDED_ASSET]:t=>{const{title:n,description:s,file:a}=t.data.target.fields;return e("figure",{children:[e("img",{src:`${a.url}?fm=jpg&q=90&w=640&h=480`,alt:n}),e("figcaption",{children:s})]})}}},fr=({body:t})=>e("article",{className:"prose prose-lg prose-indigo",children:le.documentToReactComponents(t,gr)}),br=()=>e("div",{className:"max-w-3xl mx-auto py-6 px-4 sm:py-10 sm:px-6 lg:px-8 animate-pulse",children:[e("div",{class:"h-8 bg-gray-200 rounded w-2/3"}),e("div",{className:"flex space-x-3 mt-4",children:[e("div",{className:"flex-shrink-0",children:e("div",{class:"rounded-full bg-gray-200 h-10 w-10 mr-1"})}),e("div",{className:"min-w-0 flex flex-col justify-between flex-1",children:[e("div",{class:"h-4 bg-gray-200 rounded w-1/3"}),e("div",{class:"h-4 bg-gray-200 rounded w-1/4"})]})]}),e("div",{className:"mt-8",children:e("div",{class:"flex-1 space-y-8 py-1",children:[e("div",{class:"h-8 bg-gray-200 rounded w-3/4"}),e("div",{class:"h-48 bg-gray-200 rounded w-full"}),e("div",{class:"h-24 bg-gray-200 rounded w-3/4"}),e("div",{class:"h-36 bg-gray-200 rounded w-full"}),e("div",{class:"h-12 bg-gray-200 rounded w-1/4"})]})})]}),yr=({articleSlug:t})=>{const[n,s]=m();if(ur(async r=>{const i=await dt(ve.loadArticleAsync(t),700);r()&&s(i)},Q.none,[t]),pr(),!n)return e(Nt.div,{initial:{opacity:0},animate:{opacity:1},children:e(br,{})},"loading");const a=[{name:n==null?void 0:n.pillar,href:`#/wellbeing-hub/${n==null?void 0:n.pillar.toLowerCase()}`}];return e(p,{children:[e(mr,{pages:a,homePageUrl:"#/wellbeing-hub"}),e(Nt.div,{initial:{opacity:0},animate:{opacity:1},children:e("div",{className:"max-w-3xl mx-auto py-6 px-4 sm:py-10 sm:px-6 lg:px-8",children:[e("h2",{className:"text-4xl leading-10 font-extrabold tracking-tight",children:n.title}),e("div",{className:"flex space-x-3 mt-4",children:[e("div",{className:"flex-shrink-0",children:e("img",{className:"h-10 w-10 rounded-full",src:`${n.author.fields.avatar.fields.file.url}?fm=jpg&q=90&w=640&h=480`,alt:""})}),e("div",{className:"min-w-0 flex-1",children:[e("p",{className:"text-sm font-medium text-gray-900",children:n.author.fields.name}),e("p",{className:"text-sm text-gray-500",children:se(new Date(n.originalPublicationDate),"dd MMM yyyy")})]})]}),e("div",{className:"mt-8",children:e(fr,{body:n.articleBody})})]})},"article")]})},vr=()=>{const t=ye.useContext(de),n=cn.isPba();return e(p,{children:[!n&&e(lt,{user:t}),e(rt,{history:ot(it()),children:[e(_,{path:"/wellbeing-hub",component:Ft}),e(_,{path:"/wellbeing-hub/:pillarFilter",component:Ft}),e(_,{path:"/wellbeing-hub/articles/:articleSlug",component:yr})]})]})};var Pn=(t=>(t.Auth_AccountDisabled="Sorry, your account has been deactivated. Please contact Flare if there are any issues.",t.Auth_AccountLocked="Sorry, your account is currently locked due to too many attempts. Please try again later.",t.Auth_Unregistered="Sorry, we are currently experiencing some issues. Please try again later.",t.Auth_InvalidVerificationCode="Your one time passcode doesn't look right. Please try again.",t.Auth_SessionExpired="Sorry, looks like your session has expired. Please try again.",t.Validation_InvalidPhoneNumber="Please enter a valid Australian mobile number beginning with 04.",t))(Pn||{});const Sn="Sorry, we are currently experiencing some issues. Please try again later.",wr=t=>t&&Pn[t]||Sn,xr="/benefits-onboarding/backend/auth/signup",kr="/benefits-onboarding/backend/auth/verify",Nr="/benefits-onboarding/backend/auth/resend",O=t=>{const n=t.json;throw new Error(wr(n==null?void 0:n.code))};class Ar{signUpAsync(n){return re.instance.url(xr).post(n).internalError(O).badRequest(O).unauthorized(O).fetchError(O).res()}verifyAsync(n){return re.instance.url(kr).post(n).internalError(O).badRequest(O).unauthorized(O).fetchError(O).res()}resendAsync(){return re.instance.url(Nr).post().internalError(O).badRequest(O).unauthorized(O).fetchError(O).res()}}const Ke=new Ar,Cr="/benefits/app/assets/check-57fe1dcb.svg",Pr=t=>e("div",{className:"h-96 grid",children:[e("div",{className:"grid place-self-center",children:[e("div",{className:"bg-[#EAF0FE] w-16 h-16 rounded-lg flex items-center justify-center mx-auto mb-10",children:e("img",{className:"w-10",src:Cr})}),e("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3",children:"You’re all set!"}),e("p",{className:"px-8 text-base leading-6 font-normal text-gray-500",children:"Your benefits plan and exclusive offers are waiting for you."})]}),e(Z,{className:"md:w-full md:text-base py-3 place-self-end",onClick:t.onComplete,children:"Start exploring your benefits"})]}),Sr="/benefits/app/assets/warning-a7f1af23.svg",Ir=t=>e("div",{className:"h-96 grid",children:[e("div",{className:"grid place-self-center",children:[e("div",{className:"bg-[#FEE2E2] w-16 h-16 rounded-lg flex items-center justify-center mx-auto mb-10",children:e("img",{className:"w-10",src:Sr})}),e("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3",children:"Something went wrong"}),e("p",{className:"px-8 text-base leading-6 font-normal text-gray-500",children:"We’re having some technical difficulties at the moment. Click the button below to proceed to your benefits."})]}),e(Z,{className:"md:w-full md:text-base py-3 place-self-end",onClick:t.onError,children:"Dismiss"})]}),Er="/benefits/app/assets/suitcase-6471ad05.svg",Tr=ns(({label:t,id:n,type:s,placeholder:a,setPlaceholderOnFocus:r,value:i,className:c,onChange:l,onBlur:y,error:u},v)=>{const A=b=>{b.target instanceof HTMLInputElement&&l(b.target.value.trim())},k=b=>{b.target instanceof HTMLInputElement&&y&&y(b.target.value.trim())},w=()=>{a&&r&&!(i!=null&&i.trim())&&l(a)};return e("div",{className:c,children:[e("label",{htmlFor:n,className:"block text-sm font-medium leading-5 text-gray-900 text-left",children:t}),e("div",{className:"mt-1",children:e("input",{className:"block min-h-[2.25rem] w-full rounded-md border-0 py-1.5 pr-20 text-gray-900 ring-1 ring-inset placeholder:text-gray-400 focus:ring-2 focus:ring-inset text-base sm:text-sm sm:leading-6 ring-gray-300 focus:ring-primary-600",type:s,value:i,name:n,id:n,placeholder:a,onChange:A,onBlur:k,onFocus:w,ref:v})}),u&&e("p",{className:"my-2 text-sm text-red-600 text-left",children:u})]})}),Lr=t=>{const n=s=>{s.preventDefault(),t.onSubmit()};return e(p,{children:[e("div",{className:"bg-[#EAF0FE] w-16 h-16 rounded-lg flex items-center justify-center mx-auto mb-10",children:e("img",{className:"w-10",src:Er})}),e("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3",children:"Confirm your employment"}),e("p",{className:"text-base leading-6 font-normal text-gray-500 mb-6",children:"Your employer has partnered with Flare to provide you access to exclusive benefits. Add your personal mobile number to verify your identity."}),e("form",{onSubmit:n,children:[e(Tr,{type:"text",value:t.mobileNumber,label:"Australian Mobile Number",id:"mobile",placeholder:"04",setPlaceholderOnFocus:!0,onChange:t.onChange,error:t.errorMessage}),e(Z,{className:"md:w-full md:text-base py-3 mt-10",type:"submit",disabled:!kn(t.mobileNumber.replace(/\s/g,"")),children:"Continue"})]})]})},Rr="/benefits/app/assets/padlock-8c081120.svg",Or=t=>{const[n,s]=m(t),a=J(),r=pe(()=>{a.current&&clearInterval(a.current)},[]);d(()=>r,[r]);const i=pe(()=>{let c=t;a.current&&clearInterval(a.current),a.current=setInterval(()=>{if(c<0){a.current&&clearInterval(a.current);return}s(c--)},1e3)},[t]);return{countdown:n,restart:i}},_r=({value:t="",numInputs:n=6,onChange:s})=>{const[a,r]=m(0),i=J([]),c=()=>t?t.toString().split(""):[];d(()=>{i.current=i.current.slice(0,n)},[n]),d(()=>{var o;(o=i.current[0])==null||o.focus()},[]);const l=o=>o===""||!isNaN(Number(o)),y=o=>{const f=o.join("");s(f)},u=o=>{const f=c();f[a]=o[0]||"",y(f)},v=o=>{var M,F;const f=Math.max(Math.min(n-1,o),0);i.current[f]&&((M=i.current[f])==null||M.focus(),(F=i.current[f])==null||F.select(),r(f))},A=o=>{const{value:f}=o.target;l(f)&&(u(f),v(a+1))},k=o=>{const{value:f}=o.target;l(f)||f.length===n&&(f.split("").some(F=>!l(F))||(y(f.split("")),v(n-1)))},w=o=>f=>{r(f),o.target.select()},b=()=>{r(a-1)},g=o=>{const f=c();[o.code,o.key].includes("Backspace")?(o.preventDefault(),u(""),v(a-1)):o.code==="Delete"?(o.preventDefault(),u("")):o.code==="ArrowLeft"?(o.preventDefault(),v(a-1)):o.code==="ArrowRight"||o.key===f[a]?(o.preventDefault(),v(a+1)):(o.code==="Spacebar"||o.code==="Space"||o.code==="ArrowUp"||o.code==="ArrowDown")&&o.preventDefault()},D=o=>{o.preventDefault();const f=c();let M=a;const F=o.clipboardData.getData("text/plain").slice(0,n-a).split("");if(!F.some(q=>isNaN(Number(q)))){for(let q=0;q<n;++q)q>=a&&F.length>0&&(f[q]=F.shift()??"",M++);v(M),y(f)}};return e("div",{className:"inline-flex gap-2",children:Array.from({length:n},(o,f)=>f).map(o=>e(p,{children:e("input",{className:"border-gray-300 caret-transparent selection:bg-transparent rounded-lg col-span-1 text-center w-10 h-12 text-xl leading-7 font-normal",value:c()[o]??"",ref:f=>i.current[o]=f,onChange:A,onFocus:f=>w(f)(o),onBlur:b,onKeyDown:g,onPaste:D,autoComplete:"off",type:"text",inputMode:"numeric",onInput:k,"aria-label":"One Time Password"})},o))})},$r=t=>{const{countdown:n,restart:s}=Or(60);d(s,[s]);const a=c=>{c.preventDefault(),t.onSubmit()},r=()=>{s(),t.onResend()},i=xn(t.mobileNumber);return e(p,{children:[e("div",{className:"bg-[#EAF0FE] w-16 h-16 rounded-lg flex items-center justify-center mx-auto mb-7",children:e("img",{className:"w-10",src:Rr})}),e("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3",children:"Verify your mobile number"}),i&&e("p",{className:"px-14 text-base leading-6 font-normal text-gray-500 mb-6",children:["An SMS verification code has been sent to the number"," ",e("span",{className:"whitespace-nowrap",children:i})]}),e("form",{onSubmit:a,children:[e(_r,{value:t.otp,numInputs:6,onChange:t.onChange}),e("p",{className:"mt-2 text-center text-xs text-gray-600 disabled:opacity-75 ",children:["Didn't get the code?",e("button",{type:"button",disabled:n!==0,className:"underline mx-2 text-primary disabled:text-gray-600 disabled:hover:bg-transparent disabled:cursor-text disabled:px-0",onClick:r,children:"Resend SMS"}),n!==0&&e(p,{children:["in ",n," secs"]})]}),e("p",{className:"my-2 text-sm text-red-600 text-center",children:t.errorMessage||""}),e(Z,{className:"md:w-full md:text-base py-3 mt-7",type:"submit",disabled:!Nn(t.otp),children:"Continue"}),e(Z,{className:"inline md:w-full md:text-base py-3 mt-4 bg-white !border-gray-300 !text-gray-600",onClick:t.onBack,children:[e(ss,{className:"inline-flex h-4 w-4 mr-2"}),"Back"]})]})]})},Ht={source:"WebBenefits",channel:"web"},Mr=t=>{const[n,s]=m("Loading"),[a,r]=m(),[i,c]=m(),[l,y]=m(),{service:u}=P();d(()=>{var g,D;(g=t.config)!=null&&g.isEstablished?s("Complete"):((D=t.config)==null?void 0:D.identityProvider)==="flare-app-identity"?(s("Signup"),u.trackRegistrationStartedAsync()):(s("Error"),u.trackRegistrationErrorViewedAsync("InitialConfigError"))},[]);const v=async()=>{if(r(""),i&&kn(i.replace(/\s/g,"")))try{s("Loading"),y(void 0),await Ke.signUpAsync({mobileNumber:Ba(i),...Ht}),s("Verify"),u.trackRegistrationSubmittedAsync()}catch{s("Error"),u.trackRegistrationErrorViewedAsync("SignupError")}},A=async()=>{if(r(""),l&&Nn(l))try{s("Loading"),await Ke.verifyAsync({otp:l,...Ht}),s("Complete"),u.trackRegistrationVerifiedAsync()}catch(g){s("Verify"),g instanceof Error&&g.message&&g.message!==Sn?(r(g.message),u.trackRegistrationFailedAsync(g.message)):(s("Error"),u.trackRegistrationFailedAsync("InternalError"),u.trackRegistrationErrorViewedAsync("VerificationError"))}},k=async()=>{r("");try{y(void 0),u.trackRegistrationResentAsync(),await Ke.resendAsync()}catch{s("Error"),u.trackRegistrationErrorViewedAsync("ResendError")}},w=()=>{t.onComplete(),u.trackRegistrationCompletedAsync()},b=()=>{t.onError(),u.trackRegistrationErrorDismissedAsync()};return e("div",{className:"min-h-[25rem]",children:[n==="Loading"&&e("div",{className:"flex items-center justify-center h-96 text-primary",children:[e("span",{className:"sr-only",children:"Loading"}),e(Yt,{size:10})]}),n==="Signup"&&e(Lr,{onSubmit:v,onChange:g=>{c(g),r("")},mobileNumber:i||"",errorMessage:a}),n==="Verify"&&e($r,{onSubmit:A,onBack:()=>s("Signup"),onResend:k,onChange:g=>{(!g||Ua(g))&&y(g),r("")},mobileNumber:i,otp:l,errorMessage:a}),n==="Complete"&&e(Pr,{onComplete:w}),n==="Error"&&e(Ir,{onError:b})]})},Br="/benefits/app/assets/welcome_image_mobile-dbde6c80.png",Ur="/benefits/app/assets/welcome_image_v2-869c59e4.png",Vr=({hasNextStep:t,onClick:n})=>{const{service:s}=P();d(()=>{s.trackConsentStartedAsync()},[]);const a=()=>{s.trackConsentCompletedAsync(),n()},r=t?"Get started":"Start exploring your benefits";return e("div",{children:[e("div",{className:"min-h-[12rem] items-center hidden md:flex",children:e("img",{className:"mx-auto align-middle w-[30rem]",src:Ur})}),e("div",{className:"min-h-[8rem] flex items-center md:hidden",children:e("img",{className:"mx-auto align-middle w-[30rem]",src:Br})}),e("h1",{className:"text-3xl leading-9 font-bold text-gray-900 font-sans mb-3 mt-4",children:[e("span",{className:"w-full block",children:"Welcome to your"}),e("span",{className:"w-full block",children:"workplace benefits"})]}),e("p",{className:"text-base leading-6 font-normal text-gray-500 mb-6",children:"Get access to savings and perks from Australia’s most-loved brands, plus special offers to help you save on bigger expenses like household utilities, health insurance and more."}),e(Z,{className:"md:w-full md:text-base py-3 mb-6 focus:outline-none",onClick:a,children:r}),e("p",{className:"text-xs leading-4 font-normal text-gray-500 mb-0",children:["By clicking “",r,"” you accept the"," ",e($e,{className:"text-primary underline",href:"https://www.flarehr.com/flare-app-terms-and-conditions",children:"Terms & Conditions"})," ","and acknowledge and consent to your data being processed in accordance with Flare's"," ",e($e,{className:"text-primary underline",href:"https://www.flarehr.com/privacy-policy",children:"Privacy Policy"}),"."]})]})},Dr=({userProfile:t,isCategoryOpen:n})=>{var g;const[s,a]=m(!1),[r,i]=m(!1),[c,l]=m("Consent"),{treatments:y,isReady:u}=hs({names:[ae.Consent,ae.CustomerRegistration]}),v=Te(()=>{var D;return s&&((D=t==null?void 0:t.workplaceLinkConfig)==null?void 0:D.isEstablished)===!1},[s,(g=t==null?void 0:t.workplaceLinkConfig)==null?void 0:g.isEstablished]),A=Te(()=>r&&((t==null?void 0:t.benefitsProfile.hasConsent)===!1||v)&&!n,[r,t==null?void 0:t.benefitsProfile.hasConsent,n,v]);d(()=>oe.updateIsWelcomeModalOpen(A),[A]),d(()=>{(async()=>await te.setWorkplaceLinkConfig())()},[]),d(()=>{u&&(i(y[ae.Consent].treatment=="on"),a(y[ae.CustomerRegistration].treatment=="on"))},[u,y]);const k=()=>{t!=null&&t.benefitsProfile.hasConsent||te.saveUserConsent(),v&&l("WorkplaceLink")},w=()=>{te.updateCustomerIdAsync(),te.setIsEstablished()},b=()=>{te.setIsEstablished()};return e(p,{children:e(ht,{isOpen:A,fullWidthMobile:!0,onClose:()=>({}),children:e("div",{className:"p-8 md:p-16 text-center md:w-[35rem] w-screen",children:[c==="Consent"&&e(Vr,{onClick:k,hasNextStep:v}),c==="WorkplaceLink"&&e(Mr,{onComplete:w,onError:b,config:t==null?void 0:t.workplaceLinkConfig})]})})})},Ye=()=>{const[t,n]=m(),[s,a]=m();return d(()=>{const r=[G.signedInUser$.subscribe(i=>{$(i)?n(i.value):n(void 0)}),X.viewCategoryState$.subscribe(({isOpen:i})=>{a(i)})];return()=>{r.map(i=>i.unsubscribe())}},[]),e(p,{children:[e(rt,{history:ot(it()),children:[e(_,{path:"/",component:qe}),e(_,{path:"/categories/:category",component:qe}),e(_,{path:"/wellbeing-hub/:subroute*",component:vr}),e(_,{default:!0,component:qe})]}),e(Dr,{userProfile:t,isCategoryOpen:!!s})]})},In=t=>{analytics.identify(t.basicProfile.profileId,{profile:t.basicProfile.profileId,account:t.basicProfile.accountId,partner:t.basicProfile.partnerId,benefitsRole:t.benefitsProfile.role})},Fr=t=>{const n=`${t.eventName} ${t.eventAction}`,s={...t};delete s.eventName,delete s.eventAction,analytics.track(n,s)},Hr=t=>()=>{},mi={identifyUser:In,trackEvent:Fr,handleTrackingOnClick:Hr},jr=as(()=>rs(()=>import("./index-5e9e5aa9.js"),["assets/index-5e9e5aa9.js","assets/vendor-2d0139ca.js","assets/lodash-5d893f8c.js","assets/framer-motion-bb8d6b82.js","assets/date-fns-c5d8fbc0.js","assets/oidc-client-6f6e47c2.js","assets/@splitsoftware-7d799540.js","assets/datadog-ff247651.js"])),Wr=()=>{const[t,n]=m({user:x}),[s,a]=m(!1),[r,i]=m(!1),[c,l]=m(),[y,u]=m({}),{service:v}=P();if(typeof window<"u"&&window.location.pathname.replace("/benefits/app","")!=="/")return window.location.pathname="/benefits/app/",null;d(()=>{(async()=>{if(await B.fetchConfigAsync(),Xe.extractRedirectPath(),Xe.extractMode(),H.tokenExists(window.location.search)){await H.signOut(),await H.initFromToken(window.location.pathname,window.location.search);return}i(!0)})();const k=[G.signedInUser$.subscribe(w=>{n({user:w}),$(w)&&In(w.value)}),Zt.authState$.subscribe(async({authStatus:w,jwt:b})=>{$(b)&&w===U.Authenticated?(await H.refreshIfExpired(),R.setParameters(B.getConfig().apiBaseUrl,b.value),re.setParameters(B.getConfig().apolloBaseUrl,b.value),bs.setParameters(B.getConfig().apiV2BaseUrl,b.value),te.extractProfileId(b.value),await te.loadSignedInUserProfileAsync(),a(w===U.Authenticated)):a(!1)})];return()=>{k.map(w=>w.unsubscribe())}},[]);const A=k=>{switch(k.url.replace(/^\/+/,"").split("/")[0]){case"":I.update({appView:"employee",navTab:"benefits"});break;case"admin":I.update({appView:"admin",navTab:"benefits"});break;case"wellbeing-hub":I.update({appView:"employee",navTab:"wellbeing"});break}};return d(()=>{r&&v.trackAppLoadedAsync()},[r]),d(()=>{if(r&&s&&$(t.user)){const k=t.user.value.basicProfile,b={core:{authorizationKey:B.getConfig().splitAuthorizationKey,key:k.profileId}},g={accountId:k.accountId,partnerId:k.partnerId};u(g),l(b)}},[r,s,t.user]),r?e("div",{id:"preact_root",className:"min-h-screen",children:e(ps,{config:c,attributes:y,children:e(an.Provider,{value:s,children:e(de.Provider,{value:t.user,children:e(rt,{history:ot(it()),onChange:A,children:[e(xe,{path:"/",component:Ye}),e(xe,{path:"/categories/:category",component:Ye}),e(xe,{path:"/wellbeing-hub/:subroute*",component:Ye}),e(xe,{path:"/admin/:subroute*",component:jr}),e(_,{path:"/oidc/:mode*",component:Is}),e(_,{path:"/b2c/:fragment",component:Es}),e(_,{path:"/workplace-link",component:Pe}),e(_,{path:"state=:fragment*",component:Pe}),e(_,{path:"/code*",component:Pe}),e(rn,{default:!0})]})})})})}):e(Ve,{})};typeof window<"u"&&(is({storage:window.sessionStorage,key:"benefits-client-v2"}),cs(),ls.polyfill(),fs());os(e(ms,{children:e(ds,{fallback:rn,children:e(Wr,{})})}),document.body);export{ot as A,R as B,bn as D,lt as H,Xa as I,Yt as L,ht as M,ut as P,Lt as U,P as a,Qe as b,W as c,de as d,bs as e,ve as f,ct as g,Bs as h,Re as i,j,Ja as k,oi as l,mi as m,li as n,ci as o,ai as p,Qa as q,ii as r,ri as s,si as t,We as u,z as v,dt as w,nn as x,Gs as y,Qt as z};