- content_for :injection_data do
  - if Stripe.publishable_key
    :javascript
      angular.module('Darkswarm').value("stripeObject", Stripe("#{Stripe.publishable_key}"))

%div{"data-controller": "stripe-cards"}
  - if @saved_credit_cards.length > 0
    .checkout-input
      %label
        = t('split_checkout.step2.form.stripe.use_saved_card')
      = select_tag :card,
        options_for_select(stripe_card_options(@saved_credit_cards) + [[t('split_checkout.step2.form.stripe.create_new_card'), ""]], @selected_card),
        { "data-action": "change->stripe-cards#onSelectCard", "data-stripe-cards-target": "select" }

  .checkout-input{"data-stripe-cards-target": "stripeelements"}
    - if @saved_credit_cards.length == 0
      %label
        = t('split_checkout.step2.form.stripe.use_new_card')
    %stripe-elements


  - if spree_current_user
    .checkout-input
      = check_box_tag :save_card, {id: "save_card", name: "save_card", checked: false, value: "1"}
      = label :save_card, t('split_checkout.step2.form.stripe.save_card'), { for: "save_card" }
    
- content_for :injection_data do
  - if Stripe.publishable_key
    :javascript
      angular.module('Darkswarm').value("stripeObject", Stripe("#{Stripe.publishable_key}"))

%div{"data-controller": "stripe-cards"}
  - if @saved_credit_cards.any?
    .checkout-input
      %label
        = t('split_checkout.step2.form.stripe.use_saved_card')
      = select_tag :card,
        options_for_select(stripe_card_options(@saved_credit_cards) + [[t('split_checkout.step2.form.stripe.create_new_card'), ""]], @selected_card),
        { "data-action": "change->stripe-cards#onSelectCard", "data-stripe-cards-target": "select" }

  .checkout-input{"data-stripe-cards-target": "stripeelements"}
    - if @saved_credit_cards.none?
      %label
        = t('split_checkout.step2.form.stripe.use_new_card')
    %stripe-elements


  - if spree_current_user
    .checkout-input
      = check_box_tag :save_card, {id: "save_card", name: "save_card", checked: false, value: "1"}
      = label :save_card, t('split_checkout.step2.form.stripe.save_card'), { for: "save_card" }
    
Tidy up checks on Enumerable objects
Tidy up checks on Enumerable objects
