{#if System.get_env("ORDER_BYPASS")}
In a hurry? Use a pre-made order.
{/if}

Pain Away of Philly

{if @booked, do: "Your order is booked.", else: "Book #{ngettext("an appointment", "appointments", @number)}"}

{#if @booked}
{explain_services(assigns)} {#else}

How many people are you booking for?

We can accommodate a party up to 10 people at once. If you would like to book an appointment for 5 or more people, please call us at 267-690-4138, or email us.

{#for n <- [2,3,4]} {/for}
{#if (map_size(@services) < @number) || map_size(needing_choice(@limbs)) > 0}

How can we help you?

{#for class <- classed_services()["classes"]} {#else}

Seems like an error has occurred.

{/for}
{#for {num, limbs} <- needing_choice(@limbs)} <.modal id={"choose-limb-#{num}"} show>

Customer # {num}
{@services[num]}

Please choose any areas you need help on:

Once you're here, you can choose among our various massage techniques:

{#if body_areas(limbs) |> length > 0} {/if} {/for} {explain_services(assigns)} {#else}

You are booking:

{explain_services(assigns)}
{#if !@schedule}

Please schedule:

{#else}

Your {ngettext("appointment is", "appointments are", @number)} going to be:

  • on {scheduled_block(@schedule) |> Calendar.strftime("%A, %m/%d, %Y")}
  • at {scheduled_block(@schedule) |> Calendar.strftime("%H:%M (%I:%M %P)")}

{#if map_size(@employed) < @number}

Please choose {@number} {ngettext("therapist", "therapists", @number)}:

bookable_any(@services, @employed, &(&1))} enabled={@calendars |> bookable_any(@services, @employed, &(&1 > 0))} >No preference bookable_as_gender(@services, @employed, "masculine", &(&1))} enabled={@calendars |> bookable_as_gender(@services, @employed, "masculine", &(&1 > 0))} >Any - masculine bookable_as_gender(@services, @employed, "feminine", &(&1))} enabled={@calendars |> bookable_as_gender(@services, @employed, "feminine", &(&1 > 0))} >Any - feminine {#for employee <- all_employees()} employee_bookable?(employee, @services, @employed)} /> {#else}

Seems like an error has occurred.

{/for} {#else}

Your therapist {ngettext("choice is", "choices are", @number)}:

    {#for employee <- Map.values(@employed)}
  • {#case employee} {#match "_any"}No preference {#match "_masc"}Any (masculine) {#match "_fem"}Any (feminine) {#match name}{name} {/case}
  • {/for}

Nearly done; your information is needed.

How did you hear of us? I agree to the conditions.
<.modal id="conditions-modal">

Please remember to be here for the beginning of your scheduled appointment. In case you are too late, we may be unable to honor the booking you made, because of scheduling collisions and high demand.

{#if (@services |> chosen_services |> map_size) > 0}

Once your appointments have ended, you'll be charged a sum of:
${sum_services(chosen_services(@services)) + sum_addons(@addons, @all_addons)} (plus taxes)

{/if} Map.take(~w[name phone email]) |> Map.values() |> Enum.map(&(String.length(&1) == 0)) |> Enum.any?} >

Please proceed once you're ready.

{/if} {/if} {/if} {/if}