text:
describe "Provision Requests API" do
  let(:zone)       { FactoryGirl.create(:zone, :name => "api_zone") }
  let(:miq_server) { FactoryGirl.create(:miq_server, :zone => zone) }
  let(:ems)        { FactoryGirl.create(:ems_vmware, :zone => zone) }
  let(:host)       { FactoryGirl.create(:host, :ext_management_system => ems) }
  let(:dialog)     { FactoryGirl.create(:miq_dialog_provision) }

  describe "Provision Requests" do
    let(:hardware) { FactoryGirl.create(:hardware, :memory_mb => 1024) }
    let(:template) do
      FactoryGirl.create(:template_vmware,
                         :name                  => "template1",
                         :host                  => host,
                         :ext_management_system => ems,
                         :hardware              => hardware)
    end

    let(:single_provision_request) do
      {
        "template_fields" => {"guid" => template.guid},
        "vm_fields"       => {"number_of_cpus" => 1, "vm_name" => "api_test"},
        "requester"       => {"user_name" => api_config(:user)}
      }
    end

    let(:expected_attributes) { %w(id options) }
    let(:expected_hash) do
      {
        "userid"         => api_config(:user),
        "requester_name" => api_config(:user_name),
        "approval_state" => "pending_approval",
        "type"           => "MiqProvisionRequest",
        "request_type"   => "template",
        "message"        => /Provisioning/i,
        "status"         => "Ok"
      }
    end

    it "rejects requests without appropriate role" do
      api_basic_authorize

      run_post(provision_requests_url, single_provision_request)

      expect(response).to have_http_status(:forbidden)
    end

    it "supports single request with normal post" do
      api_basic_authorize collection_action_identifier(:provision_requests, :create)

      dialog  # Create the Provisioning dialog
      run_post(provision_requests_url, single_provision_request)

      expect(response).to have_http_status(:ok)
      expect_result_resources_to_include_keys("results", expected_attributes)
      expect_results_to_match_hash("results", [expected_hash])

      task_id = response.parsed_body["results"].first["id"]
      expect(MiqProvisionRequest.exists?(task_id)).to be_truthy
    end

    it "supports single request with create action" do
      api_basic_authorize collection_action_identifier(:provision_requests, :create)

      dialog  # Create the Provisioning dialog
      run_post(provision_requests_url, gen_request(:create, single_provision_request))

      expect(response).to have_http_status(:ok)
      expect_result_resources_to_include_keys("results", expected_attributes)
      expect_results_to_match_hash("results", [expected_hash])

      task_id = response.parsed_body["results"].first["id"]
      expect(MiqProvisionRequest.exists?(task_id)).to be_truthy
    end

    it "supports multiple requests" do
      api_basic_authorize collection_action_identifier(:provision_requests, :create)

      dialog  # Create the Provisioning dialog
      run_post(provision_requests_url, gen_request(:create, [single_provision_request, single_provision_request]))

      expect(response).to have_http_status(:ok)
      expect_result_resources_to_include_keys("results", expected_attributes)
      expect_results_to_match_hash("results", [expected_hash, expected_hash])

      task_id1, task_id2 = response.parsed_body["results"].collect { |r| r["id"] }
      expect(MiqProvisionRequest.exists?(task_id1)).to be_truthy
      expect(MiqProvisionRequest.exists?(task_id2)).to be_truthy
    end
  end

  context "AWS advanced provision requests" do
    let!(:aws_dialog) do
      path = Rails.root.join("product", "dialogs", "miq_dialogs", "miq_provision_amazon_dialogs_template.yaml")
      content = YAML.load_file(path)[:content]
      dialog = FactoryGirl.create(:miq_dialog, :name => "miq_provision_amazon_dialogs_template",
                                  :dialog_type => "MiqProvisionWorkflow", :content => content)
      allow_any_instance_of(MiqRequestWorkflow).to receive(:dialog_name_from_automate).and_return(dialog.name)
    end
    let(:ems) { FactoryGirl.create(:ems_amazon_with_authentication) }
    let(:template) do
      FactoryGirl.create(:template_amazon, :name => "template1", :ext_management_system => ems)
    end
    let(:flavor) do
      FactoryGirl.create(:flavor_amazon, :ems_id => ems.id, :name => 't2.small', :cloud_subnet_required => true)
    end
    let(:az)             { FactoryGirl.create(:availability_zone_amazon, :ems_id => ems.id) }
    let(:cloud_network1) do
      FactoryGirl.create(:cloud_network_amazon,
                         :ext_management_system => ems.network_manager,
                         :enabled               => true)
    end
    let(:cloud_subnet1) do
      FactoryGirl.create(:cloud_subnet,
                         :ext_management_system => ems.network_manager,
                         :cloud_network         => cloud_network1,
                         :availability_zone     => az)
    end
    let(:security_group1) do
      FactoryGirl.create(:security_group_amazon,
                         :name                  => "sgn_1",
                         :ext_management_system => ems.network_manager,
                         :cloud_network         => cloud_network1)
    end
    let(:floating_ip1) do
      FactoryGirl.create(:floating_ip_amazon,
                         :cloud_network_only    => true,
                         :ext_management_system => ems.network_manager,
                         :cloud_network         => cloud_network1)
    end

    let(:provreq_body) do
      {
        "template_fields" => {"guid" => template.guid},
        "requester"       => {
          "owner_first_name" => "John",
          "owner_last_name"  => "Doe",
          "owner_email"      => "user@example.com"
        }
      }
    end

    let(:expected_provreq_attributes) { %w(id options) }

    let(:expected_provreq_hash) do
      {
        "userid"         => api_config(:user),
        "requester_name" => api_config(:user_name),
        "approval_state" => "pending_approval",
        "type"           => "MiqProvisionRequest",
        "request_type"   => "template",
        "message"        => /Provisioning/i,
        "status"         => "Ok"
      }
    end

    it "supports manual placement" do
      api_basic_authorize collection_action_identifier(:provision_requests, :create)

      body = provreq_body.merge(
        "vm_fields" => {
          "vm_name"                     => "api_test_aws",
          "instance_type"               => flavor.id,
          "placement_auto"              => false,
          "placement_availability_zone" => az.id,
          "cloud_network"               => cloud_network1.id,
          "cloud_subnet"                => cloud_subnet1.id,
          "security_groups"             => security_group1.id,
          "floating_ip_address"         => floating_ip1.id
        }
      )

      run_post(provision_requests_url, body)

      expect(response).to have_http_status(:ok)
      expect_result_resources_to_include_keys("results", expected_provreq_attributes)
      expect_results_to_match_hash("results", [expected_provreq_hash])

      expect(response.parsed_body["results"].first).to a_hash_including(
        "options" => a_hash_including(
          "placement_auto"              => [false, 0],
          "placement_availability_zone" => [az.id, az.name],
          "cloud_network"               => [cloud_network1.id, cloud_network1.name],
          "cloud_subnet"                => [cloud_subnet1.id, anything],
          "security_groups"             => [security_group1.id, security_group1.name],
          "floating_ip_address"         => [floating_ip1.id, floating_ip1.name]
        )
      )

      task_id = response.parsed_body["results"].first["id"]
      expect(MiqProvisionRequest.exists?(task_id)).to be_truthy
    end

    it "does not process manual placement data if placement_auto is not set" do
      api_basic_authorize collection_action_identifier(:provision_requests, :create)

      body = provreq_body.merge(
        "vm_fields" => {
          "vm_name"                     => "api_test_aws",
          "instance_type"               => flavor.id,
          "placement_availability_zone" => az.id
        }
      )

      run_post(provision_requests_url, body)

      expect(response).to have_http_status(:ok)
      expect_result_resources_to_include_keys("results", expected_provreq_attributes)
      expect_results_to_match_hash("results", [expected_provreq_hash])

      expect(response.parsed_body["results"].first).to a_hash_including(
        "options" => a_hash_including(
          "placement_auto"              => [true, 1],
          "placement_availability_zone" => [nil, nil]
        )
      )

      task_id = response.parsed_body["results"].first["id"]
      expect(MiqProvisionRequest.exists?(task_id)).to be_truthy
    end

    it "does not process manual placement data if placement_auto is set to true" do
      api_basic_authorize collection_action_identifier(:provision_requests, :create)

      body = provreq_body.merge(
        "vm_fields" => {
          "vm_name"                     => "api_test_aws",
          "instance_type"               => flavor.id,
          "placement_auto"              => true,
          "placement_availability_zone" => az.id
        }
      )

      run_post(provision_requests_url, body)

      expect(response).to have_http_status(:ok)
      expect_result_resources_to_include_keys("results", expected_provreq_attributes)
      expect_results_to_match_hash("results", [expected_provreq_hash])

      expect(response.parsed_body["results"].first).to a_hash_including(
        "options" => a_hash_including(
          "placement_auto"              => [true, 1],
          "placement_availability_zone" => [nil, nil]
        )
      )

      task_id = response.parsed_body["results"].first["id"]
      expect(MiqProvisionRequest.exists?(task_id)).to be_truthy
    end
  end

  context "Provision requests approval" do
    let(:user)          { FactoryGirl.create(:user) }
    let(:template)      { FactoryGirl.create(:template_amazon) }
    let(:provreqbody)   { {:requester => user, :source_type => 'VmOrTemplate', :source_id => template.id} }
    let(:provreq1)      { FactoryGirl.create(:miq_provision_request, provreqbody) }
    let(:provreq2)      { FactoryGirl.create(:miq_provision_request, provreqbody) }
    let(:provreq1_url)  { provision_requests_url(provreq1.id) }
    let(:provreq2_url)  { provision_requests_url(provreq2.id) }
    let(:provreqs_list) { [provreq1_url, provreq2_url] }

    it "supports approving a request" do
      api_basic_authorize collection_action_identifier(:provision_requests, :approve)

      run_post(provreq1_url, gen_request(:approve))

      expected_msg = "Provision request #{provreq1.id} approved"
      expect_single_action_result(:success => true, :message => expected_msg, :href => :provreq1_url)
    end

    it "supports denying a request" do
      api_basic_authorize collection_action_identifier(:provision_requests, :approve)

      run_post(provreq2_url, gen_request(:deny))

      expected_msg = "Provision request #{provreq2.id} denied"
      expect_single_action_result(:success => true, :message => expected_msg, :href => :provreq2_url)
    end

    it "supports approving multiple requests" do
      api_basic_authorize collection_action_identifier(:provision_requests, :approve)

      run_post(provision_requests_url, gen_request(:approve, [{"href" => provreq1_url}, {"href" => provreq2_url}]))

      expected = {
        "results" => a_collection_containing_exactly(
          {
            "message" => a_string_matching(/Provision request #{provreq1.id} approved/i),
            "success" => true,
            "href"    => a_string_matching(provreq1_url)
          },
          {
            "message" => a_string_matching(/Provision request #{provreq2.id} approved/i),
            "success" => true,
            "href"    => a_string_matching(provreq2_url)
          }
        )
      }
      expect(response.parsed_body).to include(expected)
      expect(response).to have_http_status(:ok)
    end

    it "supports denying multiple requests" do
      api_basic_authorize collection_action_identifier(:provision_requests, :approve)

      run_post(provision_requests_url, gen_request(:deny, [{"href" => provreq1_url}, {"href" => provreq2_url}]))

      expected = {
        "results" => a_collection_containing_exactly(
          {
            "message" => a_string_matching(/Provision request #{provreq1.id} denied/i),
            "success" => true,
            "href"    => a_string_matching(provreq1_url)
          },
          {
            "message" => a_string_matching(/Provision request #{provreq2.id} denied/i),
            "success" => true,
            "href"    => a_string_matching(provreq2_url)
          }
        )
      }
      expect(response.parsed_body).to include(expected)
      expect(response).to have_http_status(:ok)
    end
  end
end


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE-edge"/>
    <meta name="viewport" content="width=device-width, initial -scale =1"/>
    <meta name="description" content=""/>
    <meta name="author" content=""/>
    <title>Career Levels - All events</title>
    <link rel="shortcut icon" type="image/png" th:href="@{/images/favicon.png}"/>
    <link rel="stylesheet"
          th:href="@{http://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css}"/>

    <link rel="stylesheet" type="text/css"
          href="../static/css/bootstrap.min.css"
          th:href="@{/css/bootstrap.min.css}"/>
    <link rel="stylesheet" type="text/css" href="../static/css/style.css"
          th:href="@{/css/style.css}"/>
    <link rel="stylesheet" type="text/css"
          href="../static/css/footer-distributed-with-address-and-phones.css"
          th:href="@{/css/footer-distributed-with-address-and-phones.css}"/>

    <link rel="stylesheet" type="text/css" th:href="@{/DataTables-1.10.15/media/css/jquery.dataTables.css}">

    <link rel="stylesheet" type="text/css" th:href="@{/css/bootstrap-datetimepicker.css}">
    <link rel="stylesheet"
          href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.4.1/css/bootstrap-datepicker3.css"/>

                    All events

                    <button type="button"
                            class="btn1 icon-btn btn-success glyphicon btn-glyphicon glyphicon-plus  text-success"
                            data-toggle="modal" data-target="#Create">Create
                    </button>

                            Id
                            Title
                            Description
                            Date
                            Place
                            Participants
                            Info

                                                <button type="button" class="close" data-dismiss="modal"
                                                        aria-label="Close">
                                                    ×
                                                </button>

General event info

                                                <form th:id="'eventInfoForm'+${ae.id}">

Who is going  :

                                                </form>

                                                <button th:if="${#bools.isFalse(eventAttendMap.get(ae.id))}"
                                                        th:value="${eventAttendMap.get(ae.id)}"
                                                        class="btn btn-primary d-inline-block openJoinModal"
                                                        th:attr="data-id=${ae.id}" href="#joinEventModal">Join
                                                </button>

                                                    <form id="leaveForm"
                                                          th:action="@{/leave-event}" action="#"
                                                          class="form-horizontal">
                                                        <input type="hidden" name="leaveEventId"
                                                               id="leaveEventId" th:value="${ae.id}"/>
                                                        <input type="hidden" name="leaveUserId" id="leaveUserId"
                                                               th:value="${currentUser.id}">
                                                        <button style="margin-left: 10px;"
                                                                onclick="document.getElementById('leaveForm').submit()"
                                                                class="btn btn-success d-inline-block">Leave
                                                        </button>
                                                    </form>

                                                <button th:if="${currentUser.id == ae.userAuthor.id}"
                                                        th:onclick="'javascript:changeFormValues(\'' + ${ae.id} + '\');'"
                                                        class="btn btn-info d-inline-block" data-toggle="modal"
                                                        data-target="#Edit">Edit
                                                </button>
                                                <button th:if="${currentUser.id == ae.userAuthor.id}"
                                                        th:onclick="'javascript:deleteEvent(\'' + ${ae.id} +'\');'"
                                                        class="btn btn-danger d-inline-block">Delete
                                                </button>
                                                <button type="button" class="btn btn-default d-inline-block"
                                                        data-dismiss="modal">Cancel
                                                </button>

                                    Attenders  :

                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        ×
                    </button>

Add

                    <form id="createForm" method="post" class="form-horizontal"
                          th:action="@{/create-event}" action="#">

                            Title  *

                                <input class="form-control" id="title" name="title"
                                       value="" required
                                       aria-required="true" minlength="4" maxlength="30"
                                       aria-describedby="name-format" placeholder="Enter a title"/>

                            Description  *

                                <input class="form-control" id="description" name="description"
                                       value="" required
                                       aria-required="true" minlength="4" maxlength="30"
                                       aria-describedby="name-format" placeholder="Enter a description"/>

                             Date  *

                                <input class="form-control" id="eventDate"
                                       name="eventDate" type="text"
                                       required/>

                            Place  *

                                <input class="form-control" id="place" name="place"
                                       value="" required
                                       aria-required="true" minlength="4" maxlength="30"
                                       aria-describedby="name-format" placeholder="Enter a place"/>

                            <button type="submit" class="btn btn-primary">Add</button>
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal">Cancel
                            </button>

                    </form>

                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        ×
                    </button>

General info

                    <form id="eventInfoForm">

                            <button type="submit" class="btn btn-primary">Edit</button>
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal">Cancel
                            </button>

                    </form>

                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        ×
                    </button>

Edit

                    <form id="editForm"
                          th:action="@{/edit-event}" action="#"
                          class="form-horizontal">
                        <input type="hidden" name="eventId"
                               id="eventIdEdit" value=""/>

                            Title  *

                                <input class="form-control" name="titleEdit" id="titleEdit"
                                       value="" required type="text"
                                       aria-required="true" aria-describedby="name-format"/>

                            Description  *

                                <input class="form-control" name="descriptionEdit" id="descriptionEdit"
                                       value="" required type="text"
                                       aria-required="true" aria-describedby="name-format"/>

                             Date  *

                                <input class="form-control" id="dateEdit"
                                       name="dateEdit" type="text"
                                       required/>

                            Place  *

                                <input class="form-control" name="placeEdit" id="placeEdit"
                                       value="" required type="text"
                                       aria-required="true" aria-describedby="name-format"/>

                            <button type="submit" class="btn btn-primary">Edit</button>
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal">Cancel
                            </button>

                    </form>

                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        ×
                    </button>

Assign

                    <form id="assignForm"
                          th:action="@{/assign-responsibility-card}" action="#"
                          class="form-horizontal">
                        <input type="hidden" name="responsibilityCardIdAssign"
                               id="responsibilityCardIdAssign" value=""/>

                            Users  *

                            <select id="newUserId"
                                    class="form-control" name="newUserId" required>
                                <option name="newUserId" selected value="-1">Select an user</option>
                                <option name="newUserId" th:each="usr : ${allUsers}"
                                        th:value="${usr.id}" th:text="${usr.firstName + ' ' + usr.lastName}">User
                                </option>
                            </select>

                            <button type="submit" class="btn btn-primary">Assign</button>
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal">Cancel
                            </button>

                    </form>

                    <button type="button" class="close" data-dismiss="modal"
                            aria-label="Close">
                        ×
                    </button>

Edit your comment

                    <form id="updateCommentForm"
                          th:action="@{/update-comment}" action="#"
                          class="form-horizontal">
                        <input type="hidden" name="updateCommentId"
                               id="updateCommentId"/>

                            Your new comment

                                <input class="form-control" id="updateCommentText" name="updateCommentText"
                                       value="" placeholder="Enter a comment"/>

                            <button type="submit" class="btn btn-primary">Save</button>
                            <button type="button" class="btn btn-default"
                                    data-dismiss="modal">Cancel
                            </button>

                    </form>

<<<Home

                Home · Blog

Copyright © 2017, ISD. All
                rights reserved.

                    Str. Fierarilor 2
Chisinau 2001MD, Moldova

+373 22 996 170

                    isd@inthergroup.com

 About the company
 ISD executes Java projects. For a
                very reasonable price customer gains access to our team of skilled
                professionals.

redpajama_set_name: RedPajamaGithub


text:
<?php
class Todos extends CI_Controller {

        public function __construct()
        {
                parent::__construct();

                if (!ENABLED_MEMBERSHIP) {
                        redirect();
                        exit;
                }
                $this->load->library('session');
                $this->load->helper('form');
                $this->load->helper('url');
                $this->load->database();
                $this->load->library('form_validation');
                //load the employee model
                $this->load->helper('email');
$this->load->library('pagination');
        }

        // Account Dashboard / Home
        public function index()
        {

                $this->mTitle = "Account";
                $this->mViewFile = 'account/adduser';

        }
        public function add()
        {

                $this->mTitle = "Account";
                $this->mViewFile = 'account/park';

        }

}


text:
require File.expand_path('../boot', __FILE__)
ENV['RANSACK_FORM_BUILDER'] = '::SimpleForm::FormBuilder'
require "rails"
# Pick the frameworks you want:
require "active_model/railtie"
require "active_job/railtie"
require "active_record/railtie"
require "action_controller/railtie"
require "action_mailer/railtie"
require "action_view/railtie"
require "sprockets/railtie"
# require "rails/test_unit/railtie"

# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)

module Zebra
  class Application < Rails::Application
    # Settings in config/environments/* take precedence over those specified here.
    # Application configuration should go into files in config/initializers
    # -- all .rb files in that directory are automatically loaded.

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    config.time_zone = 'Beijing'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    config.i18n.default_locale = :'zh-CN'

    # config.encoding = "utf-8"

    # Do not swallow errors in after_commit/after_rollback callbacks.
    config.active_record.raise_in_transactional_callbacks = true
    config.i18n.available_locales = ['zh-CN', :en]
    config.generators do |g|
      g.test_framework :rspec,
      fixtures: true,
      view_specs: false,
      helper_specs: false,
      routing_specs: false,
      controller_specs: false,
      request_specs: true
      g.fixture_replacement :factory_girl, dir: "spec/factories"
    end
    config.middleware.insert_before 0, "Rack::Cors" do
      allow do
        origins '*'
        resource '*', :headers => :any, :methods => [:get, :post, :put, :patch, :delete, :options, :head]
      end
    end
  end
end


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MetodosDaClasse
{
    class Program
    {
        static void Main(string[] args)
        {
            double x = Double.Parse("10.2");
            double y = Convert.ToDouble("-32.2");

            Console.WriteLine("Teste");

            // Caso: Membro da Instância
            // Console c = new Console();
            // c.WriteLine("Teste");
        }
    }
}


text:
package wasr;

/**
 * User: Jason Gillam
 * Date: 7/13/13
 * Time: 3:13 PM
 */
public interface Icons {
    // Text format icons
    public static String PASTE_16 = "/tango/16x16/actions/edit-paste.png";
    public static String TEXT_BOLD_16 = "/tango/16x16/actions/format-text-bold.png";
    public static String TEXT_ITALIC_16 = "/tango/16x16/actions/format-text-italic.png";
    public static String TEXT_UNDERLINE_16 = "/tango/16x16/actions/format-text-underline.png";

    // Image manipulation icons
    public static String IMAGE_DEFAULT_32 = "/tango/32x32/apps/help-browser.png";
    public static String IMAGE_LOAD_32 = "/tango/32x32/devices/camera-photo.png";

}


text:
"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var core_1 = require("@ag-grid-community/core");
var ImmutableService = /** @class */ (function (_super) {
    __extends(ImmutableService, _super);
    function ImmutableService() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    ImmutableService.prototype.postConstruct = function () {
        if (this.rowModel.getType() === core_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE) {
            this.clientSideRowModel = this.rowModel;
        }
    };
    // converts the setRowData() command to a transaction
    ImmutableService.prototype.createTransactionForRowData = function (data) {
        if (core_1._.missing(this.clientSideRowModel)) {
            console.error('ag-Grid: ImmutableService only works with ClientSideRowModel');
            return;
        }
        var getRowNodeIdFunc = this.gridOptionsWrapper.getRowNodeIdFunc();
        if (!getRowNodeIdFunc || core_1._.missing(getRowNodeIdFunc)) {
            console.error('ag-Grid: ImmutableService requires getRowNodeId() callback to be implemented, your row data need IDs!');
            return;
        }
        // convert the data into a transaction object by working out adds, removes and updates
        var transaction = {
            remove: [],
            update: [],
            add: []
        };
        var existingNodesMap = this.clientSideRowModel.getCopyOfNodesMap();
        var suppressSortOrder = this.gridOptionsWrapper.isSuppressMaintainUnsortedOrder();
        var orderMap = suppressSortOrder ? null : {};
        if (core_1._.exists(data)) {
            // split all the new data in the following:
            // if new, push to 'add'
            // if update, push to 'update'
            // if not changed, do not include in the transaction
            data.forEach(function (dataItem, index) {
                var id = getRowNodeIdFunc(dataItem);
                var existingNode = existingNodesMap[id];
                if (orderMap) {
                    orderMap[id] = index;
                }
                if (existingNode) {
                    var dataHasChanged = existingNode.data !== dataItem;
                    if (dataHasChanged) {
                        transaction.update.push(dataItem);
                    }
                    // otherwise, if data not changed, we just don't include it anywhere, as it's not a delta
                    // remove from list, so we know the item is not to be removed
                    existingNodesMap[id] = undefined;
                }
                else {
                    transaction.add.push(dataItem);
                }
            });
        }
        // at this point, all rows that are left, should be removed
        core_1._.iterateObject(existingNodesMap, function (id, rowNode) {
            if (rowNode) {
                transaction.remove.push(rowNode.data);
            }
        });
        return [transaction, orderMap];
    };
    __decorate([
        core_1.Autowired('rowModel')
    ], ImmutableService.prototype, "rowModel", void 0);
    __decorate([
        core_1.PostConstruct
    ], ImmutableService.prototype, "postConstruct", null);
    ImmutableService = __decorate([
        core_1.Bean('immutableService')
    ], ImmutableService);
    return ImmutableService;
}(core_1.BeanStub));
exports.ImmutableService = ImmutableService;
//# sourceMappingURL=immutableService.js.map


text:
;(function() {

  /** Used as a safe reference for `undefined` in pre-ES5 environments. */
  var undefined;

  /** Used as the size to cover large array optimizations. */
  var LARGE_ARRAY_SIZE = 200;

  /** Used as a reference to the global object. */
  var root = (typeof global == 'object' && global) || this;

  /** Used for native method references. */
  var arrayProto = Array.prototype;

  /** Method and object shortcuts. */
  var phantom = root.phantom,
      amd = root.define && define.amd,
      document = !phantom && root.document,
      noop = function() {},
      slice = arrayProto.slice,
      WeakMap = root.WeakMap;

  /*--------------------------------------------------------------------------*/

  /** Use a single "load" function. */
  var load = (!amd && typeof require == 'function')
    ? require
    : noop;

  /** The unit testing framework. */
  var QUnit = root.QUnit || (root.QUnit = (
    QUnit = load('../node_modules/qunitjs/qunit/qunit.js') || root.QUnit,
    QUnit = QUnit.QUnit || QUnit
  ));

  /** Load stable Lodash and QUnit Extras. */
  var _ = root._ || load('../lodash.js');
  if (_) {
    _ = _.runInContext(root);
  }
  var QUnitExtras = load('../node_modules/qunit-extras/qunit-extras.js');
  if (QUnitExtras) {
    QUnitExtras.runInContext(root);
  }

  var convert = root.fp || load('../lib/fp/convert.js'),
      mapping = root.mapping || load('../lib/fp/mapping.js'),
      fp = convert(_.runInContext());

  /*--------------------------------------------------------------------------*/

  /**
   * Skips a given number of tests with a passing result.
   *
   * @private
   * @param {Object} assert The QUnit assert object.
   * @param {number} [count=1] The number of tests to skip.
   */
  function skipTest(assert, count) {
    count || (count = 1);
    while (count--) {
      assert.ok(true, 'test skipped');
    }
  }

  /*--------------------------------------------------------------------------*/

  QUnit.module('method aliases');

  (function() {
    QUnit.test('should have correct aliases', function(assert) {
      assert.expect(1);

      var actual = _.transform(mapping.aliasMap, function(result, aliases, methodName) {
        var func = fp[methodName];
        _.each(aliases, function(alias) {
          result.push([alias, fp[alias] === func]);
        });
      }, []);

      assert.deepEqual(_.reject(actual, 1), []);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('method ary caps');

  (function() {
    QUnit.test('should have a cap of 1', function(assert) {
      assert.expect(1);

      var funcMethods = [
        'curry', 'iteratee', 'memoize', 'over', 'overEvery', 'overSome',
        'method', 'methodOf', 'restParam', 'runInContext'
      ];

      var exceptions = funcMethods.concat('mixin', 'template'),
          expected = _.map(mapping.aryMethodMap[1], _.constant(true));

      var actual = _.map(mapping.aryMethodMap[1], function(methodName) {
        var arg = _.includes(funcMethods, methodName) ? _.noop : 1,
            result = _.attempt(function() { return fp[methodName](arg); });

        if (_.includes(exceptions, methodName)
              ? typeof result == 'function'
              : typeof result != 'function'
            ) {
          return true;
        }
        console.log(methodName, result);
        return false;
      });

      assert.deepEqual(actual, expected);
    });

    QUnit.test('should have a cap of 2', function(assert) {
      assert.expect(1);

      var funcMethods = [
        'after', 'ary', 'before', 'bind', 'bindKey', 'cloneDeepWith', 'cloneWith',
        'curryN', 'debounce', 'delay', 'overArgs', 'rearg', 'throttle', 'wrap'
      ];

      var exceptions = _.difference(funcMethods.concat('matchesProperty'), ['cloneDeepWith', 'cloneWith', 'delay']),
          expected = _.map(mapping.aryMethodMap[2], _.constant(true));

      var actual = _.map(mapping.aryMethodMap[2], function(methodName) {
        var args = _.includes(funcMethods, methodName) ? [methodName == 'curryN' ? 1 : _.noop, _.noop] : [1, []],
            result = _.attempt(function() { return fp[methodName](args[0])(args[1]); });

        if (_.includes(exceptions, methodName)
              ? typeof result == 'function'
              : typeof result != 'function'
            ) {
          return true;
        }
        console.log(methodName, result);
        return false;
      });

      assert.deepEqual(actual, expected);
    });

    QUnit.test('should have a cap of 3', function(assert) {
      assert.expect(1);

      var funcMethods = [
        'assignWith', 'extendWith', 'isEqualWith', 'isMatchWith', 'omitBy',
        'pickBy', 'reduce', 'reduceRight', 'transform', 'zipWith'
      ];

      var expected = _.map(mapping.aryMethodMap[3], _.constant(true));

      var actual = _.map(mapping.aryMethodMap[3], function(methodName) {
        var args = _.includes(funcMethods, methodName) ? [_.noop, 0, 1] : [0, 1, []],
            result = _.attempt(function() { return fp[methodName](args[0])(args[1])(args[2]); });

        if (typeof result != 'function') {
          return true;
        }
        console.log(methodName, result);
        return false;
      });

      assert.deepEqual(actual, expected);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('methods that use `indexOf`');

  (function() {
    QUnit.test('should work with `fp.indexOf`', function(assert) {
      assert.expect(10);

      var array = ['a', 'b', 'c'],
          other = ['b', 'b', 'd'],
          object = { 'a': 1, 'b': 2, 'c': 2 },
          actual = fp.difference(array, other);

      assert.deepEqual(actual, ['a', 'c'], 'fp.difference');

      actual = fp.includes('b', array);
      assert.strictEqual(actual, true, 'fp.includes');

      actual = fp.intersection(other, array);
      assert.deepEqual(actual, ['b'], 'fp.intersection');

      actual = fp.omit(other, object);
      assert.deepEqual(actual, { 'a': 1, 'c': 2 }, 'fp.omit');

      actual = fp.union(other, array);
      assert.deepEqual(actual, ['a', 'b', 'c', 'd'], 'fp.union');

      actual = fp.uniq(other);
      assert.deepEqual(actual, ['b', 'd'], 'fp.uniq');

      actual = fp.uniqBy(_.identity, other);
      assert.deepEqual(actual, ['b', 'd'], 'fp.uniqBy');

      actual = fp.without('b', array);
      assert.deepEqual(actual, ['a', 'c'], 'fp.without');

      actual = fp.xor(other, array);
      assert.deepEqual(actual, ['a', 'c', 'd'], 'fp.xor');

      actual = fp.pull('b', array);
      assert.deepEqual(actual, ['a', 'c'], 'fp.pull');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('cherry-picked methods');

  (function() {
    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(4);

      if (!document) {
        var args,
            array = [1, 2, 3],
            object = { 'a': 1, 'b': 2 },
            isFIFO = _.keys(object)[0] == 'a',
            map = convert('map', _.map),
            reduce = convert('reduce', _.reduce);

        map(function() {
          args || (args = slice.call(arguments));
        })(array);

        assert.deepEqual(args, [1]);

        args = undefined;
        map(function() {
          args || (args = slice.call(arguments));
        })(object);

        assert.deepEqual(args, isFIFO ? [1] : [2]);

        args = undefined;
        reduce(function() {
          args || (args = slice.call(arguments));
        })(0, array);

        assert.deepEqual(args, [0, 1]);

        args = undefined;
        reduce(function() {
          args || (args = slice.call(arguments));
        })(0, object);

        assert.deepEqual(args, isFIFO ? [0, 1] : [0, 2]);
      }
      else {
        skipTest(assert, 4);
      }
    });

    QUnit.test('should not support shortcut fusion', function(assert) {
      assert.expect(3);

      if (!document) {
        var array = fp.range(0, LARGE_ARRAY_SIZE),
            filterCount = 0,
            mapCount = 0;

        var iteratee = function(value) {
          mapCount++;
          return value * value;
        };

        var predicate = function(value) {
          filterCount++;
          return value % 2 == 0;
        };

        var map1 = convert('map', _.map),
            filter1 = convert('filter', _.filter),
            take1 = convert('take', _.take);

        var filter2 = filter1(predicate),
            map2 = map1(iteratee),
            take2 = take1(2);

        var combined = fp.flow(map2, filter2, fp.compact, take2);

        assert.deepEqual(combined(array), [4, 16]);
        assert.strictEqual(filterCount, 200, 'filterCount');
        assert.strictEqual(mapCount, 200, 'mapCount');
      }
      else {
        skipTest(assert, 3);
      }
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('curry methods');

  _.each(['curry', 'curryRight'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`_.' + methodName + '` should only accept a `func` param', function(assert) {
      assert.expect(1);

      assert.raises(function() { func(1, _.noop); }, TypeError);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('curryN methods');

  _.each(['curryN', 'curryRightN'], function(methodName) {
    var func = fp[methodName];

    QUnit.test('`_.' + methodName + '` accept an `arity` param', function(assert) {
      assert.expect(1);

      var actual = func(1, function(a, b) { return [a, b]; })('a');
      assert.deepEqual(actual, ['a', undefined]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.difference');

  (function() {
    QUnit.test('should return the elements of the first array not included in the second array', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.difference([1, 2])([2, 3]), [1]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.fill');

  (function() {
    QUnit.test('should have an argument order of `start`, `end`, then `value`', function(assert) {
      assert.expect(1);

      var array = [1, 2, 3];
      assert.deepEqual(fp.fill(1)(2)('*')(array), [1, '*', 3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.flow and fp.flowRight');

  _.each(['flow', 'flowRight'], function(methodName, index) {
    var func = fp[methodName],
        isFlow = methodName == 'flow';

    QUnit.test('`fp.' + methodName + '` should support shortcut fusion', function(assert) {
      assert.expect(6);

      var filterCount,
          mapCount,
          array = fp.range(0, LARGE_ARRAY_SIZE);

      var iteratee = function(value) {
        mapCount++;
        return value * value;
      };

      var predicate = function(value) {
        filterCount++;
        return value % 2 == 0;
      };

      var filter = fp.filter(predicate),
          map = fp.map(iteratee),
          take = fp.take(2);

      _.times(2, function(index) {
        var combined = isFlow
          ? func(map, filter, fp.compact, take)
          : func(take, fp.compact, filter, map);

        filterCount = mapCount = 0;

        if (WeakMap && WeakMap.name) {
          assert.deepEqual(combined(array), [4, 16]);
          assert.strictEqual(filterCount, 5, 'filterCount');
          assert.strictEqual(mapCount, 5, 'mapCount');
        }
        else {
          skipTest(assert, 3);
        }
      });
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.inRange');

  (function() {
    QUnit.test('should have an argument order of `start`, `end`, then `value`', function(assert) {
      assert.expect(1);

      assert.strictEqual(fp.inRange(2)(4)(3), true);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.iteratee');

  (function() {
    QUnit.test('should return a iteratee with capped params', function(assert) {
      assert.expect(1);

      var func = fp.iteratee(function(a, b, c) { return [a, b, c]; }, undefined, 3);
      assert.deepEqual(func(1, 2, 3), [1, undefined, undefined]);
    });

    QUnit.test('should convert by name', function(assert) {
      assert.expect(1);

      if (!document) {
        var iteratee = convert('iteratee', _.iteratee),
            func = iteratee(function(a, b, c) { return [a, b, c]; }, undefined, 3);

        assert.deepEqual(func(1, 2, 3), [1, undefined, undefined]);
      }
      else {
        skipTest(assert);
      }
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.maxBy and fp.minBy');

  _.each(['maxBy', 'minBy'], function(methodName, index) {
    var array = [1, 2, 3],
        func = fp[methodName],
        isMax = !index;

    QUnit.test('`fp.' + methodName + '` should work with an `iteratee` argument', function(assert) {
      assert.expect(1);

      var actual = func(function(num) {
        return -num;
      })(array);

      assert.strictEqual(actual, isMax ? 1 : 3);
    });

    QUnit.test('`fp.' + methodName + '` should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(1);

      var args;

      func(function() {
        args || (args = slice.call(arguments));
      })(array);

      assert.deepEqual(args, [1]);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.mixin');

  (function() {
    var source = { 'a': _.noop };

    QUnit.test('should mixin static methods but not prototype methods', function(assert) {
      assert.expect(2);

      fp.mixin(source);

      assert.strictEqual(typeof fp.a, 'function');
      assert.notOk('a' in fp.prototype);

      delete fp.a;
      delete fp.prototype.a;
    });

    QUnit.test('should not assign inherited `source` methods', function(assert) {
      assert.expect(2);

      function Foo() {}
      Foo.prototype.a = _.noop;
      fp.mixin(new Foo);

      assert.notOk('a' in fp);
      assert.notOk('a' in fp.prototype);

      delete fp.a;
      delete fp.prototype.a;
    });

    QUnit.test('should not remove existing prototype methods', function(assert) {
      assert.expect(2);

      var each1 = fp.each,
          each2 = fp.prototype.each;

      fp.mixin({ 'each': source.a });

      assert.strictEqual(fp.each, source.a);
      assert.strictEqual(fp.prototype.each, each2);

      fp.each = each1;
      fp.prototype.each = each2;
    });

    QUnit.test('should not export to the global when `source` is not an object', function(assert) {
      assert.expect(2);

      var props = _.without(_.keys(_), '_');

      _.times(2, function(index) {
        fp.mixin.apply(fp, index ? [1] : []);

        assert.ok(_.every(props, function(key) {
          return root[key] !== fp[key];
        }));

        _.each(props, function(key) {
          if (root[key] === fp[key]) {
            delete root[key];
          }
        });
      });
    });

    QUnit.test('should convert by name', function(assert) {
      assert.expect(3);

      if (!document) {
        var object = { 'mixin': convert('mixin', _.mixin) };

        function Foo() {}
        Foo.mixin = object.mixin;
        Foo.mixin(source);

        assert.strictEqual(typeof Foo.a, 'function');
        assert.notOk('a' in Foo.prototype);

        object.mixin(source);
        assert.strictEqual(typeof object.a, 'function');
      }
      else {
        skipTest(assert, 3);
      }
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.random');

  (function() {
    var array = Array(1000);

    QUnit.test('should support a `min` and `max` argument', function(assert) {
      assert.expect(1);

      var min = 5,
          max = 10;

      assert.ok(_.some(array, function() {
        var result = fp.random(min)(max);
        return result >= min && result <= max;
      }));
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.range');

  (function() {
    QUnit.test('should have an argument order of `start` then `end`', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.range(1)(4), [1, 2, 3]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('reduce methods');

  _.each(['reduce', 'reduceRight'], function(methodName) {
    var func = fp[methodName],
        isReduce = methodName == 'reduce';

    QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments when iterating an array', function(assert) {
      assert.expect(1);

      var args,
          array = [1, 2, 3];

      func(function() {
        args || (args = slice.call(arguments));
      })(0, array);

      assert.deepEqual(args, isReduce ? [0, 1] : [0, 3]);
    });

    QUnit.test('`_.' + methodName + '` should provide the correct `iteratee` arguments when iterating an object', function(assert) {
      assert.expect(1);

      var args,
          object = { 'a': 1, 'b': 2 },
          isFIFO = _.keys(object)[0] == 'a';

      var expected = isFIFO
        ? (isReduce ? [0, 1] : [0, 2])
        : (isReduce ? [0, 2] : [0, 1]);

      func(function() {
        args || (args = slice.call(arguments));
      })(0, object);

      assert.deepEqual(args, expected);
    });
  });

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.runInContext');

  (function() {
    QUnit.test('should return a converted lodash instance', function(assert) {
      assert.expect(1);

      assert.strictEqual(typeof fp.runInContext({}).curryN, 'function');
    });

    QUnit.test('should convert by name', function(assert) {
      assert.expect(1);

      if (!document) {
        var runInContext = convert('runInContext', _.runInContext);
        assert.strictEqual(typeof runInContext({}).curryN, 'function');
      }
      else {
        skipTest(assert);
      }
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.uniqBy');

  (function() {
    var objects = [{ 'a': 2 }, { 'a': 3 }, { 'a': 1 }, { 'a': 2 }, { 'a': 3 }, { 'a': 1 }];

    QUnit.test('should work with an `iteratee` argument', function(assert) {
      assert.expect(1);

      var expected = objects.slice(0, 3);

      var actual = fp.uniqBy(function(object) {
        return object.a;
      })(objects);

      assert.deepEqual(actual, expected);
    });

    QUnit.test('should provide the correct `iteratee` arguments', function(assert) {
      assert.expect(1);

      var args;

      fp.uniqBy(function() {
        args || (args = slice.call(arguments));
      })(objects);

      assert.deepEqual(args, [objects[0]]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.zip');

  (function() {
    QUnit.test('should zip together two arrays', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.zip([1, 2], [3, 4]), [[1, 3], [2, 4]]);
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('fp.zipObject');

  (function() {
    QUnit.test('should zip together key/value arrays into an object', function(assert) {
      assert.expect(1);

      assert.deepEqual(fp.zipObject(['a', 'b'], [1, 2]), { 'a': 1, 'b': 2 });
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('mutation methods');

  (function() {
    var array = [1, 2, 3],
        object = { 'a': 1 },
        deepObject = { 'a': { 'b': 2, 'c': 3 } };

    QUnit.test('should not mutate values', function(assert) {
      assert.expect(32);

      function Foo() {}
      Foo.prototype = { 'b': 2 };

      var value = _.clone(object),
          actual = fp.assign({ 'b': 2 }, value);

      assert.deepEqual(value, object, 'fp.assign');
      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assign');

      value = _.clone(object);
      actual = fp.assignWith(function(objValue, srcValue) {
        return srcValue;
      }, { 'b': 2 }, value);

      assert.deepEqual(value, object, 'fp.assignWith');
      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.assignWith');

      value = _.clone(object);
      actual = fp.defaults({ 'a': 2, 'b': 2 }, value);

      assert.deepEqual(value, object, 'fp.defaults');
      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.defaults');

      value = _.clone(object);
      value.b = { 'c': 1 };
      actual = fp.defaultsDeep({ 'b': { 'c': 2, 'd': 2 } }, value);

      assert.deepEqual(value, { 'a': 1, 'b': { 'c': 1 } } , 'fp.defaultsDeep');
      assert.deepEqual(actual, { 'a': 1, 'b': { 'c': 1, 'd': 2 } }, 'fp.defaultsDeep');

      value = _.clone(object);
      actual = fp.extend(new Foo, value);

      assert.deepEqual(value, object, 'fp.extend');
      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.extend');

      value = _.clone(object);
      actual = fp.extendWith(function(objValue, srcValue) {
        return srcValue;
      }, new Foo, value);

      assert.deepEqual(value, object, 'fp.extendWith');
      assert.deepEqual(actual, { 'a': 1, 'b': 2 }, 'fp.extendWith');

      value = _.clone(array);
      actual = fp.fill(1, 2, '*', value);

      assert.deepEqual(value, array, 'fp.fill');
      assert.deepEqual(actual, [1, '*', 3], 'fp.fill');

      value = { 'a': { 'b': 2 } };
      actual = fp.merge({ 'a': { 'c': 3 } }, value);

      assert.deepEqual(value, { 'a': { 'b': 2 } }, 'fp.merge');
      assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 } }, 'fp.merge');

      value = { 'a': [1] };
      actual = fp.mergeWith(function(objValue, srcValue) {
        if (_.isArray(objValue)) {
          return objValue.concat(srcValue);
        }
      }, { 'a': [2, 3] }, value);

      assert.deepEqual(value, { 'a': [1] }, 'fp.mergeWith');
      assert.deepEqual(actual, { 'a': [1, 2, 3] }, 'fp.mergeWith');

      value = _.clone(array);
      actual = fp.pull(2, value);

      assert.deepEqual(value, array, 'fp.pull');
      assert.deepEqual(actual, [1, 3], 'fp.pull');

      value = _.clone(array);
      actual = fp.pullAll([1, 3], value);

      assert.deepEqual(value, array, 'fp.pullAll');
      assert.deepEqual(actual, [2], 'fp.pullAll');

      value = _.clone(array);
      actual = fp.pullAt([0, 2], value);

      assert.deepEqual(value, array, 'fp.pullAt');
      assert.deepEqual(actual, [2], 'fp.pullAt');

      value = _.clone(array);
      actual = fp.remove(function(value) {
        return value === 2;
      }, value);

      assert.deepEqual(value, array, 'fp.remove');
      assert.deepEqual(actual, [1, 3], 'fp.remove');

      value = _.clone(array);
      actual = fp.reverse(value);

      assert.deepEqual(value, array, 'fp.reverse');
      assert.deepEqual(actual, [3, 2, 1], 'fp.reverse');

      value = _.cloneDeep(deepObject);
      actual = fp.set(3, 'a.b', value);

      assert.deepEqual(value, deepObject, 'fp.set');
      assert.deepEqual(actual, { 'a': { 'b': 3, 'c': 3 } }, 'fp.set');

      value = _.cloneDeep(deepObject);
      actual = fp.setWith(Object, 4, 'd.e', value);

      assert.deepEqual(value, deepObject, 'fp.setWith');
      assert.deepEqual(actual, { 'a': { 'b': 2, 'c': 3 }, 'd': { 'e': 4 } }, 'fp.setWith');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.module('with methods');

  (function() {
    var array = [1, 2, 3],
        object = { 'a': 1 };

    QUnit.test('should provide the correct `customizer` arguments', function(assert) {
      assert.expect(3);

      var args,
          value = _.clone(object);

      var actual = fp.assignWith(function(objValue, srcValue) {
        args || (args = _.map(arguments, _.cloneDeep));
        return srcValue;
      }, { 'b': 2 }, value);

      assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.assignWith');

      args = undefined;
      value = _.clone(object);
      actual = fp.extendWith(function(objValue, srcValue) {
        args || (args = _.map(arguments, _.cloneDeep));
        return srcValue;
      }, { 'b': 2 }, value);

      assert.deepEqual(args, [undefined, 2, 'b', { 'a': 1 }, { 'b': 2 }], 'fp.extendWith');

      var stack = { '__data__': { 'array': [], 'map': null } },
          expected = [[1], [2, 3], 'a', { 'a': [ 1 ] }, { 'a': [2, 3] }, stack];

      args = undefined;
      value = { 'a': [1] };
      actual = fp.mergeWith(function(objValue, srcValue) {
        args || (args = _.map(arguments, _.cloneDeep));
        if (_.isArray(objValue)) {
          return objValue.concat(srcValue);
        }
      }, { 'a': [2, 3] }, value);

      args[5] = _.omitBy(args[5], _.isFunction);
      assert.deepEqual(args, expected, 'fp.mergeWith');
    });
  }());

  /*--------------------------------------------------------------------------*/

  QUnit.config.asyncRetries = 10;
  QUnit.config.hidepassed = true;

  if (!document) {
    QUnit.config.noglobals = true;
    QUnit.load();
  }
}.call(this));