From 2bfd3075a08d9c5f653e1c0c326e91d8feede5c6 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 3 Oct 2016 12:24:50 +0100 Subject: [PATCH 01/10] next changelog init --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ed4961880..aaa6c325ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ Alfresco JS API _This project provides a JavaScript client API into the v1 Alfresco REST API_ + +# [0.3.6](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.6) (2016-xx-xx) + + # [0.3.5](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.5) (2016-09-26) From 2ec6e276e9e79acfdb3dbaa0d2cae29df0cf315b Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 24 Oct 2016 12:25:27 +0100 Subject: [PATCH 02/10] separate getRestFieldValues in getRestFieldValues and getRestFieldValuesColumn #71 --- CHANGELOG.md | 3 ++ src/alfresco-activiti-rest-api/README.md | 2 +- .../docs/TaskApi.md | 10 ++--- .../src/api/TaskApi.js | 4 +- test/activitiTaskApi.spec.js | 40 +++++++++++++++++++ test/mockObjects/activiti/tasksMock.js | 32 +++++++++++++++ 6 files changed, 83 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index aaa6c325ae..789a00a44e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ _This project provides a JavaScript client API into the v1 Alfresco REST API_ # [0.3.6](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.6) (2016-xx-xx) +## Fix +- [separate getRestFieldValues in getRestFieldValues and getRestFieldValuesColumn #71](https://github.com/Alfresco/alfresco-js-api/issues/71) + # [0.3.5](https://github.com/Alfresco/alfresco-js-api/releases/tag/0.3.5) (2016-09-26) diff --git a/src/alfresco-activiti-rest-api/README.md b/src/alfresco-activiti-rest-api/README.md index ff7f0571bf..e4b7832bda 100755 --- a/src/alfresco-activiti-rest-api/README.md +++ b/src/alfresco-activiti-rest-api/README.md @@ -201,7 +201,7 @@ Class | Method | HTTP request | Description *ActivitiPublicRestApi.TaskApi* | [**filterTasks**](docs/TaskApi.md#filterTasks) | **POST** /api/enterprise/tasks/filter | Filter list of Task *ActivitiPublicRestApi.TaskApi* | [**getChecklist**](docs/TaskApi.md#getChecklist) | **GET** /api/enterprise/tasks/{taskId}/checklist | Retrieve Checklist added to a task *ActivitiPublicRestApi.TaskApi* | [**getRelatedContentForTask**](docs/TaskApi.md#getRelatedContentForTask) | **GET** /api/enterprise/tasks/{taskId}/content | Retrieve which content is attached to a task -*ActivitiPublicRestApi.TaskApi* | [**getRestFieldValues**](docs/TaskApi.md#getRestFieldValues) | **GET** /api/enterprise/task-forms/{taskId}/form-values/{field}/{column} | Retrieve Column Field Values +*ActivitiPublicRestApi.TaskApi* | [**getRestFieldValuesColumn**](docs/TaskApi.md#getRestFieldValuesColumn) | **GET** /api/enterprise/task-forms/{taskId}/form-values/{field}/{column} | Retrieve Column Field Values *ActivitiPublicRestApi.TaskApi* | [**getRestFieldValues**](docs/TaskApi.md#getRestFieldValues) | **GET** /api/enterprise/task-forms/{taskId}/form-values/{field} | Retrieve Populated Field Values *ActivitiPublicRestApi.TaskApi* | [**getTaskComments**](docs/TaskApi.md#getTaskComments) | **GET** /api/enterprise/tasks/{taskId}/comments | Comment list added to Task *ActivitiPublicRestApi.TaskApi* | [**getTaskForm**](docs/TaskApi.md#getTaskForm) | **GET** /api/enterprise/task-forms/{taskId} | Retrieve Task Form diff --git a/src/alfresco-activiti-rest-api/docs/TaskApi.md b/src/alfresco-activiti-rest-api/docs/TaskApi.md index a8ffc7b398..efc4d79bf7 100755 --- a/src/alfresco-activiti-rest-api/docs/TaskApi.md +++ b/src/alfresco-activiti-rest-api/docs/TaskApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description [**filterTasks**](TaskApi.md#filterTasks) | **POST** /api/enterprise/tasks/filter | Filter list of Task [**getChecklist**](TaskApi.md#getChecklist) | **GET** /api/enterprise/tasks/{taskId}/checklist | Retrieve Checklist added to a task [**getRelatedContentForTask**](TaskApi.md#getRelatedContentForTask) | **GET** /api/enterprise/tasks/{taskId}/content | Retrieve which content is attached to a task -[**getRestFieldValues**](TaskApi.md#getRestFieldValues) | **GET** /api/enterprise/task-forms/{taskId}/form-values/{field}/{column} | Retrieve Column Field Values +[**getRestFieldValuesColumn**](TaskApi.md#getRestFieldValuesColumn) | **GET** /api/enterprise/task-forms/{taskId}/form-values/{field}/{column} | Retrieve Column Field Values [**getRestFieldValues**](TaskApi.md#getRestFieldValues) | **GET** /api/enterprise/task-forms/{taskId}/form-values/{field} | Retrieve Populated Field Values [**getTaskComments**](TaskApi.md#getTaskComments) | **GET** /api/enterprise/tasks/{taskId}/comments | Comment list added to Task [**getTaskForm**](TaskApi.md#getTaskForm) | **GET** /api/enterprise/task-forms/{taskId} | Retrieve Task Form @@ -537,9 +537,9 @@ No authorization required - **Content-Type**: application/json - **Accept**: application/json - -# **getRestFieldValues** -> [FormValueRepresentation] getRestFieldValues(taskId, field, column) + +# **getRestFieldValuesColumn** +> [FormValueRepresentation] getRestFieldValuesColumn(taskId, field, column) Retrieve Column Field Values @@ -555,7 +555,7 @@ var field = "field_example"; // String | field var column = "column_example"; // String | column -this.alfrescoJsApi.activiti.taskApi.getRestFieldValues(taskId, field, column); +this.alfrescoJsApi.activiti.taskApi.getRestFieldValuesColumn(taskId, field, column); ``` ### Parameters diff --git a/src/alfresco-activiti-rest-api/src/api/TaskApi.js b/src/alfresco-activiti-rest-api/src/api/TaskApi.js index e27c0bd290..ea61ee48fd 100755 --- a/src/alfresco-activiti-rest-api/src/api/TaskApi.js +++ b/src/alfresco-activiti-rest-api/src/api/TaskApi.js @@ -674,7 +674,7 @@ } /** - * Function to receive the result of the getRestFieldValues operation. + * Function to receive the result of the getRestFieldValuesColumn operation. * @param {String} error Error message, if any. * @param {Array.} data The data returned by the service call. * @param {String} response The complete HTTP response. @@ -687,7 +687,7 @@ * @param {String} field field * @param {String} column column */ - this.getRestFieldValues = function(taskId, field, column) { + this.getRestFieldValuesColumn = function(taskId, field, column) { var postBody = null; // verify the required parameter 'taskId' is set diff --git a/test/activitiTaskApi.spec.js b/test/activitiTaskApi.spec.js index 9fba32fa37..ee0578ea55 100644 --- a/test/activitiTaskApi.spec.js +++ b/test/activitiTaskApi.spec.js @@ -141,4 +141,44 @@ describe('Activiti Task Api', function () { done(); }); }); + + it('Get getRestFieldValuesColumn ', function (done) { + this.tasksMock.get200getTaskForm(); + + var taskId = 2518; + + this.alfrescoJsApi.activiti.taskApi.getTaskForm(taskId).then((data)=> { + expect(data.name).equal('Metadata'); + expect(data.fields[0].name).equal('Label'); + expect(data.fields[0].fieldType).equal('ContainerRepresentation'); + done(); + }); + }); + + it('get form field values that are populated through a REST backend', function (done) { + this.tasksMock.get200getRestFieldValuesColumn(); + + var taskId = '1'; // String | taskId + var field = 'label'; // String | field + var column = 'user'; // String | column + + this.alfrescoJsApi.activiti.taskApi.getRestFieldValuesColumn(taskId, field, column).then((data)=> { + done(); + },(error)=> { + console.log(error); + }); + }); + + it('get form field values that are populated through a REST backend Specific case to retrieve information on a specific column', function (done) { + this.tasksMock.get200getRestFieldValues(); + + var taskId = '2'; // String | taskId + var field = 'label'; // String | field + + this.alfrescoJsApi.activiti.taskApi.getRestFieldValues(taskId, field).then((data)=> { + done(); + },(error)=> { + console.log(error); + }); + }); }); diff --git a/test/mockObjects/activiti/tasksMock.js b/test/mockObjects/activiti/tasksMock.js index c3982b91e2..f38e80e62c 100644 --- a/test/mockObjects/activiti/tasksMock.js +++ b/test/mockObjects/activiti/tasksMock.js @@ -915,6 +915,38 @@ class TasksMock extends BaseMock { }); } + get200getRestFieldValuesColumn() { + nock('http://127.0.0.1:9999', {'encodedQueryParams': true}) + .get('/activiti-app/api/enterprise/task-forms/1/form-values/label/user') + .reply(200, [{'id': '1', 'name': 'Leanne Graham'}, {'id': '2', 'name': 'Ervin Howell'}, { + 'id': '3', + 'name': 'Clementine Bauch' + }, {'id': '4', 'name': 'Patricia Lebsack'}, {'id': '5', 'name': 'Chelsey Dietrich'}, { + 'id': '6', + 'name': 'Mrs. Dennis Schulist' + }, {'id': '7', 'name': 'Kurtis Weissnat'}, {'id': '8', 'name': 'Nicholas Runolfsdottir V'}, { + 'id': '9', + 'name': 'Glenna Reichert' + }, {'id': '10', 'name': 'Clementina DuBuque'}]); + + } + + get200getRestFieldValues() { + nock('http://127.0.0.1:9999', {'encodedQueryParams': true}) + .get('/activiti-app/api/enterprise/task-forms/2/form-values/label') + .reply(200, [{'id': '1', 'name': 'Leanne Graham'}, {'id': '2', 'name': 'Ervin Howell'}, { + 'id': '3', + 'name': 'Clementine Bauch' + }, {'id': '4', 'name': 'Patricia Lebsack'}, {'id': '5', 'name': 'Chelsey Dietrich'}, { + 'id': '6', + 'name': 'Mrs. Dennis Schulist' + }, {'id': '7', 'name': 'Kurtis Weissnat'}, {'id': '8', 'name': 'Nicholas Runolfsdottir V'}, { + 'id': '9', + 'name': 'Glenna Reichert' + }, {'id': '10', 'name': 'Clementina DuBuque'}]); + + } + } module.exports = TasksMock; From 62c8152c78aa70891489aa578d2b2e4c48342f53 Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Sat, 22 Oct 2016 19:32:07 +0100 Subject: [PATCH 03/10] fix tslint and declaration file #68 --- CHANGELOG.md | 1 + package.json | 2 +- typescript/alfresco-js-api.d.ts | 1258 +++++++++++++++---------------- 3 files changed, 630 insertions(+), 631 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 789a00a44e..b5fef387ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ _This project provides a JavaScript client API into the v1 Alfresco REST API_ ## Fix - [separate getRestFieldValues in getRestFieldValues and getRestFieldValuesColumn #71](https://github.com/Alfresco/alfresco-js-api/issues/71) +- [d.ts file doesn't work properly](https://github.com/Alfresco/alfresco-js-api/issues/68) diff --git a/package.json b/package.json index f342041f2d..70b18b5786 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "bundle": "browserify -s AlfrescoApi main.js -o dist/alfresco-js-api.js -t [ babelify --sourceMapsAbsolute --presets es2015 ] ", "minify": "browserify -s AlfrescoApi dist/alfresco-js-api.js -d -p [minifyify --no-map] > dist/alfresco-js-api.min.js", "watchify": "watchify -s AlfrescoApi main.js -o dist/alfresco-js-api.js", - "tslint": "tslint -c tslint.json bundle.d.ts", + "tslint": "tslint -c tslint.json typescript/alfresco-js-api.d.ts", "toc": "markdown-toc -i README.md && markdown-toc -i test/mockObjects/README.md" }, "repository": { diff --git a/typescript/alfresco-js-api.d.ts b/typescript/alfresco-js-api.d.ts index 3fe61c27f5..7dc89b2f67 100644 --- a/typescript/alfresco-js-api.d.ts +++ b/typescript/alfresco-js-api.d.ts @@ -1,630 +1,628 @@ -interface FolderEntity { - items: DocumentEntity[]; -} - -interface DocumentEntity { - nodeRef: string; - nodeType: string; - type: string; - mimetype: string; - isFolder: boolean; - isLink: boolean; - fileName: string; - displayName: string; - status: string; - title: string; - description: string; - author: string; - createdOn: string; - createdBy: string; - createdByUser: string; - modifiedOn: string; - modifiedBy: string; - modifiedByUser: string; - lockedBy: string; - lockedByUser: string; - size: number; - version: string; - contentUrl: string; - webdavUrl: string; - actionSet: string; - tags: string[]; - activeWorkflows: string; - location: LocationEntity; -} - -interface LocationEntity { - repositoryId: string; - site: string; - siteTitle: string; - container: string; - path: string; - file: string; - parent: LocationParentEntity; -} - -interface LocationParentEntity { - nodeRef: string; -} - -interface NodePaging { - list: NodePagingList; -} - -interface DeletedNodesPaging { - list: DeletedNodesPagingList; -} - -interface NodePagingList { - pagination: Pagination; - entries: MinimalNodeEntity[]; -} - -interface DeletedNodesPagingList { - pagination: Pagination; - entries: DeletedNodeEntity[]; -} - -export class Pagination { - count: number; - hasMoreItems: boolean; - totalItems: number; - skipCount: number; - maxItems: number; -} - -interface MinimalNodeEntity { - entry: MinimalNodeEntryEntity; -} - -interface DeletedNodeEntity { - entry: DeletedNodeMinimalEntry; -} - -interface MinimalNode { - id: string; - parentId: string; - name: string; - nodeType: string; - isFolder: boolean; - isFile: boolean; - modifiedAt: Date; - modifiedByUser: UserInfo; - createdAt: Date; - createdByUser: UserInfo; - content: ContentInfo; - path: PathInfoEntity; - properties: NodeProperties; -} - -interface MinimalNodeEntryEntity extends MinimalNode { -} - -interface NodeProperties { - [key: string]: any; -} - -interface DeletedNodeMinimalEntry extends MinimalNode { - archivedAt: Date; - archivedByUser: UserInfo; -} - -interface UserInfo { - displayName: string; - id: string; -} - -interface ContentInfo { - mimeType: string; - mimeTypeName: string; - sizeInBytes: number; - encoding: string; -} - -interface PathInfoEntity { - elements: PathElementEntity; - isComplete: boolean; - name: string; -} - -interface PathElementEntity { - id: string; - name: string; -} - -interface Core { - NodesApi: NodesApi; -} - -interface Auth { -} - -interface AuthMock { - new(host: string, username: string, password: string): AuthMock; - get201Response(forceTicket: string); - get403Response(); - get400Response(); - get401Response(); - get204ResponseLogout(); - get404ResponseLogout(); - rec(); - play(); - clearAll(); -} - -interface NodeMock { - new(host: string): NodeMock; - get200ResponseChildren(); - get200ResponseSingleFileFolder(); - get404ChildrenNotExist(); - get404FileFolderNotExist(); - get204SuccessfullyDeleted(); - get403DeletePermissionDenied(); - get404DeleteNotFound(); - get404DeletePermanentlyNotFound() ; - get200CreationFolder(); - get409CreationFolderNewNameClashes(); - get201CreationFolderNewNameNotClashes(); - rec(); - play(); - clearAll(); -} - -interface UploadMock { - new(host: string): UploadMock; - get201CreationFile(); - get201CreationFileAutoRename(); - get409CreationFileNewNameClashes(); - get401Response(); - rec(); - play(); - clearAll(); -} - -interface WebScriptMock { - new(host: string): WebScriptMock; - get200Response(); - get400Response(); - rec(); - play(); - clearAll(); -} - -interface TagMock { - new(host: string): TagMock; - get200Response(); - get401Response(); - rec(); - play(); - clearAll(); -} - -interface RenditionMock { - new(host: string): RenditionMock; - get200RenditionList(); - createRendition200(); - get200RenditionResponse(); - rec(); - play(); - clearAll(); -} - -interface ModelsMock { - new(host: string): ModelsMock; - get200Response(); - rec(); - play(); - clearAll(); -} - -interface Mock { - Auth: AuthMock; - Node: NodeMock; - Upload: UploadMock; - WebScript: WebScriptMock; - ActivitiMock: ActivitiMock; - Tag: TagMock; - Models: ModelsMock; - UserFilters: UserFiltersMock; - Rendition: RenditionMock; -} - -interface ActivitiMock { - Auth: ActivitiAuthMock; - Process: ProcessMock; - Tasks: TasksMock; -} - -interface UserFiltersMock { - new(host: string, username: string, password: string): UserFiltersMock; - get200getUserTaskFilters(); -} - -interface ActivitiAuthMock { - new(host: string, username: string, password: string): ActivitiAuthMock; - get200Response(); - get200ResponseLogout() - get401Response(); -} - -interface ProcessMock { - new(host: string): ProcessMock; - get200Response(); -} - -interface TasksMock { - new(host: string): TasksMock; - get200Response(); -} - -interface Activiti { - -} - -interface NodesApi { - new(client: ApiClient): NodesApi; - getNodeInfo(nodeId: string): Promise; - getNodeChildren(nodeId: string, opts: any): Promise; - deleteNode(nodeId: string): Promise; - createFolder(name: string, relativePath: string, nodeId?: string, opts?: any): Promise; - getNode(nodeId: string, opts: any): Promise; - getDeletedNodes(opts: any): Promise; - purgeDeletedNode(nodeId: string): Promise; - getDeletedNode(nodeId: string, opts: any): Promise; - restoreNode(nodeId: string): Promise; - addNode(nodeId: string, nodeBody: any, opts: any); -} - -interface ApiClient { - new(client: any): ApiClient; -} - -interface BpmAuth { - new(config: any): BpmAuth; -} - -interface activiti { - new(config: any): activiti; - aboutApi: any; - adminEndpointsApi: any; - adminGroupsApi: any; - adminTenantsApi: any; - adminUsersApi: any; - alfrescoApi: any; - appsApi: any; - appsDefinitionApi: any; - appsRuntimeApi: any; - commentsApi: any; - contentApi: any; - contentRenditionApi: any; - editorApi: any; - groupsApi: any; - iDMSyncApi: any; - integrationAccountApi: any; - integrationAlfrescoCloudApi: any; - integrationAlfrescoOnPremiseApi: any; - integrationApi: any; - integrationBoxApi: any; - integrationDriveApi: any; - modelBpmnApi: any; - modelsApi: any; - modelsHistoryApi: any; - processApi: any; - processDefinitionsApi: any; - processDefinitionsFormApi: any; - processInstancesApi: any; - processInstancesInformationApi: any; - processInstancesListingApi: any; - processScopeApi: any; - profileApi: any; - scriptFileApi: any; - systemPropertiesApi: any; - taskActionsApi: any; - taskApi: any; - taskCheckListApi: any; - taskFormsApi: any; - temporaryApi: any; - userApi: any; - userFiltersApi: any; - usersWorkflowApi: any; - - /*Models*/ - AbstractGroupRepresentation: any; - AbstractRepresentation: any; - AbstractUserRepresentation: any; - AddGroupCapabilitiesRepresentation: any; - AppDefinition: any; - AppDefinitionPublishRepresentation: any; - AppDefinitionRepresentation: any; - AppDefinitionUpdateResultRepresentation: any; - AppModelDefinition: any; - ArrayNode: any; - BoxUserAccountCredentialsRepresentation: any; - BulkUserUpdateRepresentation: any; - ChangePasswordRepresentation: any; - ChecklistOrderRepresentation: any; - CommentRepresentation: any; - CompleteFormRepresentation: any; - ConditionRepresentation: any; - CreateEndpointBasicAuthRepresentation: any; - CreateProcessInstanceRepresentation: any; - CreateTenantRepresentation: any; - EndpointBasicAuthRepresentation: any; - EndpointConfigurationRepresentation: any; - EndpointRequestHeaderRepresentation: any; - EntityAttributeScopeRepresentation: any; - EntityVariableScopeRepresentation: any; - File: any; - FormDefinitionRepresentation: any; - FormFieldRepresentation: any; - FormJavascriptEventRepresentation: any; - FormOutcomeRepresentation: any; - FormRepresentation: any; - FormSaveRepresentation: any; - FormScopeRepresentation: any; - FormTabRepresentation: any; - FormValueRepresentation: any; - GroupCapabilityRepresentation: any; - GroupRepresentation: any; - ImageUploadRepresentation: any; - LayoutRepresentation: any; - LightAppRepresentation: any; - LightGroupRepresentation: any; - LightTenantRepresentation: any; - LightUserRepresentation: any; - MaplongListstring: any; - MapstringListEntityVariableScopeRepresentation: any; - MapstringListVariableScopeRepresentation: any; - Mapstringstring: any; - ModelRepresentation: any; - ObjectNode: any; - OptionRepresentation: any; - ProcessInstanceFilterRepresentation: any; - ProcessInstanceFilterRequestRepresentation: any; - ProcessInstanceRepresentation: any; - ProcessScopeIdentifierRepresentation: any; - ProcessScopeRepresentation: any; - ProcessScopesRequestRepresentation: any; - PublishIdentityInfoRepresentation: any; - RelatedContentRepresentation: any; - ResetPasswordRepresentatio: any; - RestVariable: any; - ResultListDataRepresentation: any; - RuntimeAppDefinitionSaveRepresentation: any; - SaveFormRepresentation: any; - SyncLogEntryRepresentation: any; - SystemPropertiesRepresentation: any; - TaskFilterRepresentation: any; - TaskFilterRequestRepresentation: any; - TaskRepresentation: any; - TaskUpdateRepresentation: any; - TenantEvent: any; - TenantRepresentation: any; - UserAccountCredentialsRepresentation: any; - UserActionRepresentation: any; - UserFilterOrderRepresentation: any; - UserProcessInstanceFilterRepresentation: any; - UserRepresentation: any; - UserTaskFilterRepresentation: any; - ValidationErrorRepresentation: any; - VariableScopeRepresentation: any; -} - -interface core { - associationsApi: any; - changesApi: any; - childAssociationsApi: any; - commentsApi: any; - favoritesApi: any; - networksApi: any; - nodesApi: any; - peopleApi: any; - ratingsApi: any; - renditionsApi: any; - searchApi: any; - sharedlinksApi: any; - sitesApi: any; - tagsApi: any; - - /*Models*/ - Activity: any; - ActivityActivitySummary: any; - ActivityEntry: any; - ActivityPaging: any; - ActivityPagingList: any; - AssocChildBody: any; - AssocInfo: any; - AssocTargetBody: any; - ChildAssocInfo: any; - Comment: any; - CommentBody: any; - CommentBody1: any; - CommentEntry: any; - CommentPaging: any; - CommentPagingList: any; - Company: any; - ContentInfo: any; - CopyBody: any; - DeletedNode: any; - DeletedNodeEntry: any; - DeletedNodeMinimal: any; - DeletedNodeMinimalEntry: any; - DeletedNodesPaging: any; - DeletedNodesPagingList: any; - EmailSharedLinkBody: any; - Error: any; - ErrorError: any; - Favorite: any; - FavoriteBody: any; - FavoriteEntry: any; - FavoritePaging: any; - FavoritePagingList: any; - FavoriteSiteBody: any; - InlineResponse201: any; - InlineResponse201Entry: any; - MoveBody: any; - NetworkQuota: any; - NodeAssocMinimal: any; - NodeAssocMinimalEntry: any; - NodeAssocPaging: any; - NodeAssocPagingList: any; - NodeBody: any; - NodeBody1: any; - NodeChildAssocMinimal: any; - NodeChildAssocMinimalEntry: any; - NodeChildAssocPaging: any; - NodeChildAssocPagingList: any; - NodeEntry: any; - NodeFull: any; - NodeMinimal: any; - NodeMinimalEntry: any; - NodePaging: any; - NodePagingList: any; - NodeSharedLink: any; - NodeSharedLinkEntry: any; - NodeSharedLinkPaging: any; - NodeSharedLinkPagingList: any; - NodesnodeIdchildrenContent: any; - Pagination: any; - PathElement: any; - PathInfo: any; - Person: any; - PersonEntry: any; - PersonNetwork: any; - PersonNetworkEntry: any; - PersonNetworkPaging: any; - PersonNetworkPagingList: any; - Preference: any; - PreferenceEntry: any; - PreferencePaging: any; - PreferencePagingList: any; - Rating: any; - RatingAggregate: any; - RatingBody: any; - RatingEntry: any; - RatingPaging: any; - RatingPagingList: any; - Rendition: any; - RenditionBody: any; - RenditionEntry: any; - RenditionPaging: any; - RenditionPagingList: any; - SharedLinkBody: any; - Site: any; - SiteBody: any; - SiteContainer: any; - SiteContainerEntry: any; - SiteContainerPaging: any; - SiteEntry: any; - SiteMember: any; - SiteMemberBody: any; - SiteMemberEntry: any; - SiteMemberPaging: any; - SiteMemberRoleBody: any; - SiteMembershipBody: any; - SiteMembershipBody1: any; - SiteMembershipRequest: any; - SiteMembershipRequestEntry: any; - SiteMembershipRequestPaging: any; - SiteMembershipRequestPagingList: any; - SitePaging: any; - SitePagingList: any; - Tag: any; - TagBody: any; - TagBody1: any; - TagEntry: any; - TagPaging: any; - TagPagingList: any; - UserInfo: any; -} - -export class AlfrescoApiConfig { - hostEcm: string; - hostBpm: string; - contextRoot: string; - provider: string; - ticketEcm: string; - ticketBpm: string; - disableCsrf: boolean; -} - -export interface ContentApi { - new(ecmAuth: any); - - getDocumentThumbnailUrl(documentId: string): string; - getDocumentPreviewUrl(documentId: string): string; - getContentUrl(documentId: string): string; -} - -export interface AuthApi { - new(config: AlfrescoApiConfig): AuthApi; - - changeHost(host: string); - login(username: string, password: string): Promise; - logout(): Promise; - setTicket(ticket: string); - getTicket(): string; - isLoggedIn(): boolean; - - getClient(): any; -} - -export interface BpmAuthApi extends AuthApi { - -} - -export interface EcmAuthApi extends AuthApi { - validateTicket(): Promise; -} - -export interface AlfrescoJsApi { - new(config: AlfrescoApiConfig): AlfrescoJsApi; - - config: AlfrescoApiConfig; - - Activiti: Activiti; - Auth: Auth; - Core: Core; - Mock: Mock; - - bpmAuth: BpmAuthApi; - ecmAuth: EcmAuthApi; - - activiti: activiti; - core: core; - - search: any; - nodes: NodesApi; - content: ContentApi; - upload: any; - webScript: any; - - createClient(): any; - getClient(): any; - getClientAuth(): any; - - changeEcmHost(ecmHost: string); - changeBpmHost(bpmHost: string); - changeCsrfConfig(disableCsrf: boolean); - - getNodeInfo(nodeId: string): Promise; - deleteNode(nodeId: string): any; - deleteNodePermanent(nodeId: string): any; - - uploadFile(fileDefinition: File, relativePath: string, nodeId: string, nodeBody: any, opts: any): any; - createFolder(name: string, relativePath: string, nodeId: string): any; - - isLoggedIn(): boolean; - login(username: string, password: string): Promise; - logout(): Promise; - loginTicket(ticket: string): any; - - getDocumentThumbnailUrl(documentId: string): any; - getContentUrl(documentId: string): any; - - getTicket(): Array; - getTicketBpm(): string; - getTicketEcm(): string; - - setTicket(ticketEcm: any, ticketBpm: any): void; -} +declare var AlfrescoApi: AlfrescoApi.AlfrescoApi; + +declare namespace AlfrescoApi { + export interface AlfrescoApi { + new(config: AlfrescoApiConfig): AlfrescoApi; + + config: AlfrescoApiConfig; + + Activiti: Activiti; + Auth: Auth; + Core: Core; + Mock: Mock; + + bpmAuth: BpmAuthApi; + ecmAuth: EcmAuthApi; + + activiti: Activiti; + core: Core; + + search: any; + nodes: NodesApi; + content: ContentApi; + upload: any; + webScript: any; + + createClient(): any; + getClient(): any; + getClientAuth(): any; + + changeEcmHost(ecmHost: string); + changeBpmHost(bpmHost: string); + changeCsrfConfig(disableCsrf: boolean); + + getNodeInfo(nodeId: string): Promise; + deleteNode(nodeId: string): any; + deleteNodePermanent(nodeId: string): any; + + uploadFile(fileDefinition: File, relativePath: string, nodeId: string, nodeBody: any, opts: any): any; + createFolder(name: string, relativePath: string, nodeId: string): any; + + isLoggedIn(): boolean; + login(username: string, password: string): Promise; + logout(): Promise; + loginTicket(ticket: string): any; + + getDocumentThumbnailUrl(documentId: string): any; + getContentUrl(documentId: string): any; + + getTicket(): Array; + getTicketBpm(): string; + getTicketEcm(): string; + + setTicket(ticketEcm: any, ticketBpm: any): void; + } + + export interface FolderEntity { + items: DocumentEntity[]; + } + + export interface DocumentEntity { + nodeRef: string; + nodeType: string; + type: string; + mimetype: string; + isFolder: boolean; + isLink: boolean; + fileName: string; + displayName: string; + status: string; + title: string; + description: string; + author: string; + createdOn: string; + createdBy: string; + createdByUser: string; + modifiedOn: string; + modifiedBy: string; + modifiedByUser: string; + lockedBy: string; + lockedByUser: string; + size: number; + version: string; + contentUrl: string; + webdavUrl: string; + actionSet: string; + tags: string[]; + activeWorkflows: string; + location: LocationEntity; + } + + export interface LocationEntity { + repositoryId: string; + site: string; + siteTitle: string; + container: string; + path: string; + file: string; + parent: LocationParentEntity; + } + + export interface LocationParentEntity { + nodeRef: string; + } + + export interface NodePaging { + list: NodePagingList; + } + + export interface DeletedNodesPaging { + list: DeletedNodesPagingList; + } + + export interface NodePagingList { + pagination: Pagination; + entries: MinimalNodeEntity[]; + } + + export interface DeletedNodesPagingList { + pagination: Pagination; + entries: DeletedNodeEntity[]; + } + + export interface Pagination { + count: number; + hasMoreItems: boolean; + totalItems: number; + skipCount: number; + maxItems: number; + } + + export interface MinimalNodeEntity { + entry: MinimalNodeEntryEntity; + } + + export interface DeletedNodeEntity { + entry: DeletedNodeMinimalEntry; + } + + export interface MinimalNode { + id: string; + parentId: string; + name: string; + nodeType: string; + isFolder: boolean; + isFile: boolean; + modifiedAt: Date; + modifiedByUser: UserInfo; + createdAt: Date; + createdByUser: UserInfo; + content: ContentInfo; + path: PathInfoEntity; + properties: NodeProperties; + } + + export interface MinimalNodeEntryEntity extends MinimalNode { + } + + export interface NodeProperties { + [key: string]: any; + } + + export interface DeletedNodeMinimalEntry extends MinimalNode { + archivedAt: Date; + archivedByUser: UserInfo; + } + + export interface UserInfo { + displayName: string; + id: string; + } + + export interface ContentInfo { + mimeType: string; + mimeTypeName: string; + sizeInBytes: number; + encoding: string; + } + + export interface PathInfoEntity { + elements: PathElementEntity; + isComplete: boolean; + name: string; + } + + export interface PathElementEntity { + id: string; + name: string; + } + + export interface Auth { + } + + export interface AuthMock { + new(host: string, username: string, password: string): AuthMock; + get201Response(forceTicket: string); + get403Response(); + get400Response(); + get401Response(); + get204ResponseLogout(); + get404ResponseLogout(); + rec(); + play(); + clearAll(); + } + + export interface NodeMock { + new(host: string): NodeMock; + get200ResponseChildren(); + get200ResponseSingleFileFolder(); + get404ChildrenNotExist(); + get404FileFolderNotExist(); + get204SuccessfullyDeleted(); + get403DeletePermissionDenied(); + get404DeleteNotFound(); + get404DeletePermanentlyNotFound() ; + get200CreationFolder(); + get409CreationFolderNewNameClashes(); + get201CreationFolderNewNameNotClashes(); + rec(); + play(); + clearAll(); + } + + export interface UploadMock { + new(host: string): UploadMock; + get201CreationFile(); + get201CreationFileAutoRename(); + get409CreationFileNewNameClashes(); + get401Response(); + rec(); + play(); + clearAll(); + } + + export interface WebScriptMock { + new(host: string): WebScriptMock; + get200Response(); + get400Response(); + rec(); + play(); + clearAll(); + } + + export interface TagMock { + new(host: string): TagMock; + get200Response(); + get401Response(); + rec(); + play(); + clearAll(); + } + + export interface RenditionMock { + new(host: string): RenditionMock; + get200RenditionList(); + createRendition200(); + get200RenditionResponse(); + rec(); + play(); + clearAll(); + } + + export interface ModelsMock { + new(host: string): ModelsMock; + get200Response(); + rec(); + play(); + clearAll(); + } + + export interface Mock { + Auth: AuthMock; + Node: NodeMock; + Upload: UploadMock; + WebScript: WebScriptMock; + ActivitiMock: ActivitiMock; + Tag: TagMock; + Models: ModelsMock; + UserFilters: UserFiltersMock; + Rendition: RenditionMock; + } + + export interface ActivitiMock { + Auth: ActivitiAuthMock; + Process: ProcessMock; + Tasks: TasksMock; + } + + export interface UserFiltersMock { + new(host: string, username: string, password: string): UserFiltersMock; + get200getUserTaskFilters(); + } + + export interface ActivitiAuthMock { + new(host: string, username: string, password: string): ActivitiAuthMock; + get200Response(); + get200ResponseLogout(); + get401Response(); + } + + export interface ProcessMock { + new(host: string): ProcessMock; + get200Response(); + } + + export interface TasksMock { + new(host: string): TasksMock; + get200Response(); + } + + export interface NodesApi { + new(client: ApiClient): NodesApi; + getNodeInfo(nodeId: string): Promise; + getNodeChildren(nodeId: string, opts: any): Promise; + deleteNode(nodeId: string): Promise; + createFolder(name: string, relativePath: string, nodeId?: string, opts?: any): Promise; + getNode(nodeId: string, opts: any): Promise; + getDeletedNodes(opts: any): Promise; + purgeDeletedNode(nodeId: string): Promise; + getDeletedNode(nodeId: string, opts: any): Promise; + restoreNode(nodeId: string): Promise; + addNode(nodeId: string, nodeBody: any, opts: any); + } + + export interface ApiClient { + new(client: any): ApiClient; + } + + export interface BpmAuth { + new(config: any): BpmAuth; + } + + export interface Activiti { + new(config: any): Activiti; + aboutApi: any; + adminEndpointsApi: any; + adminGroupsApi: any; + adminTenantsApi: any; + adminUsersApi: any; + alfrescoApi: any; + appsApi: any; + appsDefinitionApi: any; + appsRuntimeApi: any; + commentsApi: any; + contentApi: any; + contentRenditionApi: any; + editorApi: any; + groupsApi: any; + iDMSyncApi: any; + integrationAccountApi: any; + integrationAlfrescoCloudApi: any; + integrationAlfrescoOnPremiseApi: any; + integrationApi: any; + integrationBoxApi: any; + integrationDriveApi: any; + modelBpmnApi: any; + modelsApi: any; + modelsHistoryApi: any; + processApi: any; + processDefinitionsApi: any; + processDefinitionsFormApi: any; + processInstancesApi: any; + processInstancesInformationApi: any; + processInstancesListingApi: any; + processScopeApi: any; + profileApi: any; + scriptFileApi: any; + systemPropertiesApi: any; + taskActionsApi: any; + taskApi: any; + taskCheckListApi: any; + taskFormsApi: any; + temporaryApi: any; + userApi: any; + userFiltersApi: any; + usersWorkflowApi: any; + + /*Models*/ + AbstractGroupRepresentation: any; + AbstractRepresentation: any; + AbstractUserRepresentation: any; + AddGroupCapabilitiesRepresentation: any; + AppDefinition: any; + AppDefinitionPublishRepresentation: any; + AppDefinitionRepresentation: any; + AppDefinitionUpdateResultRepresentation: any; + AppModelDefinition: any; + ArrayNode: any; + BoxUserAccountCredentialsRepresentation: any; + BulkUserUpdateRepresentation: any; + ChangePasswordRepresentation: any; + ChecklistOrderRepresentation: any; + CommentRepresentation: any; + CompleteFormRepresentation: any; + ConditionRepresentation: any; + CreateEndpointBasicAuthRepresentation: any; + CreateProcessInstanceRepresentation: any; + CreateTenantRepresentation: any; + EndpointBasicAuthRepresentation: any; + EndpointConfigurationRepresentation: any; + EndpointRequestHeaderRepresentation: any; + EntityAttributeScopeRepresentation: any; + EntityVariableScopeRepresentation: any; + File: any; + FormDefinitionRepresentation: any; + FormFieldRepresentation: any; + FormJavascriptEventRepresentation: any; + FormOutcomeRepresentation: any; + FormRepresentation: any; + FormSaveRepresentation: any; + FormScopeRepresentation: any; + FormTabRepresentation: any; + FormValueRepresentation: any; + GroupCapabilityRepresentation: any; + GroupRepresentation: any; + ImageUploadRepresentation: any; + LayoutRepresentation: any; + LightAppRepresentation: any; + LightGroupRepresentation: any; + LightTenantRepresentation: any; + LightUserRepresentation: any; + MaplongListstring: any; + MapstringListEntityVariableScopeRepresentation: any; + MapstringListVariableScopeRepresentation: any; + Mapstringstring: any; + ModelRepresentation: any; + ObjectNode: any; + OptionRepresentation: any; + ProcessInstanceFilterRepresentation: any; + ProcessInstanceFilterRequestRepresentation: any; + ProcessInstanceRepresentation: any; + ProcessScopeIdentifierRepresentation: any; + ProcessScopeRepresentation: any; + ProcessScopesRequestRepresentation: any; + PublishIdentityInfoRepresentation: any; + RelatedContentRepresentation: any; + ResetPasswordRepresentatio: any; + RestVariable: any; + ResultListDataRepresentation: any; + RuntimeAppDefinitionSaveRepresentation: any; + SaveFormRepresentation: any; + SyncLogEntryRepresentation: any; + SystemPropertiesRepresentation: any; + TaskFilterRepresentation: any; + TaskFilterRequestRepresentation: any; + TaskRepresentation: any; + TaskUpdateRepresentation: any; + TenantEvent: any; + TenantRepresentation: any; + UserAccountCredentialsRepresentation: any; + UserActionRepresentation: any; + UserFilterOrderRepresentation: any; + UserProcessInstanceFilterRepresentation: any; + UserRepresentation: any; + UserTaskFilterRepresentation: any; + ValidationErrorRepresentation: any; + VariableScopeRepresentation: any; + } + + export interface Core { + associationsApi: any; + changesApi: any; + childAssociationsApi: any; + commentsApi: any; + favoritesApi: any; + networksApi: any; + nodesApi: any; + peopleApi: any; + ratingsApi: any; + renditionsApi: any; + searchApi: any; + sharedlinksApi: any; + sitesApi: any; + tagsApi: any; + + /*Models*/ + Activity: any; + ActivityActivitySummary: any; + ActivityEntry: any; + ActivityPaging: any; + ActivityPagingList: any; + AssocChildBody: any; + AssocInfo: any; + AssocTargetBody: any; + ChildAssocInfo: any; + Comment: any; + CommentBody: any; + CommentBody1: any; + CommentEntry: any; + CommentPaging: any; + CommentPagingList: any; + Company: any; + ContentInfo: any; + CopyBody: any; + DeletedNode: any; + DeletedNodeEntry: any; + DeletedNodeMinimal: any; + DeletedNodeMinimalEntry: any; + DeletedNodesPaging: any; + DeletedNodesPagingList: any; + EmailSharedLinkBody: any; + Error: any; + ErrorError: any; + Favorite: any; + FavoriteBody: any; + FavoriteEntry: any; + FavoritePaging: any; + FavoritePagingList: any; + FavoriteSiteBody: any; + InlineResponse201: any; + InlineResponse201Entry: any; + MoveBody: any; + NetworkQuota: any; + NodeAssocMinimal: any; + NodeAssocMinimalEntry: any; + NodeAssocPaging: any; + NodeAssocPagingList: any; + NodeBody: any; + NodeBody1: any; + NodeChildAssocMinimal: any; + NodeChildAssocMinimalEntry: any; + NodeChildAssocPaging: any; + NodeChildAssocPagingList: any; + NodeEntry: any; + NodeFull: any; + NodeMinimal: any; + NodeMinimalEntry: any; + NodePaging: any; + NodePagingList: any; + NodeSharedLink: any; + NodeSharedLinkEntry: any; + NodeSharedLinkPaging: any; + NodeSharedLinkPagingList: any; + NodesnodeIdchildrenContent: any; + Pagination: any; + PathElement: any; + PathInfo: any; + Person: any; + PersonEntry: any; + PersonNetwork: any; + PersonNetworkEntry: any; + PersonNetworkPaging: any; + PersonNetworkPagingList: any; + Preference: any; + PreferenceEntry: any; + PreferencePaging: any; + PreferencePagingList: any; + Rating: any; + RatingAggregate: any; + RatingBody: any; + RatingEntry: any; + RatingPaging: any; + RatingPagingList: any; + Rendition: any; + RenditionBody: any; + RenditionEntry: any; + RenditionPaging: any; + RenditionPagingList: any; + SharedLinkBody: any; + Site: any; + SiteBody: any; + SiteContainer: any; + SiteContainerEntry: any; + SiteContainerPaging: any; + SiteEntry: any; + SiteMember: any; + SiteMemberBody: any; + SiteMemberEntry: any; + SiteMemberPaging: any; + SiteMemberRoleBody: any; + SiteMembershipBody: any; + SiteMembershipBody1: any; + SiteMembershipRequest: any; + SiteMembershipRequestEntry: any; + SiteMembershipRequestPaging: any; + SiteMembershipRequestPagingList: any; + SitePaging: any; + SitePagingList: any; + Tag: any; + TagBody: any; + TagBody1: any; + TagEntry: any; + TagPaging: any; + TagPagingList: any; + UserInfo: any; + } + + export interface AlfrescoApiConfig { + hostEcm: string; + hostBpm: string; + contextRoot: string; + provider: string; + ticketEcm: string; + ticketBpm: string; + disableCsrf: boolean; + } + + export interface ContentApi { + new(ecmAuth: any); + + getDocumentThumbnailUrl(documentId: string): string; + getDocumentPreviewUrl(documentId: string): string; + getContentUrl(documentId: string): string; + } + + export interface AuthApi { + new(config: AlfrescoApiConfig): AuthApi; + + changeHost(host: string); + login(username: string, password: string): Promise; + logout(): Promise; + setTicket(ticket: string); + getTicket(): string; + isLoggedIn(): boolean; + + getClient(): any; + } + + export interface BpmAuthApi extends AuthApi { + + } + + export interface EcmAuthApi extends AuthApi { + validateTicket(): Promise; + } +} + +export = AlfrescoApi; From 4dec792cbb2a4d2d571848eff9e825791ede697f Mon Sep 17 00:00:00 2001 From: Eugenio Romano Date: Mon, 24 Oct 2016 12:37:01 +0100 Subject: [PATCH 04/10] build after merge PR #72 --- dist/alfresco-js-api.js | 3309 +++++++++++++++++++++-------------- dist/alfresco-js-api.min.js | 52 +- 2 files changed, 1976 insertions(+), 1385 deletions(-) diff --git a/dist/alfresco-js-api.js b/dist/alfresco-js-api.js index bbd3e3e1dd..d7afaeb536 100644 --- a/dist/alfresco-js-api.js +++ b/dist/alfresco-js-api.js @@ -5,7 +5,7 @@ var AlfrescoApi = require('./src/alfrescoApi.js'); module.exports = AlfrescoApi; -},{"./src/alfrescoApi.js":394}],2:[function(require,module,exports){ +},{"./src/alfrescoApi.js":396}],2:[function(require,module,exports){ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! @@ -366,7 +366,7 @@ var objectKeys = Object.keys || function (obj) { return keys; }; -},{"util/":134}],3:[function(require,module,exports){ +},{"util/":136}],3:[function(require,module,exports){ /*! * assertion-error * Copyright(c) 2013 Jake Luer @@ -880,6 +880,8 @@ if (Buffer.TYPED_ARRAY_SUPPORT) { function assertSize (size) { if (typeof size !== 'number') { throw new TypeError('"size" argument must be a number') + } else if (size < 0) { + throw new RangeError('"size" argument must not be negative') } } @@ -943,12 +945,20 @@ function fromString (that, string, encoding) { var length = byteLength(string, encoding) | 0 that = createBuffer(that, length) - that.write(string, encoding) + var actual = that.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + that = that.slice(0, actual) + } + return that } function fromArrayLike (that, array) { - var length = checked(array.length) | 0 + var length = array.length < 0 ? 0 : checked(array.length) | 0 that = createBuffer(that, length) for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255 @@ -967,7 +977,9 @@ function fromArrayBuffer (that, array, byteOffset, length) { throw new RangeError('\'length\' is out of bounds') } - if (length === undefined) { + if (byteOffset === undefined && length === undefined) { + array = new Uint8Array(array) + } else if (length === undefined) { array = new Uint8Array(array, byteOffset) } else { array = new Uint8Array(array, byteOffset, length) @@ -1015,7 +1027,7 @@ function fromObject (that, obj) { } function checked (length) { - // Note: cannot use `length < kMaxLength` here because that fails when + // Note: cannot use `length < kMaxLength()` here because that fails when // length is NaN (which is otherwise coerced to zero.) if (length >= kMaxLength()) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + @@ -1064,9 +1076,9 @@ Buffer.isEncoding = function isEncoding (encoding) { case 'utf8': case 'utf-8': case 'ascii': + case 'latin1': case 'binary': case 'base64': - case 'raw': case 'ucs2': case 'ucs-2': case 'utf16le': @@ -1127,9 +1139,8 @@ function byteLength (string, encoding) { for (;;) { switch (encoding) { case 'ascii': + case 'latin1': case 'binary': - case 'raw': - case 'raws': return len case 'utf8': case 'utf-8': @@ -1202,8 +1213,9 @@ function slowToString (encoding, start, end) { case 'ascii': return asciiSlice(this, start, end) + case 'latin1': case 'binary': - return binarySlice(this, start, end) + return latin1Slice(this, start, end) case 'base64': return base64Slice(this, start, end) @@ -1255,6 +1267,20 @@ Buffer.prototype.swap32 = function swap32 () { return this } +Buffer.prototype.swap64 = function swap64 () { + var len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (var i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} + Buffer.prototype.toString = function toString () { var length = this.length | 0 if (length === 0) return '' @@ -1337,7 +1363,73 @@ Buffer.prototype.compare = function compare (target, start, end, thisStart, this return 0 } -function arrayIndexOf (arr, val, byteOffset, encoding) { +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (isNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (Buffer.TYPED_ARRAY_SUPPORT && + typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { var indexSize = 1 var arrLength = arr.length var valLength = val.length @@ -1364,60 +1456,45 @@ function arrayIndexOf (arr, val, byteOffset, encoding) { } } - var foundIndex = -1 - for (var i = byteOffset; i < arrLength; ++i) { - if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { - if (foundIndex === -1) foundIndex = i - if (i - foundIndex + 1 === valLength) return foundIndex * indexSize - } else { - if (foundIndex !== -1) i -= i - foundIndex - foundIndex = -1 + var i + if (dir) { + var foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + var found = true + for (var j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i } } return -1 } -Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { - if (typeof byteOffset === 'string') { - encoding = byteOffset - byteOffset = 0 - } else if (byteOffset > 0x7fffffff) { - byteOffset = 0x7fffffff - } else if (byteOffset < -0x80000000) { - byteOffset = -0x80000000 - } - byteOffset >>= 0 - - if (this.length === 0) return -1 - if (byteOffset >= this.length) return -1 - - // Negative offsets start from the end of the buffer - if (byteOffset < 0) byteOffset = Math.max(this.length + byteOffset, 0) - - if (typeof val === 'string') { - val = Buffer.from(val, encoding) - } - - if (Buffer.isBuffer(val)) { - // special case: looking for empty string/buffer always fails - if (val.length === 0) { - return -1 - } - return arrayIndexOf(this, val, byteOffset, encoding) - } - if (typeof val === 'number') { - if (Buffer.TYPED_ARRAY_SUPPORT && Uint8Array.prototype.indexOf === 'function') { - return Uint8Array.prototype.indexOf.call(this, val, byteOffset) - } - return arrayIndexOf(this, [ val ], byteOffset, encoding) - } +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} - throw new TypeError('val must be string, number or Buffer') +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) } -Buffer.prototype.includes = function includes (val, byteOffset, encoding) { - return this.indexOf(val, byteOffset, encoding) !== -1 +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) } function hexWrite (buf, string, offset, length) { @@ -1434,7 +1511,7 @@ function hexWrite (buf, string, offset, length) { // must be an even number of digits var strLen = string.length - if (strLen % 2 !== 0) throw new Error('Invalid hex string') + if (strLen % 2 !== 0) throw new TypeError('Invalid hex string') if (length > strLen / 2) { length = strLen / 2 @@ -1455,7 +1532,7 @@ function asciiWrite (buf, string, offset, length) { return blitBuffer(asciiToBytes(string), buf, offset, length) } -function binaryWrite (buf, string, offset, length) { +function latin1Write (buf, string, offset, length) { return asciiWrite(buf, string, offset, length) } @@ -1517,8 +1594,9 @@ Buffer.prototype.write = function write (string, offset, length, encoding) { case 'ascii': return asciiWrite(this, string, offset, length) + case 'latin1': case 'binary': - return binaryWrite(this, string, offset, length) + return latin1Write(this, string, offset, length) case 'base64': // Warning: maxLength not taken into account in base64Write @@ -1659,7 +1737,7 @@ function asciiSlice (buf, start, end) { return ret } -function binarySlice (buf, start, end) { +function latin1Slice (buf, start, end) { var ret = '' end = Math.min(buf.length, end) @@ -6788,7 +6866,7 @@ module.exports = function (obj, types) { } }; -},{"./flag":23,"assertion-error":3,"type-detect":128}],23:[function(require,module,exports){ +},{"./flag":23,"assertion-error":3,"type-detect":130}],23:[function(require,module,exports){ /*! * Chai - flag utility * Copyright(c) 2012-2014 Jake Luer @@ -7212,7 +7290,7 @@ module.exports = function hasProperty(name, obj) { return name in obj; }; -},{"type-detect":128}],32:[function(require,module,exports){ +},{"type-detect":130}],32:[function(require,module,exports){ /*! * chai * Copyright(c) 2011 Jake Luer @@ -7344,7 +7422,7 @@ exports.addChainableMethod = require('./addChainableMethod'); exports.overwriteChainableMethod = require('./overwriteChainableMethod'); -},{"./addChainableMethod":19,"./addMethod":20,"./addProperty":21,"./expectTypes":22,"./flag":23,"./getActual":24,"./getMessage":26,"./getName":27,"./getPathInfo":28,"./getPathValue":29,"./hasProperty":31,"./inspect":33,"./objDisplay":34,"./overwriteChainableMethod":35,"./overwriteMethod":36,"./overwriteProperty":37,"./test":38,"./transferFlags":39,"deep-eql":45,"type-detect":128}],33:[function(require,module,exports){ +},{"./addChainableMethod":19,"./addMethod":20,"./addProperty":21,"./expectTypes":22,"./flag":23,"./getActual":24,"./getMessage":26,"./getName":27,"./getPathInfo":28,"./getPathValue":29,"./hasProperty":31,"./inspect":33,"./objDisplay":34,"./overwriteChainableMethod":35,"./overwriteMethod":36,"./overwriteProperty":37,"./test":38,"./transferFlags":39,"deep-eql":45,"type-detect":130}],33:[function(require,module,exports){ // This is (almost) directly from Node.js utils // https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/util.js @@ -9815,7 +9893,7 @@ https.request = function (params, cb) { return http.request.call(this, params, cb); } -},{"http":113}],68:[function(require,module,exports){ +},{"http":114}],68:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 @@ -9927,22 +10005,26 @@ if (typeof Object.create === 'function') { } },{}],70:[function(require,module,exports){ -/** - * Determine if an object is Buffer - * - * Author: Feross Aboukhadijeh - * License: MIT +/*! + * Determine if an object is a Buffer * - * `npm install is-buffer` + * @author Feross Aboukhadijeh + * @license MIT */ +// The _isBuffer check is for Safari 5-7 support, because it's missing +// Object.prototype.constructor. Remove this eventually module.exports = function (obj) { - return !!(obj != null && - (obj._isBuffer || // For Safari 5-7 (missing Object.prototype.constructor) - (obj.constructor && - typeof obj.constructor.isBuffer === 'function' && - obj.constructor.isBuffer(obj)) - )) + return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer) +} + +function isBuffer (obj) { + return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj) +} + +// For Node v0.10 support. Remove this eventually. +function isSlowBuffer (obj) { + return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) } },{}],71:[function(require,module,exports){ @@ -9990,7 +10072,7 @@ function serializer(replacer, cycleReplacer) { var undefined; /** Used as the semantic version number. */ - var VERSION = '4.13.1'; + var VERSION = '4.15.0'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; @@ -10004,7 +10086,7 @@ function serializer(replacer, cycleReplacer) { /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; - /** Used to compose bitmasks for wrapper metadata. */ + /** Used to compose bitmasks for function metadata. */ var BIND_FLAG = 1, BIND_KEY_FLAG = 2, CURRY_BOUND_FLAG = 4, @@ -10044,6 +10126,19 @@ function serializer(replacer, cycleReplacer) { MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; + /** Used to associate wrap methods with their bit flags. */ + var wrapFlags = [ + ['ary', ARY_FLAG], + ['bind', BIND_FLAG], + ['bindKey', BIND_KEY_FLAG], + ['curry', CURRY_FLAG], + ['curryRight', CURRY_RIGHT_FLAG], + ['flip', FLIP_FLAG], + ['partial', PARTIAL_FLAG], + ['partialRight', PARTIAL_RIGHT_FLAG], + ['rearg', REARG_FLAG] + ]; + /** `Object#toString` result references. */ var argsTag = '[object Arguments]', arrayTag = '[object Array]', @@ -10094,11 +10189,12 @@ function serializer(replacer, cycleReplacer) { /** Used to match property names within property paths. */ var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, - rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g; + reLeadingDot = /^\./, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; /** * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). */ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); @@ -10108,15 +10204,20 @@ function serializer(replacer, cycleReplacer) { reTrimStart = /^\s+/, reTrimEnd = /\s+$/; - /** Used to match non-compound words composed of alphanumeric characters. */ - var reBasicWord = /[a-zA-Z0-9]+/g; + /** Used to match wrap detail comments. */ + var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, + reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, + reSplitDetails = /,? & /; + + /** Used to match words composed of alphanumeric characters. */ + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; /** Used to match backslashes in property paths. */ var reEscapeChar = /\\(\\)?/g; /** * Used to match - * [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). + * [ES template delimiters](http://ecma-international.org/ecma-262/7.0/#sec-template-literal-lexical-components). */ var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; @@ -10141,8 +10242,8 @@ function serializer(replacer, cycleReplacer) { /** Used to detect unsigned integer values. */ var reIsUint = /^(?:0|[1-9]\d*)$/; - /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ - var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; + /** Used to match Latin Unicode letters (excluding mathematical operators). */ + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; /** Used to ensure capturing order of template delimiters. */ var reNoMatch = /($^)/; @@ -10203,10 +10304,10 @@ function serializer(replacer, cycleReplacer) { var reComboMark = RegExp(rsCombo, 'g'); /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ - var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); + var reUnicode = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); /** Used to match complex or compound words. */ - var reComplexWord = RegExp([ + var reUnicodeWord = RegExp([ rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr, @@ -10216,18 +10317,18 @@ function serializer(replacer, cycleReplacer) { ].join('|'), 'g'); /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ - var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); + var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); /** Used to detect strings that need a more robust regexp to match words. */ - var reHasComplexWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; /** Used to assign default `context` object properties. */ var contextProps = [ 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', - 'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', - 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', - '_', 'isFinite', 'parseInt', 'setTimeout' + 'Promise', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', 'Uint8Array', + 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' ]; /** Used to make template sourceURLs easier to identify. */ @@ -10265,16 +10366,17 @@ function serializer(replacer, cycleReplacer) { cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; - /** Used to map latin-1 supplementary letters to basic latin letters. */ + /** Used to map Latin Unicode letters to basic Latin letters. */ var deburredLetters = { + // Latin-1 Supplement block. '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', '\xc7': 'C', '\xe7': 'c', '\xd0': 'D', '\xf0': 'd', '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', - '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', - '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xcc': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xec': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', '\xd1': 'N', '\xf1': 'n', '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', @@ -10283,7 +10385,43 @@ function serializer(replacer, cycleReplacer) { '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', '\xc6': 'Ae', '\xe6': 'ae', '\xde': 'Th', '\xfe': 'th', - '\xdf': 'ss' + '\xdf': 'ss', + // Latin Extended-A block. + '\u0100': 'A', '\u0102': 'A', '\u0104': 'A', + '\u0101': 'a', '\u0103': 'a', '\u0105': 'a', + '\u0106': 'C', '\u0108': 'C', '\u010a': 'C', '\u010c': 'C', + '\u0107': 'c', '\u0109': 'c', '\u010b': 'c', '\u010d': 'c', + '\u010e': 'D', '\u0110': 'D', '\u010f': 'd', '\u0111': 'd', + '\u0112': 'E', '\u0114': 'E', '\u0116': 'E', '\u0118': 'E', '\u011a': 'E', + '\u0113': 'e', '\u0115': 'e', '\u0117': 'e', '\u0119': 'e', '\u011b': 'e', + '\u011c': 'G', '\u011e': 'G', '\u0120': 'G', '\u0122': 'G', + '\u011d': 'g', '\u011f': 'g', '\u0121': 'g', '\u0123': 'g', + '\u0124': 'H', '\u0126': 'H', '\u0125': 'h', '\u0127': 'h', + '\u0128': 'I', '\u012a': 'I', '\u012c': 'I', '\u012e': 'I', '\u0130': 'I', + '\u0129': 'i', '\u012b': 'i', '\u012d': 'i', '\u012f': 'i', '\u0131': 'i', + '\u0134': 'J', '\u0135': 'j', + '\u0136': 'K', '\u0137': 'k', '\u0138': 'k', + '\u0139': 'L', '\u013b': 'L', '\u013d': 'L', '\u013f': 'L', '\u0141': 'L', + '\u013a': 'l', '\u013c': 'l', '\u013e': 'l', '\u0140': 'l', '\u0142': 'l', + '\u0143': 'N', '\u0145': 'N', '\u0147': 'N', '\u014a': 'N', + '\u0144': 'n', '\u0146': 'n', '\u0148': 'n', '\u014b': 'n', + '\u014c': 'O', '\u014e': 'O', '\u0150': 'O', + '\u014d': 'o', '\u014f': 'o', '\u0151': 'o', + '\u0154': 'R', '\u0156': 'R', '\u0158': 'R', + '\u0155': 'r', '\u0157': 'r', '\u0159': 'r', + '\u015a': 'S', '\u015c': 'S', '\u015e': 'S', '\u0160': 'S', + '\u015b': 's', '\u015d': 's', '\u015f': 's', '\u0161': 's', + '\u0162': 'T', '\u0164': 'T', '\u0166': 'T', + '\u0163': 't', '\u0165': 't', '\u0167': 't', + '\u0168': 'U', '\u016a': 'U', '\u016c': 'U', '\u016e': 'U', '\u0170': 'U', '\u0172': 'U', + '\u0169': 'u', '\u016b': 'u', '\u016d': 'u', '\u016f': 'u', '\u0171': 'u', '\u0173': 'u', + '\u0174': 'W', '\u0175': 'w', + '\u0176': 'Y', '\u0177': 'y', '\u0178': 'Y', + '\u0179': 'Z', '\u017b': 'Z', '\u017d': 'Z', + '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', + '\u0132': 'IJ', '\u0133': 'ij', + '\u0152': 'Oe', '\u0153': 'oe', + '\u0149': "'n", '\u017f': 'ss' }; /** Used to map characters to HTML entities. */ @@ -10320,26 +10458,41 @@ function serializer(replacer, cycleReplacer) { var freeParseFloat = parseFloat, freeParseInt = parseInt; + /** Detect free variable `global` from Node.js. */ + var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + + /** Detect free variable `self`. */ + var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + + /** Used as a reference to the global object. */ + var root = freeGlobal || freeSelf || Function('return this')(); + /** Detect free variable `exports`. */ - var freeExports = typeof exports == 'object' && exports; + var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; /** Detect free variable `module`. */ - var freeModule = freeExports && typeof module == 'object' && module; + var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; /** Detect the popular CommonJS extension `module.exports`. */ var moduleExports = freeModule && freeModule.exports === freeExports; - /** Detect free variable `global` from Node.js. */ - var freeGlobal = checkGlobal(typeof global == 'object' && global); - - /** Detect free variable `self`. */ - var freeSelf = checkGlobal(typeof self == 'object' && self); - - /** Detect `this` as the global object. */ - var thisGlobal = checkGlobal(typeof this == 'object' && this); + /** Detect free variable `process` from Node.js. */ + var freeProcess = moduleExports && freeGlobal.process; - /** Used as a reference to the global object. */ - var root = freeGlobal || freeSelf || thisGlobal || Function('return this')(); + /** Used to access faster Node.js helpers. */ + var nodeUtil = (function() { + try { + return freeProcess && freeProcess.binding('util'); + } catch (e) {} + }()); + + /* Node.js helper references. */ + var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, + nodeIsDate = nodeUtil && nodeUtil.isDate, + nodeIsMap = nodeUtil && nodeUtil.isMap, + nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, + nodeIsSet = nodeUtil && nodeUtil.isSet, + nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; /*--------------------------------------------------------------------------*/ @@ -10352,7 +10505,7 @@ function serializer(replacer, cycleReplacer) { * @returns {Object} Returns `map`. */ function addMapEntry(map, pair) { - // Don't return `Map#set` because it doesn't return the map instance in IE 11. + // Don't return `map.set` because it's not chainable in IE 11. map.set(pair[0], pair[1]); return map; } @@ -10366,6 +10519,7 @@ function serializer(replacer, cycleReplacer) { * @returns {Object} Returns `set`. */ function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. set.add(value); return set; } @@ -10381,8 +10535,7 @@ function serializer(replacer, cycleReplacer) { * @returns {*} Returns the result of `func`. */ function apply(func, thisArg, args) { - var length = args.length; - switch (length) { + switch (args.length) { case 0: return func.call(thisArg); case 1: return func.call(thisArg, args[0]); case 2: return func.call(thisArg, args[0], args[1]); @@ -10504,7 +10657,7 @@ function serializer(replacer, cycleReplacer) { * specifying an index to search from. * * @private - * @param {Array} [array] The array to search. + * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @returns {boolean} Returns `true` if `target` is found, else `false`. */ @@ -10517,7 +10670,7 @@ function serializer(replacer, cycleReplacer) { * This function is like `arrayIncludes` except that it accepts a comparator. * * @private - * @param {Array} [array] The array to search. + * @param {Array} [array] The array to inspect. * @param {*} target The value to search for. * @param {Function} comparator The comparator invoked per element. * @returns {boolean} Returns `true` if `target` is found, else `false`. @@ -10643,13 +10796,44 @@ function serializer(replacer, cycleReplacer) { return false; } + /** + * Gets the size of an ASCII `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + var asciiSize = baseProperty('length'); + + /** + * Converts an ASCII `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function asciiToArray(string) { + return string.split(''); + } + + /** + * Splits an ASCII `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function asciiWords(string) { + return string.match(reAsciiWord) || []; + } + /** * The base implementation of methods like `_.findKey` and `_.findLastKey`, * without support for iteratee shorthands, which iterates over `collection` * using `eachFunc`. * * @private - * @param {Array|Object} collection The collection to search. + * @param {Array|Object} collection The collection to inspect. * @param {Function} predicate The function invoked per iteration. * @param {Function} eachFunc The function to iterate over `collection`. * @returns {*} Returns the found element or its key, else `undefined`. @@ -10670,7 +10854,7 @@ function serializer(replacer, cycleReplacer) { * support for iteratee shorthands. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {Function} predicate The function invoked per iteration. * @param {number} fromIndex The index to search from. * @param {boolean} [fromRight] Specify iterating from right to left. @@ -10692,14 +10876,14 @@ function serializer(replacer, cycleReplacer) { * The base implementation of `_.indexOf` without `fromIndex` bounds checks. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { if (value !== value) { - return indexOfNaN(array, fromIndex); + return baseFindIndex(array, baseIsNaN, fromIndex); } var index = fromIndex - 1, length = array.length; @@ -10716,7 +10900,7 @@ function serializer(replacer, cycleReplacer) { * This function is like `baseIndexOf` except that it accepts a comparator. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} fromIndex The index to search from. * @param {Function} comparator The comparator invoked per element. @@ -10734,6 +10918,17 @@ function serializer(replacer, cycleReplacer) { return -1; } + /** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ + function baseIsNaN(value) { + return value !== value; + } + /** * The base implementation of `_.mean` and `_.meanBy` without support for * iteratee shorthands. @@ -10748,6 +10943,32 @@ function serializer(replacer, cycleReplacer) { return length ? (baseSum(array, iteratee) / length) : NAN; } + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new accessor function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * The base implementation of `_.propertyOf` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @returns {Function} Returns the new accessor function. + */ + function basePropertyOf(object) { + return function(key) { + return object == null ? undefined : object[key]; + }; + } + /** * The base implementation of `_.reduce` and `_.reduceRight`, without support * for iteratee shorthands, which iterates over `collection` using `eachFunc`. @@ -10848,7 +11069,7 @@ function serializer(replacer, cycleReplacer) { } /** - * The base implementation of `_.unary` without support for storing wrapper metadata. + * The base implementation of `_.unary` without support for storing metadata. * * @private * @param {Function} func The function to cap arguments for. @@ -10921,17 +11142,6 @@ function serializer(replacer, cycleReplacer) { return index; } - /** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ - function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; - } - /** * Gets the number of `placeholder` occurrences in `array`. * @@ -10953,15 +11163,14 @@ function serializer(replacer, cycleReplacer) { } /** - * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. + * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A + * letters to basic Latin letters. * * @private * @param {string} letter The matched letter to deburr. * @returns {string} Returns the deburred letter. */ - function deburrLetter(letter) { - return deburredLetters[letter]; - } + var deburrLetter = basePropertyOf(deburredLetters); /** * Used by `_.escape` to convert characters to HTML entities. @@ -10970,9 +11179,7 @@ function serializer(replacer, cycleReplacer) { * @param {string} chr The matched character to escape. * @returns {string} Returns the escaped character. */ - function escapeHtmlChar(chr) { - return htmlEscapes[chr]; - } + var escapeHtmlChar = basePropertyOf(htmlEscapes); /** * Used by `_.template` to escape characters for inclusion in compiled string literals. @@ -10998,25 +11205,25 @@ function serializer(replacer, cycleReplacer) { } /** - * Gets the index at which the first occurrence of `NaN` is found in `array`. + * Checks if `string` contains Unicode symbols. * * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a symbol is found, else `false`. */ - function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 1 : -1); + function hasUnicode(string) { + return reHasUnicode.test(string); + } - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; + /** + * Checks if `string` contains a word composed of Unicode symbols. + * + * @private + * @param {string} string The string to inspect. + * @returns {boolean} Returns `true` if a word is found, else `false`. + */ + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); } /** @@ -11072,6 +11279,20 @@ function serializer(replacer, cycleReplacer) { return result; } + /** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; + } + /** * Replaces all `placeholder` elements in `array` with an internal placeholder * and returns an array of their indexes. @@ -11139,14 +11360,9 @@ function serializer(replacer, cycleReplacer) { * @returns {number} Returns the string size. */ function stringSize(string) { - if (!(string && reHasComplexSymbol.test(string))) { - return string.length; - } - var result = reComplexSymbol.lastIndex = 0; - while (reComplexSymbol.test(string)) { - result++; - } - return result; + return hasUnicode(string) + ? unicodeSize(string) + : asciiSize(string); } /** @@ -11157,7 +11373,9 @@ function serializer(replacer, cycleReplacer) { * @returns {Array} Returns the converted array. */ function stringToArray(string) { - return string.match(reComplexSymbol); + return hasUnicode(string) + ? unicodeToArray(string) + : asciiToArray(string); } /** @@ -11167,8 +11385,43 @@ function serializer(replacer, cycleReplacer) { * @param {string} chr The matched character to unescape. * @returns {string} Returns the unescaped character. */ - function unescapeHtmlChar(chr) { - return htmlUnescapes[chr]; + var unescapeHtmlChar = basePropertyOf(htmlUnescapes); + + /** + * Gets the size of a Unicode `string`. + * + * @private + * @param {string} string The string inspect. + * @returns {number} Returns the string size. + */ + function unicodeSize(string) { + var result = reUnicode.lastIndex = 0; + while (reUnicode.test(string)) { + result++; + } + return result; + } + + /** + * Converts a Unicode `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function unicodeToArray(string) { + return string.match(reUnicode) || []; + } + + /** + * Splits a Unicode `string` into an array of its words. + * + * @private + * @param {string} The string to inspect. + * @returns {Array} Returns the words of `string`. + */ + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; } /*--------------------------------------------------------------------------*/ @@ -11210,19 +11463,23 @@ function serializer(replacer, cycleReplacer) { * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; */ function runInContext(context) { - context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root; + context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; /** Built-in constructor references. */ - var Date = context.Date, + var Array = context.Array, + Date = context.Date, Error = context.Error, + Function = context.Function, Math = context.Math, + Object = context.Object, RegExp = context.RegExp, + String = context.String, TypeError = context.TypeError; /** Used for built-in method references. */ - var arrayProto = context.Array.prototype, - objectProto = context.Object.prototype, - stringProto = context.String.prototype; + var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; /** Used to detect overreaching core-js shims. */ var coreJsData = context['__core-js_shared__']; @@ -11234,7 +11491,7 @@ function serializer(replacer, cycleReplacer) { }()); /** Used to resolve the decompiled source of functions. */ - var funcToString = context.Function.prototype.toString; + var funcToString = funcProto.toString; /** Used to check objects for own properties. */ var hasOwnProperty = objectProto.hasOwnProperty; @@ -11247,7 +11504,7 @@ function serializer(replacer, cycleReplacer) { /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; @@ -11263,33 +11520,33 @@ function serializer(replacer, cycleReplacer) { /** Built-in value references. */ var Buffer = moduleExports ? context.Buffer : undefined, - Reflect = context.Reflect, Symbol = context.Symbol, Uint8Array = context.Uint8Array, - enumerate = Reflect ? Reflect.enumerate : undefined, - getOwnPropertySymbols = Object.getOwnPropertySymbols, - iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, + getPrototype = overArg(Object.getPrototypeOf, Object), + iteratorSymbol = Symbol ? Symbol.iterator : undefined, objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; - /** Built-in method references that are mockable. */ - var setTimeout = function(func, wait) { return context.setTimeout.call(root, func, wait); }; + /** Mocked built-ins. */ + var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, + ctxNow = Date && Date.now !== root.Date.now && Date.now, + ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; /* Built-in method references for those with the same name as other `lodash` methods. */ var nativeCeil = Math.ceil, nativeFloor = Math.floor, - nativeGetPrototype = Object.getPrototypeOf, + nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, - nativeKeys = Object.keys, + nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, nativeParseInt = context.parseInt, nativeRandom = Math.random, - nativeReplace = stringProto.replace, - nativeReverse = arrayProto.reverse, - nativeSplit = stringProto.split; + nativeReverse = arrayProto.reverse; /* Built-in method references that are verified to be native. */ var DataView = getNative(context, 'DataView'), @@ -11299,6 +11556,14 @@ function serializer(replacer, cycleReplacer) { WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); + /* Used to set `toString` methods. */ + var defineProperty = (function() { + var func = getNative(Object, 'defineProperty'), + name = getNative.name; + + return (name && name.length > 2) ? func : undefined; + }()); + /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; @@ -11388,16 +11653,16 @@ function serializer(replacer, cycleReplacer) { * * The wrapper methods that are **not** chainable by default are: * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, - * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, - * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, - * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, - * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, - * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, - * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, - * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, - * `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, - * `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, - * `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `conformsTo`, `deburr`, + * `defaultTo`, `divide`, `each`, `eachRight`, `endsWith`, `eq`, `escape`, + * `escapeRegExp`, `every`, `find`, `findIndex`, `findKey`, `findLast`, + * `findLastIndex`, `findLastKey`, `first`, `floor`, `forEach`, `forEachRight`, + * `forIn`, `forInRight`, `forOwn`, `forOwnRight`, `get`, `gt`, `gte`, `has`, + * `hasIn`, `head`, `identity`, `includes`, `indexOf`, `inRange`, `invoke`, + * `isArguments`, `isArray`, `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, + * `isBoolean`, `isBuffer`, `isDate`, `isElement`, `isEmpty`, `isEqual`, + * `isEqualWith`, `isError`, `isFinite`, `isFunction`, `isInteger`, `isLength`, + * `isMap`, `isMatch`, `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, * `isNumber`, `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, * `isSafeInteger`, `isSet`, `isString`, `isUndefined`, `isTypedArray`, * `isWeakMap`, `isWeakSet`, `join`, `kebabCase`, `last`, `lastIndexOf`, @@ -12100,8 +12365,13 @@ function serializer(replacer, cycleReplacer) { */ function stackSet(key, value) { var cache = this.__data__; - if (cache instanceof ListCache && cache.__data__.length == LARGE_ARRAY_SIZE) { - cache = this.__data__ = new MapCache(cache.__data__); + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); } cache.set(key, value); return this; @@ -12116,6 +12386,33 @@ function serializer(replacer, cycleReplacer) { /*------------------------------------------------------------------------*/ + /** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ + function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; + } + /** * Used by `_.defaults` to customize its `_.assignIn` use. * @@ -12152,7 +12449,7 @@ function serializer(replacer, cycleReplacer) { /** * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @private @@ -12172,7 +12469,7 @@ function serializer(replacer, cycleReplacer) { * Gets the index at which the `key` is found in `array` of key-value pairs. * * @private - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} key The key to search for. * @returns {number} Returns the index of the matched value, else `-1`. */ @@ -12238,7 +12535,7 @@ function serializer(replacer, cycleReplacer) { } /** - * The base implementation of `_.clamp` which doesn't coerce arguments to numbers. + * The base implementation of `_.clamp` which doesn't coerce arguments. * * @private * @param {number} number The number to clamp. @@ -12322,12 +12619,12 @@ function serializer(replacer, cycleReplacer) { if (!isArr) { var props = isFull ? getAllKeys(value) : keys(value); } - // Recursively populate clone (susceptible to call stack limits). arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; subValue = value[key]; } + // Recursively populate clone (susceptible to call stack limits). assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); }); return result; @@ -12341,26 +12638,36 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new spec function. */ function baseConforms(source) { - var props = keys(source), - length = props.length; - + var props = keys(source); return function(object) { - if (object == null) { - return !length; - } - var index = length; - while (index--) { - var key = props[index], - predicate = source[key], - value = object[key]; + return baseConformsTo(object, source, props); + }; + } - if ((value === undefined && - !(key in Object(object))) || !predicate(value)) { - return false; - } + /** + * The base implementation of `_.conformsTo` which accepts `props` to check. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + */ + function baseConformsTo(object, source, props) { + var length = props.length; + if (object == null) { + return !length; + } + object = Object(object); + while (length--) { + var key = props[length], + predicate = source[key], + value = object[key]; + + if ((value === undefined && !(key in object)) || !predicate(value)) { + return false; } - return true; - }; + } + return true; } /** @@ -12376,14 +12683,14 @@ function serializer(replacer, cycleReplacer) { } /** - * The base implementation of `_.delay` and `_.defer` which accepts an array - * of `func` arguments. + * The base implementation of `_.delay` and `_.defer` which accepts `args` + * to provide to `func`. * * @private * @param {Function} func The function to delay. * @param {number} wait The number of milliseconds to delay invocation. - * @param {Object} args The arguments to provide to `func`. - * @returns {number} Returns the timer id. + * @param {Array} args The arguments to provide to `func`. + * @returns {number|Object} Returns the timer id or timeout object. */ function baseDelay(func, wait, args) { if (typeof func != 'function') { @@ -12696,7 +13003,18 @@ function serializer(replacer, cycleReplacer) { } /** - * The base implementation of `_.gt` which doesn't coerce arguments to numbers. + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function baseGetTag(value) { + return objectToString.call(value); + } + + /** + * The base implementation of `_.gt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. @@ -12717,12 +13035,7 @@ function serializer(replacer, cycleReplacer) { * @returns {boolean} Returns `true` if `key` exists, else `false`. */ function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return object != null && - (hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototype(object) === null)); + return object != null && hasOwnProperty.call(object, key); } /** @@ -12738,7 +13051,7 @@ function serializer(replacer, cycleReplacer) { } /** - * The base implementation of `_.inRange` which doesn't coerce arguments to numbers. + * The base implementation of `_.inRange` which doesn't coerce arguments. * * @private * @param {number} number The number to check. @@ -12851,6 +13164,28 @@ function serializer(replacer, cycleReplacer) { return func == null ? undefined : apply(func, object, args); } + /** + * The base implementation of `_.isArrayBuffer` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. + */ + function baseIsArrayBuffer(value) { + return isObjectLike(value) && objectToString.call(value) == arrayBufferTag; + } + + /** + * The base implementation of `_.isDate` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. + */ + function baseIsDate(value) { + return isObjectLike(value) && objectToString.call(value) == dateTag; + } + /** * The base implementation of `_.isEqual` which supports partial comparisons * and tracks traversed objects. @@ -12934,6 +13269,17 @@ function serializer(replacer, cycleReplacer) { return equalObjects(object, other, equalFunc, customizer, bitmask, stack); } + /** + * The base implementation of `_.isMap` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. + */ + function baseIsMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + /** * The base implementation of `_.isMatch` without support for iteratee shorthands. * @@ -13004,6 +13350,40 @@ function serializer(replacer, cycleReplacer) { return pattern.test(toSource(value)); } + /** + * The base implementation of `_.isRegExp` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. + */ + function baseIsRegExp(value) { + return isObject(value) && objectToString.call(value) == regexpTag; + } + + /** + * The base implementation of `_.isSet` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. + */ + function baseIsSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * The base implementation of `_.isTypedArray` without Node.js optimizations. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. + */ + function baseIsTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + /** * The base implementation of `_.iteratee`. * @@ -13029,44 +13409,49 @@ function serializer(replacer, cycleReplacer) { } /** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeys(object) { - return nativeKeys(Object(object)); + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; } /** - * The base implementation of `_.keysIn` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. + * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense. * * @private * @param {Object} object The object to query. * @returns {Array} Returns the array of property names. */ function baseKeysIn(object) { - object = object == null ? object : Object(object); + if (!isObject(object)) { + return nativeKeysIn(object); + } + var isProto = isPrototype(object), + result = []; - var result = []; for (var key in object) { - result.push(key); + if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } } return result; } - // Fallback for IE < 9 with es6-shim. - if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { - baseKeysIn = function(object) { - return iteratorToArray(enumerate(object)); - }; - } - /** - * The base implementation of `_.lt` which doesn't coerce arguments to numbers. + * The base implementation of `_.lt` which doesn't coerce arguments. * * @private * @param {*} value The value to compare. @@ -13149,7 +13534,7 @@ function serializer(replacer, cycleReplacer) { return; } if (!(isArray(source) || isTypedArray(source))) { - var props = keysIn(source); + var props = baseKeysIn(source); } arrayEach(props || source, function(srcValue, key) { if (props) { @@ -13233,18 +13618,17 @@ function serializer(replacer, cycleReplacer) { isCommon = false; } } - stack.set(srcValue, newValue); - if (isCommon) { // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, newValue); mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + stack['delete'](srcValue); } - stack['delete'](srcValue); assignMergeValue(object, key, newValue); } /** - * The base implementation of `_.nth` which doesn't coerce `n` to an integer. + * The base implementation of `_.nth` which doesn't coerce arguments. * * @private * @param {Array} array The array to query. @@ -13296,12 +13680,9 @@ function serializer(replacer, cycleReplacer) { */ function basePick(object, props) { object = Object(object); - return arrayReduce(props, function(result, key) { - if (key in object) { - result[key] = object[key]; - } - return result; - }, {}); + return basePickBy(object, props, function(value, key) { + return key in object; + }); } /** @@ -13309,12 +13690,12 @@ function serializer(replacer, cycleReplacer) { * * @private * @param {Object} object The source object. + * @param {string[]} props The property identifiers to pick from. * @param {Function} predicate The function invoked per property. * @returns {Object} Returns the new object. */ - function basePickBy(object, predicate) { + function basePickBy(object, props, predicate) { var index = -1, - props = getAllKeysIn(object), length = props.length, result = {}; @@ -13329,19 +13710,6 @@ function serializer(replacer, cycleReplacer) { return result; } - /** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ - function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; - } - /** * A specialized version of `baseProperty` which supports deep paths. * @@ -13444,7 +13812,7 @@ function serializer(replacer, cycleReplacer) { /** * The base implementation of `_.range` and `_.rangeRight` which doesn't - * coerce arguments to numbers. + * coerce arguments. * * @private * @param {number} start The start of the range. @@ -13493,17 +13861,49 @@ function serializer(replacer, cycleReplacer) { return result; } + /** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ + function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; + } + /** * The base implementation of `_.set`. * * @private - * @param {Object} object The object to query. + * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to set. * @param {*} value The value to set. * @param {Function} [customizer] The function to customize path creation. * @returns {Object} Returns `object`. */ function baseSet(object, path, value, customizer) { + if (!isObject(object)) { + return object; + } path = isKey(path, object) ? [path] : castPath(path); var index = -1, @@ -13512,20 +13912,19 @@ function serializer(replacer, cycleReplacer) { nested = object; while (nested != null && ++index < length) { - var key = toKey(path[index]); - if (isObject(nested)) { - var newValue = value; - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined; - if (newValue === undefined) { - newValue = objValue == null - ? (isIndex(path[index + 1]) ? [] : {}) - : objValue; - } + var key = toKey(path[index]), + newValue = value; + + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = isObject(objValue) + ? objValue + : (isIndex(path[index + 1]) ? [] : {}); } - assignValue(nested, key, newValue); } + assignValue(nested, key, newValue); nested = nested[key]; } return object; @@ -13818,14 +14217,14 @@ function serializer(replacer, cycleReplacer) { object = parent(object, path); var key = toKey(last(path)); - return !(object != null && baseHas(object, key)) || delete object[key]; + return !(object != null && hasOwnProperty.call(object, key)) || delete object[key]; } /** * The base implementation of `_.update`. * * @private - * @param {Object} object The object to query. + * @param {Object} object The object to modify. * @param {Array|string} path The path of the property to update. * @param {Function} updater The function to produce the updated value. * @param {Function} [customizer] The function to customize path creation. @@ -13973,6 +14372,16 @@ function serializer(replacer, cycleReplacer) { return (!start && end >= length) ? array : baseSlice(array, start, end); } + /** + * A simple wrapper around the global [`clearTimeout`](https://mdn.io/clearTimeout). + * + * @private + * @param {number|Object} id The timer id or timeout object of the timer to clear. + */ + var clearTimeout = ctxClearTimeout || function(id) { + return root.clearTimeout(id); + }; + /** * Creates a clone of `buffer`. * @@ -14272,9 +14681,9 @@ function serializer(replacer, cycleReplacer) { var newValue = customizer ? customizer(object[key], source[key], key, object, source) - : source[key]; + : undefined; - assignValue(object, key, newValue); + assignValue(object, key, newValue === undefined ? source[key] : newValue); } return object; } @@ -14304,7 +14713,7 @@ function serializer(replacer, cycleReplacer) { var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; - return func(collection, setter, getIteratee(iteratee), accumulator); + return func(collection, setter, getIteratee(iteratee, 2), accumulator); }; } @@ -14316,7 +14725,7 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new assigner function. */ function createAssigner(assigner) { - return rest(function(object, sources) { + return baseRest(function(object, sources) { var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined, @@ -14400,14 +14809,13 @@ function serializer(replacer, cycleReplacer) { * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @returns {Function} Returns the new wrapped function. */ - function createBaseWrapper(func, bitmask, thisArg) { + function createBind(func, bitmask, thisArg) { var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); + Ctor = createCtor(func); function wrapper() { var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; @@ -14427,7 +14835,7 @@ function serializer(replacer, cycleReplacer) { return function(string) { string = toString(string); - var strSymbols = reHasComplexSymbol.test(string) + var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined; @@ -14464,10 +14872,10 @@ function serializer(replacer, cycleReplacer) { * @param {Function} Ctor The constructor to wrap. * @returns {Function} Returns the new wrapped function. */ - function createCtorWrapper(Ctor) { + function createCtor(Ctor) { return function() { // Use a `switch` statement to work with class constructors. See - // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // http://ecma-international.org/ecma-262/7.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist // for more details. var args = arguments; switch (args.length) { @@ -14494,13 +14902,12 @@ function serializer(replacer, cycleReplacer) { * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {number} arity The arity of `func`. * @returns {Function} Returns the new wrapped function. */ - function createCurryWrapper(func, bitmask, arity) { - var Ctor = createCtorWrapper(func); + function createCurry(func, bitmask, arity) { + var Ctor = createCtor(func); function wrapper() { var length = arguments.length, @@ -14517,8 +14924,8 @@ function serializer(replacer, cycleReplacer) { length -= holders.length; if (length < arity) { - return createRecurryWrapper( - func, bitmask, createHybridWrapper, wrapper.placeholder, undefined, + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, undefined, args, holders, undefined, undefined, arity - length); } var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; @@ -14537,18 +14944,13 @@ function serializer(replacer, cycleReplacer) { function createFind(findIndexFunc) { return function(collection, predicate, fromIndex) { var iterable = Object(collection); - predicate = getIteratee(predicate, 3); if (!isArrayLike(collection)) { - var props = keys(collection); + var iteratee = getIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; } - var index = findIndexFunc(props || collection, function(value, key) { - if (props) { - key = value; - value = iterable[key]; - } - return predicate(value, key, iterable); - }, fromIndex); - return index > -1 ? collection[props ? props[index] : index] : undefined; + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; }; } @@ -14560,7 +14962,7 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { - return rest(function(funcs) { + return baseRest(function(funcs) { funcs = baseFlatten(funcs, 1); var length = funcs.length, @@ -14622,8 +15024,7 @@ function serializer(replacer, cycleReplacer) { * * @private * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} [thisArg] The `this` binding of `func`. * @param {Array} [partials] The arguments to prepend to those provided to * the new function. @@ -14636,13 +15037,13 @@ function serializer(replacer, cycleReplacer) { * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ - function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { var isAry = bitmask & ARY_FLAG, isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG), isFlip = bitmask & FLIP_FLAG, - Ctor = isBindKey ? undefined : createCtorWrapper(func); + Ctor = isBindKey ? undefined : createCtor(func); function wrapper() { var length = arguments.length, @@ -14665,8 +15066,8 @@ function serializer(replacer, cycleReplacer) { length -= holdersCount; if (isCurried && length < arity) { var newHolders = replaceHolders(args, placeholder); - return createRecurryWrapper( - func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg, + return createRecurry( + func, bitmask, createHybrid, wrapper.placeholder, thisArg, args, newHolders, argPos, ary, arity - length ); } @@ -14683,7 +15084,7 @@ function serializer(replacer, cycleReplacer) { args.length = ary; } if (this && this !== root && this instanceof wrapper) { - fn = Ctor || createCtorWrapper(fn); + fn = Ctor || createCtor(fn); } return fn.apply(thisBinding, args); } @@ -14709,13 +15110,14 @@ function serializer(replacer, cycleReplacer) { * * @private * @param {Function} operator The function to perform the operation. + * @param {number} [defaultValue] The value used for `undefined` arguments. * @returns {Function} Returns the new mathematical operation function. */ - function createMathOperation(operator) { + function createMathOperation(operator, defaultValue) { return function(value, other) { var result; if (value === undefined && other === undefined) { - return 0; + return defaultValue; } if (value !== undefined) { result = value; @@ -14745,12 +15147,12 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { - return rest(function(iteratees) { + return baseRest(function(iteratees) { iteratees = (iteratees.length == 1 && isArray(iteratees[0])) ? arrayMap(iteratees[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), baseUnary(getIteratee())); + : arrayMap(baseFlatten(iteratees, 1), baseUnary(getIteratee())); - return rest(function(args) { + return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { return apply(iteratee, thisArg, args); @@ -14776,7 +15178,7 @@ function serializer(replacer, cycleReplacer) { return charsLength ? baseRepeat(chars, length) : chars; } var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return reHasComplexSymbol.test(chars) + return hasUnicode(chars) ? castSlice(stringToArray(result), 0, length).join('') : result.slice(0, length); } @@ -14787,16 +15189,15 @@ function serializer(replacer, cycleReplacer) { * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {*} thisArg The `this` binding of `func`. * @param {Array} partials The arguments to prepend to those provided to * the new function. * @returns {Function} Returns the new wrapped function. */ - function createPartialWrapper(func, bitmask, thisArg, partials) { + function createPartial(func, bitmask, thisArg, partials) { var isBind = bitmask & BIND_FLAG, - Ctor = createCtorWrapper(func); + Ctor = createCtor(func); function wrapper() { var argsIndex = -1, @@ -14830,15 +15231,14 @@ function serializer(replacer, cycleReplacer) { end = step = undefined; } // Ensure the sign of `-0` is preserved. - start = toNumber(start); - start = start === start ? start : 0; + start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { - end = toNumber(end) || 0; + end = toFinite(end); } - step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); + step = step === undefined ? (start < end ? 1 : -1) : toFinite(step); return baseRange(start, end, step, fromRight); }; } @@ -14865,8 +15265,7 @@ function serializer(replacer, cycleReplacer) { * * @private * @param {Function} func The function to wrap. - * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` - * for more details. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @param {Function} wrapFunc The function to create the `func` wrapper. * @param {*} placeholder The placeholder value. * @param {*} [thisArg] The `this` binding of `func`. @@ -14878,7 +15277,7 @@ function serializer(replacer, cycleReplacer) { * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ - function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { var isCurry = bitmask & CURRY_FLAG, newHolders = isCurry ? holders : undefined, newHoldersRight = isCurry ? undefined : holders, @@ -14901,7 +15300,7 @@ function serializer(replacer, cycleReplacer) { setData(result, newData); } result.placeholder = placeholder; - return result; + return setWrapToString(result, func, bitmask); } /** @@ -14930,7 +15329,7 @@ function serializer(replacer, cycleReplacer) { } /** - * Creates a set of `values`. + * Creates a set object of `values`. * * @private * @param {Array} values The values to add to the set. @@ -14966,7 +15365,7 @@ function serializer(replacer, cycleReplacer) { * * @private * @param {Function|string} func The function or method name to wrap. - * @param {number} bitmask The bitmask of wrapper flags. + * @param {number} bitmask The bitmask flags. * The bitmask may be composed of the following flags: * 1 - `_.bind` * 2 - `_.bindKey` @@ -14986,7 +15385,7 @@ function serializer(replacer, cycleReplacer) { * @param {number} [arity] The arity of `func`. * @returns {Function} Returns the new wrapped function. */ - function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { var isBindKey = bitmask & BIND_KEY_FLAG; if (!isBindKey && typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); @@ -15029,16 +15428,16 @@ function serializer(replacer, cycleReplacer) { bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); } if (!bitmask || bitmask == BIND_FLAG) { - var result = createBaseWrapper(func, bitmask, thisArg); + var result = createBind(func, bitmask, thisArg); } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { - result = createCurryWrapper(func, bitmask, arity); + result = createCurry(func, bitmask, arity); } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) { - result = createPartialWrapper(func, bitmask, thisArg, partials); + result = createPartial(func, bitmask, thisArg, partials); } else { - result = createHybridWrapper.apply(undefined, newData); + result = createHybrid.apply(undefined, newData); } var setter = data ? baseSetData : setData; - return setter(result, newData); + return setWrapToString(setter(result, newData), func, bitmask); } /** @@ -15065,7 +15464,7 @@ function serializer(replacer, cycleReplacer) { } // Assume cyclic values are equal. var stacked = stack.get(array); - if (stacked) { + if (stacked && stack.get(other)) { return stacked == other; } var index = -1, @@ -15073,6 +15472,7 @@ function serializer(replacer, cycleReplacer) { seen = (bitmask & UNORDERED_COMPARE_FLAG) ? new SetCache : undefined; stack.set(array, other); + stack.set(other, array); // Ignore non-index properties. while (++index < arrLength) { @@ -15111,6 +15511,7 @@ function serializer(replacer, cycleReplacer) { } } stack['delete'](array); + stack['delete'](other); return result; } @@ -15151,22 +15552,18 @@ function serializer(replacer, cycleReplacer) { case boolTag: case dateTag: - // Coerce dates and booleans to numbers, dates to milliseconds and - // booleans to `1` or `0` treating invalid dates coerced to `NaN` as - // not equal. - return +object == +other; + case numberTag: + // Coerce booleans to `1` or `0` and dates to milliseconds. + // Invalid dates are coerced to `NaN`. + return eq(+object, +other); case errorTag: return object.name == other.name && object.message == other.message; - case numberTag: - // Treat `NaN` vs. `NaN` as equal. - return (object != +object) ? other != +other : object == +other; - case regexpTag: case stringTag: // Coerce regexes to strings and treat strings, primitives and objects, - // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring // for more details. return object == (other + ''); @@ -15186,10 +15583,12 @@ function serializer(replacer, cycleReplacer) { return stacked == other; } bitmask |= UNORDERED_COMPARE_FLAG; - stack.set(object, other); // Recursively compare objects (susceptible to call stack limits). - return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack['delete'](object); + return result; case symbolTag: if (symbolValueOf) { @@ -15226,17 +15625,18 @@ function serializer(replacer, cycleReplacer) { var index = objLength; while (index--) { var key = objProps[index]; - if (!(isPartial ? key in other : baseHas(other, key))) { + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { return false; } } // Assume cyclic values are equal. var stacked = stack.get(object); - if (stacked) { + if (stacked && stack.get(other)) { return stacked == other; } var result = true; stack.set(object, other); + stack.set(other, object); var skipCtor = isPartial; while (++index < objLength) { @@ -15272,6 +15672,7 @@ function serializer(replacer, cycleReplacer) { } } stack['delete'](object); + stack['delete'](other); return result; } @@ -15360,19 +15761,6 @@ function serializer(replacer, cycleReplacer) { return arguments.length ? result(arguments[0], arguments[1]) : result; } - /** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ - var getLength = baseProperty('length'); - /** * Gets the data for `map`. * @@ -15421,17 +15809,6 @@ function serializer(replacer, cycleReplacer) { return baseIsNative(value) ? value : undefined; } - /** - * Gets the `[[Prototype]]` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {null|Object} Returns the `[[Prototype]]`. - */ - function getPrototype(value) { - return nativeGetPrototype(Object(value)); - } - /** * Creates an array of the own enumerable symbol properties of `object`. * @@ -15439,16 +15816,7 @@ function serializer(replacer, cycleReplacer) { * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - function getSymbols(object) { - // Coerce `object` to an object to avoid non-object errors in V8. - // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. - return getOwnPropertySymbols(Object(object)); - } - - // Fallback for IE < 11. - if (!getOwnPropertySymbols) { - getSymbols = stubArray; - } + var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; /** * Creates an array of the own and inherited enumerable symbol properties @@ -15458,7 +15826,7 @@ function serializer(replacer, cycleReplacer) { * @param {Object} object The object to query. * @returns {Array} Returns the array of symbols. */ - var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) { + var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { var result = []; while (object) { arrayPush(result, getSymbols(object)); @@ -15474,12 +15842,10 @@ function serializer(replacer, cycleReplacer) { * @param {*} value The value to query. * @returns {string} Returns the `toStringTag`. */ - function getTag(value) { - return objectToString.call(value); - } + var getTag = baseGetTag; // Fallback for data views, maps, sets, and weak maps in IE 11, - // for data views in Edge, and promises in Node.js. + // for data views in Edge < 14, and promises in Node.js. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || @@ -15531,6 +15897,18 @@ function serializer(replacer, cycleReplacer) { return { 'start': start, 'end': end }; } + /** + * Extracts wrapper details from the `source` body comment. + * + * @private + * @param {string} source The source to inspect. + * @returns {Array} Returns the wrapper details. + */ + function getWrapDetails(source) { + var match = source.match(reWrapDetails); + return match ? match[1].split(reSplitDetails) : []; + } + /** * Checks if `path` exists on `object`. * @@ -15559,7 +15937,7 @@ function serializer(replacer, cycleReplacer) { } var length = object ? object.length : 0; return !!length && isLength(length) && isIndex(key, length) && - (isArray(object) || isString(object) || isArguments(object)); + (isArray(object) || isArguments(object)); } /** @@ -15644,20 +16022,20 @@ function serializer(replacer, cycleReplacer) { } /** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. + * Inserts wrapper `details` in a comment at the top of the `source` body. * * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. + * @param {string} source The source to modify. + * @returns {Array} details The details to insert. + * @returns {string} Returns the modified source. */ - function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; + function insertWrapDetails(source, details) { + var length = details.length, + lastIndex = length - 1; + + details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; + details = details.join(length > 2 ? ', ' : ' '); + return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); } /** @@ -15668,19 +16046,8 @@ function serializer(replacer, cycleReplacer) { * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. */ function isFlattenable(value) { - return isArray(value) || isArguments(value); - } - - /** - * Checks if `value` is a flattenable array and not a `_.matchesProperty` - * iteratee shorthand. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ - function isFlattenableIteratee(value) { - return isArray(value) && !(value.length == 2 && !isFunction(value[0])); + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); } /** @@ -15930,11 +16297,33 @@ function serializer(replacer, cycleReplacer) { */ function mergeDefaults(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { - baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue)); + // Recursively merge objects and arrays (susceptible to call stack limits). + stack.set(srcValue, objValue); + baseMerge(objValue, srcValue, undefined, mergeDefaults, stack); + stack['delete'](srcValue); } return objValue; } + /** + * This function is like + * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * except that it includes inherited enumerable properties. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function nativeKeysIn(object) { + var result = []; + if (object != null) { + for (var key in Object(object)) { + result.push(key); + } + } + return result; + } + /** * Gets the parent value at `path` of `object`. * @@ -16003,6 +16392,37 @@ function serializer(replacer, cycleReplacer) { }; }()); + /** + * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @returns {number|Object} Returns the timer id or timeout object. + */ + var setTimeout = ctxSetTimeout || function(func, wait) { + return root.setTimeout(func, wait); + }; + + /** + * Sets the `toString` method of `wrapper` to mimic the source of `reference` + * with wrapper details in a comment at the top of the source body. + * + * @private + * @param {Function} wrapper The function to modify. + * @param {Function} reference The reference function. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Function} Returns `wrapper`. + */ + var setWrapToString = !defineProperty ? identity : function(wrapper, reference, bitmask) { + var source = (reference + ''); + return defineProperty(wrapper, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))) + }); + }; + /** * Converts `string` to a property path array. * @@ -16011,8 +16431,13 @@ function serializer(replacer, cycleReplacer) { * @returns {Array} Returns the property path array. */ var stringToPath = memoize(function(string) { + string = toString(string); + var result = []; - toString(string).replace(rePropName, function(match, number, quote, string) { + if (reLeadingDot.test(string)) { + result.push(''); + } + string.replace(rePropName, function(match, number, quote, string) { result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); }); return result; @@ -16052,6 +16477,24 @@ function serializer(replacer, cycleReplacer) { return ''; } + /** + * Updates wrapper `details` based on `bitmask` flags. + * + * @private + * @returns {Array} details The details to modify. + * @param {number} bitmask The bitmask flags. See `createWrap` for more details. + * @returns {Array} Returns `details`. + */ + function updateWrapDetails(details, bitmask) { + arrayEach(wrapFlags, function(pair) { + var value = '_.' + pair[0]; + if ((bitmask & pair[1]) && !arrayIncludes(details, value)) { + details.push(value); + } + }); + return details.sort(); + } + /** * Creates a clone of `wrapper`. * @@ -16180,11 +16623,13 @@ function serializer(replacer, cycleReplacer) { } /** - * Creates an array of unique `array` values not included in the other given - * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * Creates an array of `array` values not included in the other given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order of result values is determined by the * order they occur in the first array. * + * **Note:** Unlike `_.pullAll`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 @@ -16198,7 +16643,7 @@ function serializer(replacer, cycleReplacer) { * _.difference([2, 1], [2, 3]); * // => [1] */ - var difference = rest(function(array, values) { + var difference = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) : []; @@ -16210,14 +16655,15 @@ function serializer(replacer, cycleReplacer) { * by which they're compared. Result values are chosen from the first array. * The iteratee is invoked with one argument: (value). * + * **Note:** Unlike `_.pullAllBy`, this method returns a new array. + * * @static * @memberOf _ * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. * @param {...Array} [values] The values to exclude. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example * @@ -16228,13 +16674,13 @@ function serializer(replacer, cycleReplacer) { * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ - var differenceBy = rest(function(array, values) { + var differenceBy = baseRest(function(array, values) { var iteratee = last(values); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } return isArrayLikeObject(array) - ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee)) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)) : []; }); @@ -16244,6 +16690,8 @@ function serializer(replacer, cycleReplacer) { * are chosen from the first array. The comparator is invoked with two arguments: * (arrVal, othVal). * + * **Note:** Unlike `_.pullAllWith`, this method returns a new array. + * * @static * @memberOf _ * @since 4.0.0 @@ -16259,7 +16707,7 @@ function serializer(replacer, cycleReplacer) { * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); * // => [{ 'x': 2, 'y': 1 }] */ - var differenceWith = rest(function(array, values) { + var differenceWith = baseRest(function(array, values) { var comparator = last(values); if (isArrayLikeObject(comparator)) { comparator = undefined; @@ -16348,8 +16796,7 @@ function serializer(replacer, cycleReplacer) { * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example * @@ -16390,7 +16837,7 @@ function serializer(replacer, cycleReplacer) { * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example @@ -16471,8 +16918,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 1.1.0 * @category Array - * @param {Array} array The array to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. @@ -16519,8 +16966,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 2.0.0 * @category Array - * @param {Array} array The array to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Array} array The array to inspect. + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the found element, else `-1`. @@ -16641,8 +17088,8 @@ function serializer(replacer, cycleReplacer) { * @returns {Object} Returns the new object. * @example * - * _.fromPairs([['fred', 30], ['barney', 40]]); - * // => { 'fred': 30, 'barney': 40 } + * _.fromPairs([['a', 1], ['b', 2]]); + * // => { 'a': 1, 'b': 2 } */ function fromPairs(pairs) { var index = -1, @@ -16680,7 +17127,7 @@ function serializer(replacer, cycleReplacer) { /** * Gets the index at which the first occurrence of `value` is found in `array` - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. If `fromIndex` is negative, it's used as the * offset from the end of `array`. * @@ -16688,7 +17135,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 0.1.0 * @category Array - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. @@ -16728,12 +17175,13 @@ function serializer(replacer, cycleReplacer) { * // => [1, 2] */ function initial(array) { - return dropRight(array, 1); + var length = array ? array.length : 0; + return length ? baseSlice(array, 0, -1) : []; } /** * Creates an array of unique values that are included in all given arrays - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. The order of result values is determined by the * order they occur in the first array. * @@ -16748,7 +17196,7 @@ function serializer(replacer, cycleReplacer) { * _.intersection([2, 1], [2, 3]); * // => [2] */ - var intersection = rest(function(arrays) { + var intersection = baseRest(function(arrays) { var mapped = arrayMap(arrays, castArrayLikeObject); return (mapped.length && mapped[0] === arrays[0]) ? baseIntersection(mapped) @@ -16766,8 +17214,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Array} Returns the new array of intersecting values. * @example * @@ -16778,7 +17225,7 @@ function serializer(replacer, cycleReplacer) { * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }] */ - var intersectionBy = rest(function(arrays) { + var intersectionBy = baseRest(function(arrays) { var iteratee = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); @@ -16788,7 +17235,7 @@ function serializer(replacer, cycleReplacer) { mapped.pop(); } return (mapped.length && mapped[0] === arrays[0]) - ? baseIntersection(mapped, getIteratee(iteratee)) + ? baseIntersection(mapped, getIteratee(iteratee, 2)) : []; }); @@ -16813,7 +17260,7 @@ function serializer(replacer, cycleReplacer) { * _.intersectionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }] */ - var intersectionWith = rest(function(arrays) { + var intersectionWith = baseRest(function(arrays) { var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); @@ -16873,7 +17320,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 0.1.0 * @category Array - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=array.length-1] The index to search from. * @returns {number} Returns the index of the matched value, else `-1`. @@ -16901,7 +17348,7 @@ function serializer(replacer, cycleReplacer) { ) + 1; } if (value !== value) { - return indexOfNaN(array, index - 1, true); + return baseFindIndex(array, baseIsNaN, index - 1, true); } while (index--) { if (array[index] === value) { @@ -16938,7 +17385,7 @@ function serializer(replacer, cycleReplacer) { /** * Removes all given values from `array` using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` @@ -16959,7 +17406,7 @@ function serializer(replacer, cycleReplacer) { * console.log(array); * // => ['b', 'b'] */ - var pull = rest(pullAll); + var pull = baseRest(pullAll); /** * This method is like `_.pull` except that it accepts an array of values to remove. @@ -17000,7 +17447,7 @@ function serializer(replacer, cycleReplacer) { * @category Array * @param {Array} array The array to modify. * @param {Array} values The values to remove. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {Array} Returns `array`. * @example @@ -17013,7 +17460,7 @@ function serializer(replacer, cycleReplacer) { */ function pullAllBy(array, values, iteratee) { return (array && array.length && values && values.length) - ? basePullAll(array, values, getIteratee(iteratee)) + ? basePullAll(array, values, getIteratee(iteratee, 2)) : array; } @@ -17070,7 +17517,7 @@ function serializer(replacer, cycleReplacer) { * console.log(pulled); * // => ['b', 'd'] */ - var pullAt = rest(function(array, indexes) { + var pullAt = baseRest(function(array, indexes) { indexes = baseFlatten(indexes, 1); var length = array ? array.length : 0, @@ -17096,7 +17543,7 @@ function serializer(replacer, cycleReplacer) { * @since 2.0.0 * @category Array * @param {Array} array The array to modify. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new array of removed elements. * @example @@ -17224,7 +17671,7 @@ function serializer(replacer, cycleReplacer) { * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. @@ -17240,7 +17687,7 @@ function serializer(replacer, cycleReplacer) { * // => 0 */ function sortedIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee)); + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2)); } /** @@ -17251,7 +17698,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 4.0.0 * @category Array - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example @@ -17303,7 +17750,7 @@ function serializer(replacer, cycleReplacer) { * @category Array * @param {Array} array The sorted array to inspect. * @param {*} value The value to evaluate. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {number} Returns the index at which `value` should be inserted * into `array`. @@ -17319,7 +17766,7 @@ function serializer(replacer, cycleReplacer) { * // => 1 */ function sortedLastIndexBy(array, value, iteratee) { - return baseSortedIndexBy(array, value, getIteratee(iteratee), true); + return baseSortedIndexBy(array, value, getIteratee(iteratee, 2), true); } /** @@ -17330,7 +17777,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 4.0.0 * @category Array - * @param {Array} array The array to search. + * @param {Array} array The array to inspect. * @param {*} value The value to search for. * @returns {number} Returns the index of the matched value, else `-1`. * @example @@ -17388,7 +17835,7 @@ function serializer(replacer, cycleReplacer) { */ function sortedUniqBy(array, iteratee) { return (array && array.length) - ? baseSortedUniq(array, getIteratee(iteratee)) + ? baseSortedUniq(array, getIteratee(iteratee, 2)) : []; } @@ -17407,7 +17854,8 @@ function serializer(replacer, cycleReplacer) { * // => [2, 3] */ function tail(array) { - return drop(array, 1); + var length = array ? array.length : 0; + return length ? baseSlice(array, 1, length) : []; } /** @@ -17488,7 +17936,7 @@ function serializer(replacer, cycleReplacer) { * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example @@ -17530,7 +17978,7 @@ function serializer(replacer, cycleReplacer) { * @since 3.0.0 * @category Array * @param {Array} array The array to query. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the slice of `array`. * @example @@ -17564,7 +18012,7 @@ function serializer(replacer, cycleReplacer) { /** * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static @@ -17578,14 +18026,15 @@ function serializer(replacer, cycleReplacer) { * _.union([2], [1, 2]); * // => [2, 1] */ - var union = rest(function(arrays) { + var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); /** * This method is like `_.union` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by - * which uniqueness is computed. The iteratee is invoked with one argument: + * which uniqueness is computed. Result values are chosen from the first + * array in which the value occurs. The iteratee is invoked with one argument: * (value). * * @static @@ -17593,7 +18042,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {Array} Returns the new array of combined values. * @example @@ -17605,17 +18054,18 @@ function serializer(replacer, cycleReplacer) { * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 1 }, { 'x': 2 }] */ - var unionBy = rest(function(arrays) { + var unionBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee)); + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee, 2)); }); /** * This method is like `_.union` except that it accepts `comparator` which - * is invoked to compare elements of `arrays`. The comparator is invoked + * is invoked to compare elements of `arrays`. Result values are chosen from + * the first array in which the value occurs. The comparator is invoked * with two arguments: (arrVal, othVal). * * @static @@ -17633,7 +18083,7 @@ function serializer(replacer, cycleReplacer) { * _.unionWith(objects, others, _.isEqual); * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - var unionWith = rest(function(arrays) { + var unionWith = baseRest(function(arrays) { var comparator = last(arrays); if (isArrayLikeObject(comparator)) { comparator = undefined; @@ -17643,7 +18093,7 @@ function serializer(replacer, cycleReplacer) { /** * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each * element is kept. * @@ -17674,7 +18124,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Array * @param {Array} array The array to inspect. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {Array} Returns the new duplicate free array. * @example @@ -17688,7 +18138,7 @@ function serializer(replacer, cycleReplacer) { */ function uniqBy(array, iteratee) { return (array && array.length) - ? baseUniq(array, getIteratee(iteratee)) + ? baseUniq(array, getIteratee(iteratee, 2)) : []; } @@ -17730,11 +18180,11 @@ function serializer(replacer, cycleReplacer) { * @returns {Array} Returns the new array of regrouped elements. * @example * - * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] + * var zipped = _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] * * _.unzip(zipped); - * // => [['fred', 'barney'], [30, 40], [true, false]] + * // => [['a', 'b'], [1, 2], [true, false]] */ function unzip(array) { if (!(array && array.length)) { @@ -17788,9 +18238,11 @@ function serializer(replacer, cycleReplacer) { /** * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * + * **Note:** Unlike `_.pull`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 @@ -17804,7 +18256,7 @@ function serializer(replacer, cycleReplacer) { * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ - var without = rest(function(array, values) { + var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; @@ -17828,7 +18280,7 @@ function serializer(replacer, cycleReplacer) { * _.xor([2, 1], [2, 3]); * // => [1, 3] */ - var xor = rest(function(arrays) { + var xor = baseRest(function(arrays) { return baseXor(arrayFilter(arrays, isArrayLikeObject)); }); @@ -17843,7 +18295,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Array * @param {...Array} [arrays] The arrays to inspect. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee invoked per element. * @returns {Array} Returns the new array of filtered values. * @example @@ -17855,12 +18307,12 @@ function serializer(replacer, cycleReplacer) { * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); * // => [{ 'x': 2 }] */ - var xorBy = rest(function(arrays) { + var xorBy = baseRest(function(arrays) { var iteratee = last(arrays); if (isArrayLikeObject(iteratee)) { iteratee = undefined; } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee)); + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee, 2)); }); /** @@ -17883,7 +18335,7 @@ function serializer(replacer, cycleReplacer) { * _.xorWith(objects, others, _.isEqual); * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] */ - var xorWith = rest(function(arrays) { + var xorWith = baseRest(function(arrays) { var comparator = last(arrays); if (isArrayLikeObject(comparator)) { comparator = undefined; @@ -17904,10 +18356,10 @@ function serializer(replacer, cycleReplacer) { * @returns {Array} Returns the new array of grouped elements. * @example * - * _.zip(['fred', 'barney'], [30, 40], [true, false]); - * // => [['fred', 30, true], ['barney', 40, false]] + * _.zip(['a', 'b'], [1, 2], [true, false]); + * // => [['a', 1, true], ['b', 2, false]] */ - var zip = rest(unzip); + var zip = baseRest(unzip); /** * This method is like `_.fromPairs` except that it accepts two arrays, @@ -17967,7 +18419,7 @@ function serializer(replacer, cycleReplacer) { * }); * // => [111, 222] */ - var zipWith = rest(function(arrays) { + var zipWith = baseRest(function(arrays) { var length = arrays.length, iteratee = length > 1 ? arrays[length - 1] : undefined; @@ -18083,7 +18535,7 @@ function serializer(replacer, cycleReplacer) { * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ - var wrapperAt = rest(function(paths) { + var wrapperAt = baseRest(function(paths) { paths = baseFlatten(paths, 1); var length = paths.length, start = length ? paths[0] : 0, @@ -18336,7 +18788,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.5.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example @@ -18357,12 +18809,17 @@ function serializer(replacer, cycleReplacer) { * Iteration is stopped once `predicate` returns falsey. The predicate is * invoked with three arguments: (value, index|key, collection). * + * **Note:** This method returns `true` for + * [empty collections](https://en.wikipedia.org/wiki/Empty_set) because + * [everything is true](https://en.wikipedia.org/wiki/Vacuous_truth) of + * elements of empty collections. + * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if all elements pass the predicate check, @@ -18402,12 +18859,14 @@ function serializer(replacer, cycleReplacer) { * `predicate` returns truthy for. The predicate is invoked with three * arguments: (value, index|key, collection). * + * **Note:** Unlike `_.remove`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.reject @@ -18447,8 +18906,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 0.1.0 * @category Collection - * @param {Array|Object} collection The collection to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=0] The index to search from. * @returns {*} Returns the matched element, else `undefined`. @@ -18485,8 +18944,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 2.0.0 * @category Collection - * @param {Array|Object} collection The collection to search. - * @param {Array|Function|Object|string} [predicate=_.identity] + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] * The function invoked per iteration. * @param {number} [fromIndex=collection.length-1] The index to search from. * @returns {*} Returns the matched element, else `undefined`. @@ -18509,7 +18968,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example @@ -18534,7 +18993,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The function invoked per iteration. * @returns {Array} Returns the new flattened array. * @example @@ -18559,7 +19018,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.7.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The function invoked per iteration. * @param {number} [depth=1] The maximum recursion depth. * @returns {Array} Returns the new flattened array. @@ -18649,7 +19108,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example @@ -18672,7 +19131,7 @@ function serializer(replacer, cycleReplacer) { /** * Checks if `value` is in `collection`. If `collection` is a string, it's * checked for a substring of `value`, otherwise - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * is used for equality comparisons. If `fromIndex` is negative, it's used as * the offset from the end of `collection`. * @@ -18680,7 +19139,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 0.1.0 * @category Collection - * @param {Array|Object|string} collection The collection to search. + * @param {Array|Object|string} collection The collection to inspect. * @param {*} value The value to search for. * @param {number} [fromIndex=0] The index to search from. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. @@ -18693,10 +19152,10 @@ function serializer(replacer, cycleReplacer) { * _.includes([1, 2, 3], 1, 2); * // => false * - * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); + * _.includes({ 'a': 1, 'b': 2 }, 1); * // => true * - * _.includes('pebbles', 'eb'); + * _.includes('abcd', 'bc'); * // => true */ function includes(collection, value, fromIndex, guard) { @@ -18715,8 +19174,8 @@ function serializer(replacer, cycleReplacer) { /** * Invokes the method at `path` of each element in `collection`, returning * an array of the results of each invoked method. Any additional arguments - * are provided to each invoked method. If `methodName` is a function, it's - * invoked for and `this` bound to, each element in `collection`. + * are provided to each invoked method. If `path` is a function, it's invoked + * for, and `this` bound to, each element in `collection`. * * @static * @memberOf _ @@ -18735,7 +19194,7 @@ function serializer(replacer, cycleReplacer) { * _.invokeMap([123, 456], String.prototype.split, ''); * // => [['1', '2', '3'], ['4', '5', '6']] */ - var invokeMap = rest(function(collection, path, args) { + var invokeMap = baseRest(function(collection, path, args) { var index = -1, isFunc = typeof path == 'function', isProp = isKey(path), @@ -18759,7 +19218,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] + * @param {Function} [iteratee=_.identity] * The iteratee to transform keys. * @returns {Object} Returns the composed aggregate object. * @example @@ -18800,8 +19259,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The function invoked per iteration. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Array} Returns the new mapped array. * @example * @@ -18883,8 +19341,7 @@ function serializer(replacer, cycleReplacer) { * @since 3.0.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the array of grouped elements. * @example * @@ -18995,8 +19452,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {Array} Returns the new filtered array. * @see _.filter * @example @@ -19023,10 +19479,7 @@ function serializer(replacer, cycleReplacer) { */ function reject(collection, predicate) { var func = isArray(collection) ? arrayFilter : baseFilter; - predicate = getIteratee(predicate, 3); - return func(collection, function(value, index, collection) { - return !predicate(value, index, collection); - }); + return func(collection, negate(getIteratee(predicate, 3))); } /** @@ -19119,7 +19572,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 0.1.0 * @category Collection - * @param {Array|Object} collection The collection to inspect. + * @param {Array|Object|string} collection The collection to inspect. * @returns {number} Returns the collection size. * @example * @@ -19137,16 +19590,13 @@ function serializer(replacer, cycleReplacer) { return 0; } if (isArrayLike(collection)) { - var result = collection.length; - return (result && isString(collection)) ? stringSize(collection) : result; + return isString(collection) ? stringSize(collection) : collection.length; } - if (isObjectLike(collection)) { - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; - } + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; } - return keys(collection).length; + return baseKeys(collection).length; } /** @@ -19159,8 +19609,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. * @returns {boolean} Returns `true` if any element passes the predicate check, * else `false`. @@ -19205,8 +19654,8 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Collection * @param {Array|Object} collection The collection to iterate over. - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [iteratees=[_.identity]] The iteratees to sort by. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to sort by. * @returns {Array} Returns the new sorted array. * @example * @@ -19228,7 +19677,7 @@ function serializer(replacer, cycleReplacer) { * }); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ - var sortBy = rest(function(collection, iteratees) { + var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { return []; } @@ -19238,11 +19687,7 @@ function serializer(replacer, cycleReplacer) { } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { iteratees = [iteratees[0]]; } - iteratees = (iteratees.length == 1 && isArray(iteratees[0])) - ? iteratees[0] - : baseFlatten(iteratees, 1, isFlattenableIteratee); - - return baseOrderBy(collection, iteratees, []); + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); /*------------------------------------------------------------------------*/ @@ -19263,9 +19708,9 @@ function serializer(replacer, cycleReplacer) { * }, _.now()); * // => Logs the number of milliseconds it took for the deferred invocation. */ - function now() { - return Date.now(); - } + var now = ctxNow || function() { + return root.Date.now(); + }; /*------------------------------------------------------------------------*/ @@ -19325,7 +19770,7 @@ function serializer(replacer, cycleReplacer) { function ary(func, n, guard) { n = guard ? undefined : n; n = (func && n == null) ? func.length : n; - return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); + return createWrap(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); } /** @@ -19343,7 +19788,7 @@ function serializer(replacer, cycleReplacer) { * @example * * jQuery(element).on('click', _.before(5, addContactToList)); - * // => allows adding up to 4 contacts to the list + * // => Allows adding up to 4 contacts to the list. */ function before(n, func) { var result; @@ -19382,9 +19827,9 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new bound function. * @example * - * var greet = function(greeting, punctuation) { + * function greet(greeting, punctuation) { * return greeting + ' ' + this.user + punctuation; - * }; + * } * * var object = { 'user': 'fred' }; * @@ -19397,13 +19842,13 @@ function serializer(replacer, cycleReplacer) { * bound('hi'); * // => 'hi fred!' */ - var bind = rest(function(func, thisArg, partials) { + var bind = baseRest(function(func, thisArg, partials) { var bitmask = BIND_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bind)); bitmask |= PARTIAL_FLAG; } - return createWrapper(func, bitmask, thisArg, partials, holders); + return createWrap(func, bitmask, thisArg, partials, holders); }); /** @@ -19451,13 +19896,13 @@ function serializer(replacer, cycleReplacer) { * bound('hi'); * // => 'hiya fred!' */ - var bindKey = rest(function(object, key, partials) { + var bindKey = baseRest(function(object, key, partials) { var bitmask = BIND_FLAG | BIND_KEY_FLAG; if (partials.length) { var holders = replaceHolders(partials, getHolder(bindKey)); bitmask |= PARTIAL_FLAG; } - return createWrapper(key, bitmask, object, partials, holders); + return createWrap(key, bitmask, object, partials, holders); }); /** @@ -19503,7 +19948,7 @@ function serializer(replacer, cycleReplacer) { */ function curry(func, arity, guard) { arity = guard ? undefined : arity; - var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + var result = createWrap(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curry.placeholder; return result; } @@ -19548,7 +19993,7 @@ function serializer(replacer, cycleReplacer) { */ function curryRight(func, arity, guard) { arity = guard ? undefined : arity; - var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + var result = createWrap(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); result.placeholder = curryRight.placeholder; return result; } @@ -19558,14 +20003,18 @@ function serializer(replacer, cycleReplacer) { * milliseconds have elapsed since the last time the debounced function was * invoked. The debounced function comes with a `cancel` method to cancel * delayed `func` invocations and a `flush` method to immediately invoke them. - * Provide an options object to indicate whether `func` should be invoked on - * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked - * with the last arguments provided to the debounced function. Subsequent calls - * to the debounced function return the result of the last `func` invocation. + * Provide `options` to indicate whether `func` should be invoked on the + * leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent + * calls to the debounced function return the result of the last `func` + * invocation. * - * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked - * on the trailing edge of the timeout only if the debounced function is - * invoked more than once during the `wait` timeout. + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the debounced function + * is invoked more than once during the `wait` timeout. + * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.debounce` and `_.throttle`. @@ -19686,6 +20135,9 @@ function serializer(replacer, cycleReplacer) { } function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } lastInvokeTime = 0; lastArgs = lastCallTime = lastThis = timerId = undefined; } @@ -19740,7 +20192,7 @@ function serializer(replacer, cycleReplacer) { * }, 'deferred'); * // => Logs 'deferred' after one or more milliseconds. */ - var defer = rest(function(func, args) { + var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); }); @@ -19763,7 +20215,7 @@ function serializer(replacer, cycleReplacer) { * }, 1000, 'later'); * // => Logs 'later' after one second. */ - var delay = rest(function(func, wait, args) { + var delay = baseRest(function(func, wait, args) { return baseDelay(func, toNumber(wait) || 0, args); }); @@ -19786,7 +20238,7 @@ function serializer(replacer, cycleReplacer) { * // => ['d', 'c', 'b', 'a'] */ function flip(func) { - return createWrapper(func, FLIP_FLAG); + return createWrap(func, FLIP_FLAG); } /** @@ -19799,7 +20251,7 @@ function serializer(replacer, cycleReplacer) { * **Note:** The cache is exposed as the `cache` property on the memoized * function. Its creation may be customized by replacing the `_.memoize.Cache` * constructor with one whose instances implement the - * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) + * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object) * method interface of `delete`, `get`, `has`, and `set`. * * @static @@ -19881,7 +20333,14 @@ function serializer(replacer, cycleReplacer) { throw new TypeError(FUNC_ERROR_TEXT); } return function() { - return !predicate.apply(this, arguments); + var args = arguments; + switch (args.length) { + case 0: return !predicate.call(this); + case 1: return !predicate.call(this, args[0]); + case 2: return !predicate.call(this, args[0], args[1]); + case 3: return !predicate.call(this, args[0], args[1], args[2]); + } + return !predicate.apply(this, args); }; } @@ -19901,23 +20360,22 @@ function serializer(replacer, cycleReplacer) { * var initialize = _.once(createApplication); * initialize(); * initialize(); - * // `initialize` invokes `createApplication` once + * // => `createApplication` is invoked once */ function once(func) { return before(2, func); } /** - * Creates a function that invokes `func` with arguments transformed by - * corresponding `transforms`. + * Creates a function that invokes `func` with its arguments transformed. * * @static * @since 4.0.0 * @memberOf _ * @category Function * @param {Function} func The function to wrap. - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [transforms[_.identity]] The functions to transform. + * @param {...(Function|Function[])} [transforms=[_.identity]] + * The argument transforms. * @returns {Function} Returns the new function. * @example * @@ -19939,13 +20397,13 @@ function serializer(replacer, cycleReplacer) { * func(10, 5); * // => [100, 10] */ - var overArgs = rest(function(func, transforms) { + var overArgs = baseRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), baseUnary(getIteratee())); + : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); var funcsLength = transforms.length; - return rest(function(args) { + return baseRest(function(args) { var index = -1, length = nativeMin(args.length, funcsLength); @@ -19976,9 +20434,9 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new partially applied function. * @example * - * var greet = function(greeting, name) { + * function greet(greeting, name) { * return greeting + ' ' + name; - * }; + * } * * var sayHelloTo = _.partial(greet, 'hello'); * sayHelloTo('fred'); @@ -19989,9 +20447,9 @@ function serializer(replacer, cycleReplacer) { * greetFred('hi'); * // => 'hi fred' */ - var partial = rest(function(func, partials) { + var partial = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partial)); - return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); + return createWrap(func, PARTIAL_FLAG, undefined, partials, holders); }); /** @@ -20013,9 +20471,9 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new partially applied function. * @example * - * var greet = function(greeting, name) { + * function greet(greeting, name) { * return greeting + ' ' + name; - * }; + * } * * var greetFred = _.partialRight(greet, 'fred'); * greetFred('hi'); @@ -20026,9 +20484,9 @@ function serializer(replacer, cycleReplacer) { * sayHelloTo('fred'); * // => 'hello fred' */ - var partialRight = rest(function(func, partials) { + var partialRight = baseRest(function(func, partials) { var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); + return createWrap(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); }); /** @@ -20053,8 +20511,8 @@ function serializer(replacer, cycleReplacer) { * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ - var rearg = rest(function(func, indexes) { - return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); + var rearg = baseRest(function(func, indexes) { + return createWrap(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); }); /** @@ -20086,35 +20544,14 @@ function serializer(replacer, cycleReplacer) { if (typeof func != 'function') { throw new TypeError(FUNC_ERROR_TEXT); } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; + start = start === undefined ? start : toInteger(start); + return baseRest(func, start); } /** * Creates a function that invokes `func` with the `this` binding of the * create function and an array of arguments much like - * [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply). + * [`Function#apply`](http://www.ecma-international.org/ecma-262/7.0/#sec-function.prototype.apply). * * **Note:** This method is based on the * [spread operator](https://mdn.io/spread_operator). @@ -20150,7 +20587,7 @@ function serializer(replacer, cycleReplacer) { throw new TypeError(FUNC_ERROR_TEXT); } start = start === undefined ? 0 : nativeMax(toInteger(start), 0); - return rest(function(args) { + return baseRest(function(args) { var array = args[start], otherArgs = castSlice(args, 0, start); @@ -20165,8 +20602,8 @@ function serializer(replacer, cycleReplacer) { * Creates a throttled function that only invokes `func` at most once per * every `wait` milliseconds. The throttled function comes with a `cancel` * method to cancel delayed `func` invocations and a `flush` method to - * immediately invoke them. Provide an options object to indicate whether - * `func` should be invoked on the leading and/or trailing edge of the `wait` + * immediately invoke them. Provide `options` to indicate whether `func` + * should be invoked on the leading and/or trailing edge of the `wait` * timeout. The `func` is invoked with the last arguments provided to the * throttled function. Subsequent calls to the throttled function return the * result of the last `func` invocation. @@ -20175,6 +20612,9 @@ function serializer(replacer, cycleReplacer) { * invoked on the trailing edge of the timeout only if the throttled function * is invoked more than once during the `wait` timeout. * + * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred + * until to the next tick, similar to `setTimeout` with a timeout of `0`. + * * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) * for details over the differences between `_.throttle` and `_.debounce`. * @@ -20240,10 +20680,10 @@ function serializer(replacer, cycleReplacer) { } /** - * Creates a function that provides `value` to the wrapper function as its - * first argument. Any additional arguments provided to the function are - * appended to those provided to the wrapper function. The wrapper is invoked - * with the `this` binding of the created function. + * Creates a function that provides `value` to `wrapper` as its first + * argument. Any additional arguments provided to the function are appended + * to those provided to the `wrapper`. The wrapper is invoked with the `this` + * binding of the created function. * * @static * @memberOf _ @@ -20428,9 +20868,37 @@ function serializer(replacer, cycleReplacer) { return baseClone(value, true, true, customizer); } + /** + * Checks if `object` conforms to `source` by invoking the predicate + * properties of `source` with the corresponding property values of `object`. + * + * **Note:** This method is equivalent to `_.conforms` when `source` is + * partially applied. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property predicates to conform to. + * @returns {boolean} Returns `true` if `object` conforms, else `false`. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * + * _.conformsTo(object, { 'b': function(n) { return n > 1; } }); + * // => true + * + * _.conformsTo(object, { 'b': function(n) { return n > 2; } }); + * // => false + */ + function conformsTo(object, source) { + return source == null || baseConformsTo(object, source, keys(source)); + } + /** * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * comparison between two values to determine if they are equivalent. * * @static @@ -20442,8 +20910,8 @@ function serializer(replacer, cycleReplacer) { * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * * _.eq(object, object); * // => true @@ -20524,7 +20992,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, + * @returns {boolean} Returns `true` if `value` is an `arguments` object, * else `false`. * @example * @@ -20535,7 +21003,7 @@ function serializer(replacer, cycleReplacer) { * // => false */ function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); } @@ -20546,11 +21014,9 @@ function serializer(replacer, cycleReplacer) { * @static * @memberOf _ * @since 0.1.0 - * @type {Function} * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. * @example * * _.isArray([1, 2, 3]); @@ -20575,8 +21041,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an array buffer, else `false`. * @example * * _.isArrayBuffer(new ArrayBuffer(2)); @@ -20585,9 +21050,7 @@ function serializer(replacer, cycleReplacer) { * _.isArrayBuffer(new Array(2)); * // => false */ - function isArrayBuffer(value) { - return isObjectLike(value) && objectToString.call(value) == arrayBufferTag; - } + var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; /** * Checks if `value` is array-like. A value is considered array-like if it's @@ -20615,7 +21078,7 @@ function serializer(replacer, cycleReplacer) { * // => false */ function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value); } /** @@ -20655,8 +21118,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a boolean, else `false`. * @example * * _.isBoolean(false); @@ -20687,9 +21149,7 @@ function serializer(replacer, cycleReplacer) { * _.isBuffer(new Uint8Array(2)); * // => false */ - var isBuffer = !Buffer ? stubFalse : function(value) { - return value instanceof Buffer; - }; + var isBuffer = nativeIsBuffer || stubFalse; /** * Checks if `value` is classified as a `Date` object. @@ -20699,8 +21159,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a date object, else `false`. * @example * * _.isDate(new Date); @@ -20709,9 +21168,7 @@ function serializer(replacer, cycleReplacer) { * _.isDate('Mon April 23 2012'); * // => false */ - function isDate(value) { - return isObjectLike(value) && objectToString.call(value) == dateTag; - } + var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; /** * Checks if `value` is likely a DOM element. @@ -20721,8 +21178,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a DOM element, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`. * @example * * _.isElement(document.body); @@ -20770,22 +21226,23 @@ function serializer(replacer, cycleReplacer) { */ function isEmpty(value) { if (isArrayLike(value) && - (isArray(value) || isString(value) || isFunction(value.splice) || - isArguments(value) || isBuffer(value))) { + (isArray(value) || typeof value == 'string' || + typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) { return !value.length; } - if (isObjectLike(value)) { - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + if (nonEnumShadows || isPrototype(value)) { + return !nativeKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { return false; } } - return !(nonEnumShadows && keys(value).length); + return true; } /** @@ -20804,12 +21261,11 @@ function serializer(replacer, cycleReplacer) { * @category Lang * @param {*} value The value to compare. * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, - * else `false`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; * * _.isEqual(object, other); * // => true @@ -20834,8 +21290,7 @@ function serializer(replacer, cycleReplacer) { * @param {*} value The value to compare. * @param {*} other The other value to compare. * @param {Function} [customizer] The function to customize comparisons. - * @returns {boolean} Returns `true` if the values are equivalent, - * else `false`. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. * @example * * function isGreeting(value) { @@ -20869,8 +21324,7 @@ function serializer(replacer, cycleReplacer) { * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an error object, - * else `false`. + * @returns {boolean} Returns `true` if `value` is an error object, else `false`. * @example * * _.isError(new Error); @@ -20898,8 +21352,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a finite number, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a finite number, else `false`. * @example * * _.isFinite(3); @@ -20926,8 +21379,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -20938,8 +21390,7 @@ function serializer(replacer, cycleReplacer) { */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } @@ -20977,16 +21428,15 @@ function serializer(replacer, cycleReplacer) { /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); @@ -21008,7 +21458,7 @@ function serializer(replacer, cycleReplacer) { /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static @@ -21072,8 +21522,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a map, else `false`. * @example * * _.isMap(new Map); @@ -21082,16 +21531,18 @@ function serializer(replacer, cycleReplacer) { * _.isMap(new WeakMap); * // => false */ - function isMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } + var isMap = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; /** * Performs a partial deep comparison between `object` and `source` to - * determine if `object` contains equivalent property values. This method is - * equivalent to a `_.matches` function when `source` is partially applied. + * determine if `object` contains equivalent property values. + * + * **Note:** This method is equivalent to `_.matches` when `source` is + * partially applied. * - * **Note:** This method supports comparing the same values as `_.isEqual`. + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. * * @static * @memberOf _ @@ -21102,12 +21553,12 @@ function serializer(replacer, cycleReplacer) { * @returns {boolean} Returns `true` if `object` is a match, else `false`. * @example * - * var object = { 'user': 'fred', 'age': 40 }; + * var object = { 'a': 1, 'b': 2 }; * - * _.isMatch(object, { 'age': 40 }); + * _.isMatch(object, { 'b': 2 }); * // => true * - * _.isMatch(object, { 'age': 36 }); + * _.isMatch(object, { 'b': 1 }); * // => false */ function isMatch(object, source) { @@ -21189,13 +21640,13 @@ function serializer(replacer, cycleReplacer) { /** * Checks if `value` is a pristine native function. * - * **Note:** This method can't reliably detect native functions in the - * presence of the `core-js` package because `core-js` circumvents this kind - * of detection. Despite multiple requests, the `core-js` maintainer has made - * it clear: any attempt to fix the detection will be obstructed. As a result, - * we're left with little choice but to throw an error. Unfortunately, this - * also affects packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), - * which rely on `core-js`. + * **Note:** This method can't reliably detect native functions in the presence + * of the core-js package because core-js circumvents this kind of detection. + * Despite multiple requests, the core-js maintainer has made it clear: any + * attempt to fix the detection will be obstructed. As a result, we're left + * with little choice but to throw an error. Unfortunately, this also affects + * packages, like [babel-polyfill](https://www.npmjs.com/package/babel-polyfill), + * which rely on core-js. * * @static * @memberOf _ @@ -21214,7 +21665,7 @@ function serializer(replacer, cycleReplacer) { */ function isNative(value) { if (isMaskable(value)) { - throw new Error('This method is not supported with `core-js`. Try https://github.com/es-shims.'); + throw new Error('This method is not supported with core-js. Try https://github.com/es-shims.'); } return baseIsNative(value); } @@ -21275,8 +21726,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a number, else `false`. * @example * * _.isNumber(3); @@ -21305,8 +21755,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.8.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a plain object, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a plain object, else `false`. * @example * * function Foo() { @@ -21347,8 +21796,7 @@ function serializer(replacer, cycleReplacer) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a regexp, else `false`. * @example * * _.isRegExp(/abc/); @@ -21357,9 +21805,7 @@ function serializer(replacer, cycleReplacer) { * _.isRegExp('/abc/'); * // => false */ - function isRegExp(value) { - return isObject(value) && objectToString.call(value) == regexpTag; - } + var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; /** * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 @@ -21373,8 +21819,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a safe integer, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a safe integer, else `false`. * @example * * _.isSafeInteger(3); @@ -21401,8 +21846,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a set, else `false`. * @example * * _.isSet(new Set); @@ -21411,9 +21855,7 @@ function serializer(replacer, cycleReplacer) { * _.isSet(new WeakSet); * // => false */ - function isSet(value) { - return isObjectLike(value) && getTag(value) == setTag; - } + var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; /** * Checks if `value` is classified as a `String` primitive or object. @@ -21423,8 +21865,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a string, else `false`. * @example * * _.isString('abc'); @@ -21446,8 +21887,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a symbol, else `false`. * @example * * _.isSymbol(Symbol.iterator); @@ -21469,8 +21909,7 @@ function serializer(replacer, cycleReplacer) { * @since 3.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a typed array, else `false`. * @example * * _.isTypedArray(new Uint8Array); @@ -21479,10 +21918,7 @@ function serializer(replacer, cycleReplacer) { * _.isTypedArray([]); * // => false */ - function isTypedArray(value) { - return isObjectLike(value) && - isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; - } + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; /** * Checks if `value` is `undefined`. @@ -21513,8 +21949,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a weak map, else `false`. * @example * * _.isWeakMap(new WeakMap); @@ -21535,8 +21970,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.3.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a weak set, else `false`. * @example * * _.isWeakSet(new WeakSet); @@ -21679,7 +22113,7 @@ function serializer(replacer, cycleReplacer) { * Converts `value` to an integer. * * **Note:** This method is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * [`ToInteger`](http://www.ecma-international.org/ecma-262/7.0/#sec-tointeger). * * @static * @memberOf _ @@ -21713,7 +22147,7 @@ function serializer(replacer, cycleReplacer) { * array-like object. * * **Note:** This method is based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ @@ -21770,7 +22204,7 @@ function serializer(replacer, cycleReplacer) { return NAN; } if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; + var other = typeof value.valueOf == 'function' ? value.valueOf() : value; value = isObject(other) ? (other + '') : other; } if (typeof value != 'string') { @@ -21885,18 +22319,18 @@ function serializer(replacer, cycleReplacer) { * @example * * function Foo() { - * this.c = 3; + * this.a = 1; * } * * function Bar() { - * this.e = 5; + * this.c = 3; * } * - * Foo.prototype.d = 4; - * Bar.prototype.f = 6; + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; * - * _.assign({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'c': 3, 'e': 5 } + * _.assign({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { @@ -21928,27 +22362,21 @@ function serializer(replacer, cycleReplacer) { * @example * * function Foo() { - * this.b = 2; + * this.a = 1; * } * * function Bar() { - * this.d = 4; + * this.c = 3; * } * - * Foo.prototype.c = 3; - * Bar.prototype.e = 5; + * Foo.prototype.b = 2; + * Bar.prototype.d = 4; * - * _.assignIn({ 'a': 1 }, new Foo, new Bar); - * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + * _.assignIn({ 'a': 0 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4 } */ var assignIn = createAssigner(function(object, source) { - if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { - copyObject(source, keysIn(source), object); - return; - } - for (var key in source) { - assignValue(object, key, source[key]); - } + copyObject(source, keysIn(source), object); }); /** @@ -22033,7 +22461,7 @@ function serializer(replacer, cycleReplacer) { * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ - var at = rest(function(object, paths) { + var at = baseRest(function(object, paths) { return baseAt(object, baseFlatten(paths, 1)); }); @@ -22094,10 +22522,10 @@ function serializer(replacer, cycleReplacer) { * @see _.defaultsDeep * @example * - * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); - * // => { 'user': 'barney', 'age': 36 } + * _.defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } */ - var defaults = rest(function(args) { + var defaults = baseRest(function(args) { args.push(undefined, assignInDefaults); return apply(assignInWith, undefined, args); }); @@ -22118,11 +22546,10 @@ function serializer(replacer, cycleReplacer) { * @see _.defaults * @example * - * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); - * // => { 'user': { 'name': 'barney', 'age': 36 } } - * + * _.defaultsDeep({ 'a': { 'b': 2 } }, { 'a': { 'b': 1, 'c': 3 } }); + * // => { 'a': { 'b': 2, 'c': 3 } } */ - var defaultsDeep = rest(function(args) { + var defaultsDeep = baseRest(function(args) { args.push(undefined, mergeDefaults); return apply(mergeWith, undefined, args); }); @@ -22135,9 +22562,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 1.1.0 * @category Object - * @param {Object} object The object to search. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example @@ -22175,9 +22601,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 2.0.0 * @category Object - * @param {Object} object The object to search. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per iteration. + * @param {Object} object The object to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. * @returns {string|undefined} Returns the key of the matched element, * else `undefined`. * @example @@ -22391,7 +22816,7 @@ function serializer(replacer, cycleReplacer) { /** * Gets the value at `path` of `object`. If the resolved value is - * `undefined`, the `defaultValue` is used in its place. + * `undefined`, the `defaultValue` is returned in its place. * * @static * @memberOf _ @@ -22514,8 +22939,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.1.0 * @category Object * @param {Object} object The object to invert. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {Object} Returns the new inverted object. * @example * @@ -22555,13 +22979,13 @@ function serializer(replacer, cycleReplacer) { * _.invoke(object, 'a[0].b.c.slice', 1, 3); * // => [2, 3] */ - var invoke = rest(baseInvoke); + var invoke = baseRest(baseInvoke); /** * Creates an array of the own enumerable property names of `object`. * * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) * for more details. * * @static @@ -22586,23 +23010,7 @@ function serializer(replacer, cycleReplacer) { * // => ['0', '1'] */ function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); } /** @@ -22629,23 +23037,7 @@ function serializer(replacer, cycleReplacer) { * // => ['a', 'b', 'c'] (iteration order is not guaranteed) */ function keysIn(object) { - var index = -1, - isProto = isPrototype(object), - props = baseKeysIn(object), - propsLength = props.length, - indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - while (++index < propsLength) { - var key = props[index]; - if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { - result.push(key); - } - } - return result; + return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); } /** @@ -22659,8 +23051,7 @@ function serializer(replacer, cycleReplacer) { * @since 3.8.0 * @category Object * @param {Object} object The object to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The function invoked per iteration. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapValues * @example @@ -22691,8 +23082,7 @@ function serializer(replacer, cycleReplacer) { * @since 2.4.0 * @category Object * @param {Object} object The object to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The function invoked per iteration. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. * @returns {Object} Returns the new mapped object. * @see _.mapKeys * @example @@ -22739,16 +23129,16 @@ function serializer(replacer, cycleReplacer) { * @returns {Object} Returns `object`. * @example * - * var users = { - * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * var object = { + * 'a': [{ 'b': 2 }, { 'd': 4 }] * }; * - * var ages = { - * 'data': [{ 'age': 36 }, { 'age': 40 }] + * var other = { + * 'a': [{ 'c': 3 }, { 'e': 5 }] * }; * - * _.merge(users, ages); - * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + * _.merge(object, other); + * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] } */ var merge = createAssigner(function(object, source, srcIndex) { baseMerge(object, source, srcIndex); @@ -22779,18 +23169,11 @@ function serializer(replacer, cycleReplacer) { * } * } * - * var object = { - * 'fruits': ['apple'], - * 'vegetables': ['beet'] - * }; - * - * var other = { - * 'fruits': ['banana'], - * 'vegetables': ['carrot'] - * }; + * var object = { 'a': [1], 'b': [2] }; + * var other = { 'a': [3], 'b': [4] }; * * _.mergeWith(object, other, customizer); - * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + * // => { 'a': [1, 3], 'b': [2, 4] } */ var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { baseMerge(object, source, srcIndex, customizer); @@ -22815,7 +23198,7 @@ function serializer(replacer, cycleReplacer) { * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ - var omit = rest(function(object, props) { + var omit = baseRest(function(object, props) { if (object == null) { return {}; } @@ -22834,8 +23217,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Object * @param {Object} object The source object. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per property. + * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * @@ -22845,10 +23227,7 @@ function serializer(replacer, cycleReplacer) { * // => { 'b': '2' } */ function omitBy(object, predicate) { - predicate = getIteratee(predicate); - return basePickBy(object, function(value, key) { - return !predicate(value, key); - }); + return pickBy(object, negate(getIteratee(predicate))); } /** @@ -22868,7 +23247,7 @@ function serializer(replacer, cycleReplacer) { * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ - var pick = rest(function(object, props) { + var pick = baseRest(function(object, props) { return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey)); }); @@ -22881,8 +23260,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Object * @param {Object} object The source object. - * @param {Array|Function|Object|string} [predicate=_.identity] - * The function invoked per property. + * @param {Function} [predicate=_.identity] The function invoked per property. * @returns {Object} Returns the new object. * @example * @@ -22892,7 +23270,7 @@ function serializer(replacer, cycleReplacer) { * // => { 'a': 1, 'c': 3 } */ function pickBy(object, predicate) { - return object == null ? {} : basePickBy(object, getIteratee(predicate)); + return object == null ? {} : basePickBy(object, getAllKeysIn(object), getIteratee(predicate)); } /** @@ -23336,12 +23714,12 @@ function serializer(replacer, cycleReplacer) { * // => true */ function inRange(number, start, end) { - start = toNumber(start) || 0; + start = toFinite(start); if (end === undefined) { end = start; start = 0; } else { - end = toNumber(end) || 0; + end = toFinite(end); } number = toNumber(number); return baseInRange(number, start, end); @@ -23397,12 +23775,12 @@ function serializer(replacer, cycleReplacer) { upper = 1; } else { - lower = toNumber(lower) || 0; + lower = toFinite(lower); if (upper === undefined) { upper = lower; lower = 0; } else { - upper = toNumber(upper) || 0; + upper = toFinite(upper); } } if (lower > upper) { @@ -23465,8 +23843,9 @@ function serializer(replacer, cycleReplacer) { /** * Deburrs `string` by converting - * [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) - * to basic latin letters and removing + * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A) + * letters to basic Latin letters and removing * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). * * @static @@ -23482,7 +23861,7 @@ function serializer(replacer, cycleReplacer) { */ function deburr(string) { string = toString(string); - return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ''); } /** @@ -23492,7 +23871,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 3.0.0 * @category String - * @param {string} [string=''] The string to search. + * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to search up to. * @returns {boolean} Returns `true` if `string` ends with `target`, @@ -23517,8 +23896,9 @@ function serializer(replacer, cycleReplacer) { ? length : baseClamp(toInteger(position), 0, length); + var end = position; position -= target.length; - return position >= 0 && string.indexOf(target, position) == position; + return position >= 0 && string.slice(position, end) == target; } /** @@ -23847,7 +24227,7 @@ function serializer(replacer, cycleReplacer) { var args = arguments, string = toString(args[0]); - return args.length < 3 ? string : nativeReplace.call(string, args[1], args[2]); + return args.length < 3 ? string : string.replace(args[1], args[2]); } /** @@ -23908,11 +24288,11 @@ function serializer(replacer, cycleReplacer) { (separator != null && !isRegExp(separator)) )) { separator = baseToString(separator); - if (separator == '' && reHasComplexSymbol.test(string)) { + if (!separator && hasUnicode(string)) { return castSlice(stringToArray(string), 0, limit); } } - return nativeSplit.call(string, separator, limit); + return string.split(separator, limit); } /** @@ -23947,7 +24327,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 3.0.0 * @category String - * @param {string} [string=''] The string to search. + * @param {string} [string=''] The string to inspect. * @param {string} [target] The string to search for. * @param {number} [position=0] The position to search from. * @returns {boolean} Returns `true` if `string` starts with `target`, @@ -23966,7 +24346,8 @@ function serializer(replacer, cycleReplacer) { function startsWith(string, target, position) { string = toString(string); position = baseClamp(toInteger(position), 0, string.length); - return string.lastIndexOf(baseToString(target), position) == position; + target = baseToString(target); + return string.slice(position, position + target.length) == target; } /** @@ -24383,7 +24764,7 @@ function serializer(replacer, cycleReplacer) { string = toString(string); var strLength = string.length; - if (reHasComplexSymbol.test(string)) { + if (hasUnicode(string)) { var strSymbols = stringToArray(string); strLength = strSymbols.length; } @@ -24520,7 +24901,7 @@ function serializer(replacer, cycleReplacer) { pattern = guard ? undefined : pattern; if (pattern === undefined) { - pattern = reHasComplexWord.test(string) ? reComplexWord : reBasicWord; + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } return string.match(pattern) || []; } @@ -24549,7 +24930,7 @@ function serializer(replacer, cycleReplacer) { * elements = []; * } */ - var attempt = rest(function(func, args) { + var attempt = baseRest(function(func, args) { try { return apply(func, undefined, args); } catch (e) { @@ -24574,16 +24955,16 @@ function serializer(replacer, cycleReplacer) { * * var view = { * 'label': 'docs', - * 'onClick': function() { + * 'click': function() { * console.log('clicked ' + this.label); * } * }; * - * _.bindAll(view, ['onClick']); - * jQuery(element).on('click', view.onClick); + * _.bindAll(view, ['click']); + * jQuery(element).on('click', view.click); * // => Logs 'clicked docs' when clicked. */ - var bindAll = rest(function(object, methodNames) { + var bindAll = baseRest(function(object, methodNames) { arrayEach(baseFlatten(methodNames, 1), function(key) { key = toKey(key); object[key] = bind(object[key], object); @@ -24608,7 +24989,7 @@ function serializer(replacer, cycleReplacer) { * var func = _.cond([ * [_.matches({ 'a': 1 }), _.constant('matches A')], * [_.conforms({ 'b': _.isNumber }), _.constant('matches B')], - * [_.constant(true), _.constant('no match')] + * [_.stubTrue, _.constant('no match')] * ]); * * func({ 'a': 1, 'b': 2 }); @@ -24631,7 +25012,7 @@ function serializer(replacer, cycleReplacer) { return [toIteratee(pair[0]), pair[1]]; }); - return rest(function(args) { + return baseRest(function(args) { var index = -1; while (++index < length) { var pair = pairs[index]; @@ -24647,6 +25028,9 @@ function serializer(replacer, cycleReplacer) { * the corresponding property values of a given object, returning `true` if * all predicates return truthy, else `false`. * + * **Note:** The created function is equivalent to `_.conformsTo` with + * `source` partially applied. + * * @static * @memberOf _ * @since 4.0.0 @@ -24655,13 +25039,13 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new spec function. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36 }, - * { 'user': 'fred', 'age': 40 } + * var objects = [ + * { 'a': 2, 'b': 1 }, + * { 'a': 1, 'b': 2 } * ]; * - * _.filter(users, _.conforms({ 'age': function(n) { return n > 38; } })); - * // => [{ 'user': 'fred', 'age': 40 }] + * _.filter(objects, _.conforms({ 'b': function(n) { return n > 1; } })); + * // => [{ 'a': 1, 'b': 2 }] */ function conforms(source) { return baseConforms(baseClone(source, true)); @@ -24692,6 +25076,30 @@ function serializer(replacer, cycleReplacer) { }; } + /** + * Checks `value` to determine whether a default value should be returned in + * its place. The `defaultValue` is returned if `value` is `NaN`, `null`, + * or `undefined`. + * + * @static + * @memberOf _ + * @since 4.14.0 + * @category Util + * @param {*} value The value to check. + * @param {*} defaultValue The default value. + * @returns {*} Returns the resolved value. + * @example + * + * _.defaultTo(1, 10); + * // => 1 + * + * _.defaultTo(undefined, 10); + * // => 10 + */ + function defaultTo(value, defaultValue) { + return (value == null || value !== value) ? defaultValue : value; + } + /** * Creates a function that returns the result of invoking the given functions * with the `this` binding of the created function, where each successive @@ -24701,7 +25109,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 3.0.0 * @category Util - * @param {...(Function|Function[])} [funcs] Functions to invoke. + * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flowRight * @example @@ -24724,7 +25132,7 @@ function serializer(replacer, cycleReplacer) { * @since 3.0.0 * @memberOf _ * @category Util - * @param {...(Function|Function[])} [funcs] Functions to invoke. + * @param {...(Function|Function[])} [funcs] The functions to invoke. * @returns {Function} Returns the new composite function. * @see _.flow * @example @@ -24740,7 +25148,7 @@ function serializer(replacer, cycleReplacer) { var flowRight = createFlow(true); /** - * This method returns the first argument given to it. + * This method returns the first argument it receives. * * @static * @since 0.1.0 @@ -24750,7 +25158,7 @@ function serializer(replacer, cycleReplacer) { * @returns {*} Returns `value`. * @example * - * var object = { 'user': 'fred' }; + * var object = { 'a': 1 }; * * console.log(_.identity(object) === object); * // => true @@ -24808,10 +25216,14 @@ function serializer(replacer, cycleReplacer) { /** * Creates a function that performs a partial deep comparison between a given * object and `source`, returning `true` if the given object has equivalent - * property values, else `false`. The created function is equivalent to - * `_.isMatch` with a `source` partially applied. + * property values, else `false`. + * + * **Note:** The created function is equivalent to `_.isMatch` with `source` + * partially applied. * - * **Note:** This method supports comparing the same values as `_.isEqual`. + * Partial comparisons will match empty array and empty object `source` + * values against any array or object value, respectively. See `_.isEqual` + * for a list of supported value comparisons. * * @static * @memberOf _ @@ -24821,13 +25233,13 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new spec function. * @example * - * var users = [ - * { 'user': 'barney', 'age': 36, 'active': true }, - * { 'user': 'fred', 'age': 40, 'active': false } + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } * ]; * - * _.filter(users, _.matches({ 'age': 40, 'active': false })); - * // => [{ 'user': 'fred', 'age': 40, 'active': false }] + * _.filter(objects, _.matches({ 'a': 4, 'c': 6 })); + * // => [{ 'a': 4, 'b': 5, 'c': 6 }] */ function matches(source) { return baseMatches(baseClone(source, true)); @@ -24838,7 +25250,9 @@ function serializer(replacer, cycleReplacer) { * value at `path` of a given object to `srcValue`, returning `true` if the * object value is equivalent, else `false`. * - * **Note:** This method supports comparing the same values as `_.isEqual`. + * **Note:** Partial comparisons will match empty array and empty object + * `srcValue` values against any array or object value, respectively. See + * `_.isEqual` for a list of supported value comparisons. * * @static * @memberOf _ @@ -24849,13 +25263,13 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new spec function. * @example * - * var users = [ - * { 'user': 'barney' }, - * { 'user': 'fred' } + * var objects = [ + * { 'a': 1, 'b': 2, 'c': 3 }, + * { 'a': 4, 'b': 5, 'c': 6 } * ]; * - * _.find(users, _.matchesProperty('user', 'fred')); - * // => { 'user': 'fred' } + * _.find(objects, _.matchesProperty('a', 4)); + * // => { 'a': 4, 'b': 5, 'c': 6 } */ function matchesProperty(path, srcValue) { return baseMatchesProperty(path, baseClone(srcValue, true)); @@ -24885,7 +25299,7 @@ function serializer(replacer, cycleReplacer) { * _.map(objects, _.method(['a', 'b'])); * // => [2, 1] */ - var method = rest(function(path, args) { + var method = baseRest(function(path, args) { return function(object) { return baseInvoke(object, path, args); }; @@ -24914,7 +25328,7 @@ function serializer(replacer, cycleReplacer) { * _.map([['a', '2'], ['c', '0']], _.methodOf(object)); * // => [2, 0] */ - var methodOf = rest(function(object, args) { + var methodOf = baseRest(function(object, args) { return function(path) { return baseInvoke(object, path, args); }; @@ -25013,7 +25427,7 @@ function serializer(replacer, cycleReplacer) { } /** - * A method that returns `undefined`. + * This method returns `undefined`. * * @static * @memberOf _ @@ -25050,7 +25464,7 @@ function serializer(replacer, cycleReplacer) { */ function nthArg(n) { n = toInteger(n); - return rest(function(args) { + return baseRest(function(args) { return baseNth(args, n); }); } @@ -25063,8 +25477,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 4.0.0 * @category Util - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [iteratees=[_.identity]] The iteratees to invoke. + * @param {...(Function|Function[])} [iteratees=[_.identity]] + * The iteratees to invoke. * @returns {Function} Returns the new function. * @example * @@ -25083,8 +25497,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 4.0.0 * @category Util - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [predicates=[_.identity]] The predicates to check. + * @param {...(Function|Function[])} [predicates=[_.identity]] + * The predicates to check. * @returns {Function} Returns the new function. * @example * @@ -25109,8 +25523,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 4.0.0 * @category Util - * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} - * [predicates=[_.identity]] The predicates to check. + * @param {...(Function|Function[])} [predicates=[_.identity]] + * The predicates to check. * @returns {Function} Returns the new function. * @example * @@ -25262,7 +25676,7 @@ function serializer(replacer, cycleReplacer) { var rangeRight = createRange(true); /** - * A method that returns a new empty array. + * This method returns a new empty array. * * @static * @memberOf _ @@ -25284,7 +25698,7 @@ function serializer(replacer, cycleReplacer) { } /** - * A method that returns `false`. + * This method returns `false`. * * @static * @memberOf _ @@ -25301,7 +25715,7 @@ function serializer(replacer, cycleReplacer) { } /** - * A method that returns a new empty object. + * This method returns a new empty object. * * @static * @memberOf _ @@ -25323,7 +25737,7 @@ function serializer(replacer, cycleReplacer) { } /** - * A method that returns an empty string. + * This method returns an empty string. * * @static * @memberOf _ @@ -25340,7 +25754,7 @@ function serializer(replacer, cycleReplacer) { } /** - * A method that returns `true`. + * This method returns `true`. * * @static * @memberOf _ @@ -25458,7 +25872,7 @@ function serializer(replacer, cycleReplacer) { */ var add = createMathOperation(function(augend, addend) { return augend + addend; - }); + }, 0); /** * Computes `number` rounded up to `precision`. @@ -25500,7 +25914,7 @@ function serializer(replacer, cycleReplacer) { */ var divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; - }); + }, 1); /** * Computes `number` rounded down to `precision`. @@ -25559,8 +25973,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the maximum value. * @example * @@ -25575,7 +25988,7 @@ function serializer(replacer, cycleReplacer) { */ function maxBy(array, iteratee) { return (array && array.length) - ? baseExtremum(array, getIteratee(iteratee), baseGt) + ? baseExtremum(array, getIteratee(iteratee, 2), baseGt) : undefined; } @@ -25607,8 +26020,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.7.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the mean. * @example * @@ -25622,7 +26034,7 @@ function serializer(replacer, cycleReplacer) { * // => 5 */ function meanBy(array, iteratee) { - return baseMean(array, getIteratee(iteratee)); + return baseMean(array, getIteratee(iteratee, 2)); } /** @@ -25659,8 +26071,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {*} Returns the minimum value. * @example * @@ -25675,7 +26086,7 @@ function serializer(replacer, cycleReplacer) { */ function minBy(array, iteratee) { return (array && array.length) - ? baseExtremum(array, getIteratee(iteratee), baseLt) + ? baseExtremum(array, getIteratee(iteratee, 2), baseLt) : undefined; } @@ -25696,7 +26107,7 @@ function serializer(replacer, cycleReplacer) { */ var multiply = createMathOperation(function(multiplier, multiplicand) { return multiplier * multiplicand; - }); + }, 1); /** * Computes `number` rounded to `precision`. @@ -25738,7 +26149,7 @@ function serializer(replacer, cycleReplacer) { */ var subtract = createMathOperation(function(minuend, subtrahend) { return minuend - subtrahend; - }); + }, 0); /** * Computes the sum of the values in `array`. @@ -25770,8 +26181,7 @@ function serializer(replacer, cycleReplacer) { * @since 4.0.0 * @category Math * @param {Array} array The array to iterate over. - * @param {Array|Function|Object|string} [iteratee=_.identity] - * The iteratee invoked per element. + * @param {Function} [iteratee=_.identity] The iteratee invoked per element. * @returns {number} Returns the sum. * @example * @@ -25786,7 +26196,7 @@ function serializer(replacer, cycleReplacer) { */ function sumBy(array, iteratee) { return (array && array.length) - ? baseSum(array, getIteratee(iteratee)) + ? baseSum(array, getIteratee(iteratee, 2)) : 0; } @@ -25965,7 +26375,9 @@ function serializer(replacer, cycleReplacer) { lodash.cloneDeep = cloneDeep; lodash.cloneDeepWith = cloneDeepWith; lodash.cloneWith = cloneWith; + lodash.conformsTo = conformsTo; lodash.deburr = deburr; + lodash.defaultTo = defaultTo; lodash.divide = divide; lodash.endsWith = endsWith; lodash.eq = eq; @@ -26206,7 +26618,7 @@ function serializer(replacer, cycleReplacer) { return this.reverse().find(predicate); }; - LazyWrapper.prototype.invokeMap = rest(function(path, args) { + LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { if (typeof path == 'function') { return new LazyWrapper(this); } @@ -26216,10 +26628,7 @@ function serializer(replacer, cycleReplacer) { }); LazyWrapper.prototype.reject = function(predicate) { - predicate = getIteratee(predicate, 3); - return this.filter(function(value) { - return !predicate(value); - }); + return this.filter(negate(getIteratee(predicate))); }; LazyWrapper.prototype.slice = function(start, end) { @@ -26323,7 +26732,7 @@ function serializer(replacer, cycleReplacer) { } }); - realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{ + realNames[createHybrid(undefined, BIND_KEY_FLAG).name] = [{ 'name': 'wrapper', 'func': undefined }]; @@ -26342,6 +26751,9 @@ function serializer(replacer, cycleReplacer) { lodash.prototype.reverse = wrapperReverse; lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; + // Add lazy aliases. + lodash.prototype.first = lodash.prototype.head; + if (iteratorSymbol) { lodash.prototype[iteratorSymbol] = wrapperToIterator; } @@ -26353,22 +26765,21 @@ function serializer(replacer, cycleReplacer) { // Export lodash. var _ = runInContext(); - // Expose Lodash on the free variable `window` or `self` when available so it's - // globally accessible, even when bundled with Browserify, Webpack, etc. This - // also prevents errors in cases where Lodash is loaded by a script tag in the - // presence of an AMD loader. See http://requirejs.org/docs/errors.html#mismatch - // for more details. Use `_.noConflict` to remove Lodash from the global object. - (freeSelf || {})._ = _; - - // Some AMD build optimizers like r.js check for condition patterns like the following: + // Some AMD build optimizers, like r.js, check for condition patterns like: if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { + // Expose Lodash on the global object to prevent errors when Lodash is + // loaded by a script tag in the presence of an AMD loader. + // See http://requirejs.org/docs/errors.html#mismatch for more details. + // Use `_.noConflict` to remove Lodash from the global object. + root._ = _; + // Define as an anonymous module so, through path mapping, it can be // referenced as the "underscore" module. define(function() { return _; }); } - // Check for `exports` after `define` in case a build optimizer adds an `exports` object. + // Check for `exports` after `define` in case a build optimizer adds it. else if (freeModule) { // Export for Node.js. (freeModule.exports = _)._ = _; @@ -26947,7 +27358,7 @@ Back.setMode(process.env.NOCK_BACK_MODE || 'dryrun'); module.exports = exports = Back; }).call(this,require('_process')) -},{"./recorder":84,"./scope":86,"_process":94,"chai":11,"debug":43,"fs":6,"lodash":72,"mkdirp":73,"path":92,"util":134}],77:[function(require,module,exports){ +},{"./recorder":84,"./scope":86,"_process":94,"chai":11,"debug":43,"fs":6,"lodash":72,"mkdirp":73,"path":92,"util":136}],77:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -27286,7 +27697,7 @@ exports.isStream = isStream; }).call(this,require("buffer").Buffer) -},{"buffer":8,"debug":43,"http":113,"https":67,"lodash":72}],78:[function(require,module,exports){ +},{"buffer":8,"debug":43,"http":114,"https":67,"lodash":72}],78:[function(require,module,exports){ (function (Buffer,process){ 'use strict'; @@ -27370,7 +27781,7 @@ DelayedBody.prototype._transform = function (chunk, encoding, cb) { process.nextTick(cb); }; }).call(this,{"isBuffer":require("../../is-buffer/index.js")},require('_process')) -},{"../../is-buffer/index.js":70,"./common":77,"_process":94,"events":66,"stream":101,"util":134}],79:[function(require,module,exports){ +},{"../../is-buffer/index.js":70,"./common":77,"_process":94,"events":66,"stream":101,"util":136}],79:[function(require,module,exports){ var EventEmitter = require('events').EventEmitter module.exports = new EventEmitter(); @@ -27774,7 +28185,7 @@ module.exports.overrideClientRequest = overrideClientRequest; module.exports.restoreOverriddenClientRequest = restoreOverriddenClientRequest; }).call(this,require('_process')) -},{"./common":77,"./global_emitter":79,"./interceptor":81,"./request_overrider":85,"_process":94,"debug":43,"events":66,"http":113,"lodash":72,"timers":126,"url":130,"util":134}],81:[function(require,module,exports){ +},{"./common":77,"./global_emitter":79,"./interceptor":81,"./request_overrider":85,"_process":94,"debug":43,"events":66,"http":114,"lodash":72,"timers":128,"url":132,"util":136}],81:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -28313,7 +28724,7 @@ Interceptor.prototype.socketDelay = function socketDelay(ms) { }; }).call(this,require("buffer").Buffer) -},{"./common":77,"./match_body":82,"./mixin":83,"buffer":8,"debug":43,"fs":6,"json-stringify-safe":71,"lodash":72,"qs":88,"util":134}],82:[function(require,module,exports){ +},{"./common":77,"./match_body":82,"./mixin":83,"buffer":8,"debug":43,"fs":6,"json-stringify-safe":71,"lodash":72,"qs":88,"util":136}],82:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -28769,7 +29180,7 @@ exports.restore = restore; exports.clear = clear; }).call(this,require("buffer").Buffer) -},{"./common":77,"./intercept":80,"buffer":8,"debug":43,"lodash":72,"stream":101,"url":130,"util":134}],85:[function(require,module,exports){ +},{"./common":77,"./intercept":80,"buffer":8,"debug":43,"lodash":72,"stream":101,"url":132,"util":136}],85:[function(require,module,exports){ (function (process,Buffer){ 'use strict'; @@ -29299,7 +29710,7 @@ function RequestOverrider(req, options, interceptors, remove, cb) { module.exports = RequestOverrider; }).call(this,require('_process'),require("buffer").Buffer) -},{"./common":77,"./delayed_body":78,"./global_emitter":79,"./socket":87,"_process":94,"buffer":8,"debug":43,"events":66,"http":113,"lodash":72,"propagate":95,"stream":101,"timers":126}],86:[function(require,module,exports){ +},{"./common":77,"./delayed_body":78,"./global_emitter":79,"./socket":87,"_process":94,"buffer":8,"debug":43,"events":66,"http":114,"lodash":72,"propagate":95,"stream":101,"timers":128}],86:[function(require,module,exports){ /* jshint strict:false */ /** * @module nock/scope @@ -29657,7 +30068,7 @@ module.exports = extend(startScope, { emitter: globalEmitter, }); -},{"./common":77,"./global_emitter":79,"./intercept":80,"./interceptor":81,"assert":2,"debug":43,"events":66,"fs":6,"json-stringify-safe":71,"lodash":72,"url":130,"util":134}],87:[function(require,module,exports){ +},{"./common":77,"./global_emitter":79,"./intercept":80,"./interceptor":81,"assert":2,"debug":43,"events":66,"fs":6,"json-stringify-safe":71,"lodash":72,"url":132,"util":136}],87:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -29730,7 +30141,7 @@ function noop() {} }).call(this,require("buffer").Buffer) -},{"buffer":8,"debug":43,"events":66,"util":134}],88:[function(require,module,exports){ +},{"buffer":8,"debug":43,"events":66,"util":136}],88:[function(require,module,exports){ 'use strict'; var Stringify = require('./stringify'); @@ -30491,7 +30902,6 @@ function nextTick(fn, arg1, arg2, arg3) { }).call(this,require('_process')) },{"_process":94}],94:[function(require,module,exports){ // shim for using process in browser - var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it @@ -30503,21 +30913,63 @@ var cachedSetTimeout; var cachedClearTimeout; (function () { - try { - cachedSetTimeout = setTimeout; - } catch (e) { - cachedSetTimeout = function () { - throw new Error('setTimeout is not defined'); + try { + cachedSetTimeout = setTimeout; + } catch (e) { + cachedSetTimeout = function () { + throw new Error('setTimeout is not defined'); + } } - } - try { - cachedClearTimeout = clearTimeout; - } catch (e) { - cachedClearTimeout = function () { - throw new Error('clearTimeout is not defined'); + try { + cachedClearTimeout = clearTimeout; + } catch (e) { + cachedClearTimeout = function () { + throw new Error('clearTimeout is not defined'); + } } - } } ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} var queue = []; var draining = false; var currentQueue; @@ -30542,7 +30994,7 @@ function drainQueue() { if (draining) { return; } - var timeout = cachedSetTimeout(cleanUpNextTick); + var timeout = runTimeout(cleanUpNextTick); draining = true; var len = queue.length; @@ -30559,7 +31011,7 @@ function drainQueue() { } currentQueue = null; draining = false; - cachedClearTimeout(timeout); + runClearTimeout(timeout); } process.nextTick = function (fun) { @@ -30571,7 +31023,7 @@ process.nextTick = function (fun) { } queue.push(new Item(fun, args)); if (queue.length === 1 && !draining) { - cachedSetTimeout(drainQueue, 0); + runTimeout(drainQueue); } }; @@ -31556,7 +32008,7 @@ Stream.prototype.pipe = function(dest, options) { return dest; }; -},{"events":66,"inherits":69,"readable-stream/duplex.js":103,"readable-stream/passthrough.js":109,"readable-stream/readable.js":110,"readable-stream/transform.js":111,"readable-stream/writable.js":112}],102:[function(require,module,exports){ +},{"events":66,"inherits":69,"readable-stream/duplex.js":103,"readable-stream/passthrough.js":110,"readable-stream/readable.js":111,"readable-stream/transform.js":112,"readable-stream/writable.js":113}],102:[function(require,module,exports){ arguments[4][9][0].apply(exports,arguments) },{"dup":9}],103:[function(require,module,exports){ module.exports = require("./lib/_stream_duplex.js") @@ -31719,21 +32171,21 @@ if (debugUtil && debugUtil.debuglog) { } /**/ +var BufferList = require('./internal/streams/BufferList'); var StringDecoder; util.inherits(Readable, Stream); -var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - function prependListener(emitter, event, fn) { - if (hasPrependListener) return emitter.prependListener(event, fn); - - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. This is here - // only because this code needs to continue to work with older versions - // of Node.js that do not include the prependListener() method. The goal - // is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + if (typeof emitter.prependListener === 'function') { + return emitter.prependListener(event, fn); + } else { + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + } } var Duplex; @@ -31757,7 +32209,10 @@ function ReadableState(options, stream) { // cast to ints. this.highWaterMark = ~ ~this.highWaterMark; - this.buffer = []; + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; @@ -31920,7 +32375,8 @@ function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { - // Get the next highest power of 2 + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; @@ -31932,44 +32388,34 @@ function computeNewHighWaterMark(n) { return n; } +// This function is designed to be inlinable, so please take care when making +// changes to the function body. function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } - - if (n <= 0) return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. + // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; } - - return n; + return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); + n = parseInt(n, 10); var state = this._readableState; var nOrig = n; - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger @@ -32025,9 +32471,7 @@ Readable.prototype.read = function (n) { if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); - } - - if (doRead) { + } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; @@ -32036,28 +32480,29 @@ Readable.prototype.read = function (n) { // call internal read method this._read(state.highWaterMark); state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); } - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); - var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; n = 0; + } else { + state.length -= n; } - state.length -= n; + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } if (ret !== null) this.emit('data', ret); @@ -32205,11 +32650,17 @@ Readable.prototype.pipe = function (dest, pipeOpts) { if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; src.on('data', ondata); function ondata(chunk) { debug('ondata'); + increasedAwaitDrain = false; var ret = dest.write(chunk); - if (false === ret) { + if (false === ret && !increasedAwaitDrain) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. @@ -32217,6 +32668,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) { if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; + increasedAwaitDrain = true; } src.pause(); } @@ -32330,18 +32782,14 @@ Readable.prototype.unpipe = function (dest) { Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && !this._readableState.endEmitted) { + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; state.emittedReadable = false; - state.needReadable = true; if (!state.reading) { processNextTick(nReadingNextTick, this); } else if (state.length) { @@ -32385,6 +32833,7 @@ function resume_(stream, state) { } state.resumeScheduled = false; + state.awaitDrain = 0; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); @@ -32403,11 +32852,7 @@ Readable.prototype.pause = function () { function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } + while (state.flowing && stream.read() !== null) {} } // wrap an old-style stream as the async data source. @@ -32478,50 +32923,101 @@ Readable._fromList = fromList; // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; + // nothing buffered + if (state.length === 0) return null; - // nothing in the list, definitely empty. - if (list.length === 0) return null; - - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var _buf = list[0]; - var cpy = Math.min(n - c, _buf.length); + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } - if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + return ret; +} - if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} - c += cpy; +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); } + break; } + ++c; } + list.length -= c; + return ret; +} +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = bufferShim.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; return ret; } @@ -32560,7 +33056,7 @@ function indexOf(xs, x) { return -1; } }).call(this,require('_process')) -},{"./_stream_duplex":104,"_process":94,"buffer":8,"buffer-shims":7,"core-util-is":41,"events":66,"inherits":69,"isarray":102,"process-nextick-args":93,"string_decoder/":124,"util":5}],107:[function(require,module,exports){ +},{"./_stream_duplex":104,"./internal/streams/BufferList":109,"_process":94,"buffer":8,"buffer-shims":7,"core-util-is":41,"events":66,"inherits":69,"isarray":102,"process-nextick-args":93,"string_decoder/":126,"util":5}],107:[function(require,module,exports){ // a transform stream is a readable/writable stream where you do // something with the data. Sometimes it's called a "filter", // but that's not a great name for it, since that implies a thing where @@ -33270,10 +33766,75 @@ function CorkedRequest(state) { }; } }).call(this,require('_process')) -},{"./_stream_duplex":104,"_process":94,"buffer":8,"buffer-shims":7,"core-util-is":41,"events":66,"inherits":69,"process-nextick-args":93,"util-deprecate":132}],109:[function(require,module,exports){ +},{"./_stream_duplex":104,"_process":94,"buffer":8,"buffer-shims":7,"core-util-is":41,"events":66,"inherits":69,"process-nextick-args":93,"util-deprecate":134}],109:[function(require,module,exports){ +'use strict'; + +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ + +module.exports = BufferList; + +function BufferList() { + this.head = null; + this.tail = null; + this.length = 0; +} + +BufferList.prototype.push = function (v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; +}; + +BufferList.prototype.unshift = function (v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; +}; + +BufferList.prototype.shift = function () { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; +}; + +BufferList.prototype.clear = function () { + this.head = this.tail = null; + this.length = 0; +}; + +BufferList.prototype.join = function (s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; +}; + +BufferList.prototype.concat = function (n) { + if (this.length === 0) return bufferShim.alloc(0); + if (this.length === 1) return this.head.data; + var ret = bufferShim.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + p.data.copy(ret, i); + i += p.data.length; + p = p.next; + } + return ret; +}; +},{"buffer":8,"buffer-shims":7}],110:[function(require,module,exports){ module.exports = require("./lib/_stream_passthrough.js") -},{"./lib/_stream_passthrough.js":105}],110:[function(require,module,exports){ +},{"./lib/_stream_passthrough.js":105}],111:[function(require,module,exports){ (function (process){ var Stream = (function (){ try { @@ -33293,13 +33854,13 @@ if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) { } }).call(this,require('_process')) -},{"./lib/_stream_duplex.js":104,"./lib/_stream_passthrough.js":105,"./lib/_stream_readable.js":106,"./lib/_stream_transform.js":107,"./lib/_stream_writable.js":108,"_process":94}],111:[function(require,module,exports){ +},{"./lib/_stream_duplex.js":104,"./lib/_stream_passthrough.js":105,"./lib/_stream_readable.js":106,"./lib/_stream_transform.js":107,"./lib/_stream_writable.js":108,"_process":94}],112:[function(require,module,exports){ module.exports = require("./lib/_stream_transform.js") -},{"./lib/_stream_transform.js":107}],112:[function(require,module,exports){ +},{"./lib/_stream_transform.js":107}],113:[function(require,module,exports){ module.exports = require("./lib/_stream_writable.js") -},{"./lib/_stream_writable.js":108}],113:[function(require,module,exports){ +},{"./lib/_stream_writable.js":108}],114:[function(require,module,exports){ (function (global){ var ClientRequest = require('./lib/request') var extend = require('xtend') @@ -33381,9 +33942,9 @@ http.METHODS = [ 'UNSUBSCRIBE' ] }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./lib/request":115,"builtin-status-codes":10,"url":130,"xtend":135}],114:[function(require,module,exports){ +},{"./lib/request":116,"builtin-status-codes":10,"url":132,"xtend":137}],115:[function(require,module,exports){ (function (global){ -exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableByteStream) +exports.fetch = isFunction(global.fetch) && isFunction(global.ReadableStream) exports.blobConstructor = false try { @@ -33425,7 +33986,7 @@ function isFunction (value) { xhr = null // Help gc }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],115:[function(require,module,exports){ +},{}],116:[function(require,module,exports){ (function (process,global,Buffer){ var capability = require('./capability') var inherits = require('inherits') @@ -33706,7 +34267,7 @@ var unsafeHeaders = [ ] }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"./capability":114,"./response":116,"_process":94,"buffer":8,"inherits":69,"readable-stream":123,"to-arraybuffer":127}],116:[function(require,module,exports){ +},{"./capability":115,"./response":117,"_process":94,"buffer":8,"inherits":69,"readable-stream":125,"to-arraybuffer":129}],117:[function(require,module,exports){ (function (process,global,Buffer){ var capability = require('./capability') var inherits = require('inherits') @@ -33890,21 +34451,23 @@ IncomingMessage.prototype._onXHRProgress = function () { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {},require("buffer").Buffer) -},{"./capability":114,"_process":94,"buffer":8,"inherits":69,"readable-stream":123}],117:[function(require,module,exports){ +},{"./capability":115,"_process":94,"buffer":8,"inherits":69,"readable-stream":125}],118:[function(require,module,exports){ arguments[4][9][0].apply(exports,arguments) -},{"dup":9}],118:[function(require,module,exports){ +},{"dup":9}],119:[function(require,module,exports){ arguments[4][104][0].apply(exports,arguments) -},{"./_stream_readable":120,"./_stream_writable":122,"core-util-is":41,"dup":104,"inherits":69,"process-nextick-args":93}],119:[function(require,module,exports){ +},{"./_stream_readable":121,"./_stream_writable":123,"core-util-is":41,"dup":104,"inherits":69,"process-nextick-args":93}],120:[function(require,module,exports){ arguments[4][105][0].apply(exports,arguments) -},{"./_stream_transform":121,"core-util-is":41,"dup":105,"inherits":69}],120:[function(require,module,exports){ +},{"./_stream_transform":122,"core-util-is":41,"dup":105,"inherits":69}],121:[function(require,module,exports){ arguments[4][106][0].apply(exports,arguments) -},{"./_stream_duplex":118,"_process":94,"buffer":8,"buffer-shims":7,"core-util-is":41,"dup":106,"events":66,"inherits":69,"isarray":117,"process-nextick-args":93,"string_decoder/":124,"util":5}],121:[function(require,module,exports){ +},{"./_stream_duplex":119,"./internal/streams/BufferList":124,"_process":94,"buffer":8,"buffer-shims":7,"core-util-is":41,"dup":106,"events":66,"inherits":69,"isarray":118,"process-nextick-args":93,"string_decoder/":126,"util":5}],122:[function(require,module,exports){ arguments[4][107][0].apply(exports,arguments) -},{"./_stream_duplex":118,"core-util-is":41,"dup":107,"inherits":69}],122:[function(require,module,exports){ +},{"./_stream_duplex":119,"core-util-is":41,"dup":107,"inherits":69}],123:[function(require,module,exports){ arguments[4][108][0].apply(exports,arguments) -},{"./_stream_duplex":118,"_process":94,"buffer":8,"buffer-shims":7,"core-util-is":41,"dup":108,"events":66,"inherits":69,"process-nextick-args":93,"util-deprecate":132}],123:[function(require,module,exports){ -arguments[4][110][0].apply(exports,arguments) -},{"./lib/_stream_duplex.js":118,"./lib/_stream_passthrough.js":119,"./lib/_stream_readable.js":120,"./lib/_stream_transform.js":121,"./lib/_stream_writable.js":122,"_process":94,"dup":110}],124:[function(require,module,exports){ +},{"./_stream_duplex":119,"_process":94,"buffer":8,"buffer-shims":7,"core-util-is":41,"dup":108,"events":66,"inherits":69,"process-nextick-args":93,"util-deprecate":134}],124:[function(require,module,exports){ +arguments[4][109][0].apply(exports,arguments) +},{"buffer":8,"buffer-shims":7,"dup":109}],125:[function(require,module,exports){ +arguments[4][111][0].apply(exports,arguments) +},{"./lib/_stream_duplex.js":119,"./lib/_stream_passthrough.js":120,"./lib/_stream_readable.js":121,"./lib/_stream_transform.js":122,"./lib/_stream_writable.js":123,"_process":94,"dup":111}],126:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -34127,7 +34690,7 @@ function base64DetectIncompleteChar(buffer) { this.charLength = this.charReceived ? 3 : 0; } -},{"buffer":8}],125:[function(require,module,exports){ +},{"buffer":8}],127:[function(require,module,exports){ /** * Module dependencies. */ @@ -35320,7 +35883,7 @@ request.put = function(url, data, fn){ module.exports = request; -},{"emitter":40,"reduce":100}],126:[function(require,module,exports){ +},{"emitter":40,"reduce":100}],128:[function(require,module,exports){ var nextTick = require('process/browser.js').nextTick; var apply = Function.prototype.apply; var slice = Array.prototype.slice; @@ -35397,7 +35960,7 @@ exports.setImmediate = typeof setImmediate === "function" ? setImmediate : funct exports.clearImmediate = typeof clearImmediate === "function" ? clearImmediate : function(id) { delete immediateIds[id]; }; -},{"process/browser.js":94}],127:[function(require,module,exports){ +},{"process/browser.js":94}],129:[function(require,module,exports){ var Buffer = require('buffer').Buffer module.exports = function (buf) { @@ -35426,9 +35989,9 @@ module.exports = function (buf) { } } -},{"buffer":8}],128:[function(require,module,exports){ +},{"buffer":8}],130:[function(require,module,exports){ arguments[4][47][0].apply(exports,arguments) -},{"./lib/type":129,"dup":47}],129:[function(require,module,exports){ +},{"./lib/type":131,"dup":47}],131:[function(require,module,exports){ /*! * type-detect * Copyright(c) 2013 jake luer @@ -35564,7 +36127,7 @@ Library.prototype.test = function(obj, type) { } }; -},{}],130:[function(require,module,exports){ +},{}],132:[function(require,module,exports){ // Copyright Joyent, Inc. and other Node contributors. // // Permission is hereby granted, free of charge, to any person obtaining a @@ -36298,7 +36861,7 @@ Url.prototype.parseHost = function() { if (host) this.hostname = host; }; -},{"./util":131,"punycode":96,"querystring":99}],131:[function(require,module,exports){ +},{"./util":133,"punycode":96,"querystring":99}],133:[function(require,module,exports){ 'use strict'; module.exports = { @@ -36316,7 +36879,7 @@ module.exports = { } }; -},{}],132:[function(require,module,exports){ +},{}],134:[function(require,module,exports){ (function (global){ /** @@ -36387,14 +36950,14 @@ function config (name) { } }).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],133:[function(require,module,exports){ +},{}],135:[function(require,module,exports){ module.exports = function isBuffer(arg) { return arg && typeof arg === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function'; } -},{}],134:[function(require,module,exports){ +},{}],136:[function(require,module,exports){ (function (process,global){ // Copyright Joyent, Inc. and other Node contributors. // @@ -36984,7 +37547,7 @@ function hasOwnProperty(obj, prop) { } }).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":133,"_process":94,"inherits":69}],135:[function(require,module,exports){ +},{"./support/isBuffer":135,"_process":94,"inherits":69}],137:[function(require,module,exports){ module.exports = extend var hasOwnProperty = Object.prototype.hasOwnProperty; @@ -37005,7 +37568,7 @@ function extend() { return target } -},{}],136:[function(require,module,exports){ +},{}],138:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -37076,7 +37639,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],137:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],139:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -37499,7 +38062,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/CreateEndpointBasicAuthRepresentation":196,"../model/EndpointBasicAuthRepresentation":199,"../model/EndpointConfigurationRepresentation":200}],138:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/CreateEndpointBasicAuthRepresentation":198,"../model/EndpointBasicAuthRepresentation":201,"../model/EndpointConfigurationRepresentation":202}],140:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -38163,7 +38726,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/AbstractGroupRepresentation":179,"../model/AddGroupCapabilitiesRepresentation":182,"../model/GroupRepresentation":215,"../model/LightGroupRepresentation":219,"../model/ResultListDataRepresentation":240}],139:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/AbstractGroupRepresentation":181,"../model/AddGroupCapabilitiesRepresentation":184,"../model/GroupRepresentation":217,"../model/LightGroupRepresentation":221,"../model/ResultListDataRepresentation":242}],141:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -38490,7 +39053,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/CreateTenantRepresentation":198,"../model/ImageUploadRepresentation":216,"../model/LightTenantRepresentation":220,"../model/TenantEvent":250,"../model/TenantRepresentation":251}],140:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/CreateTenantRepresentation":200,"../model/ImageUploadRepresentation":218,"../model/LightTenantRepresentation":222,"../model/TenantEvent":252,"../model/TenantRepresentation":253}],142:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -38730,7 +39293,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/AbstractUserRepresentation":181,"../model/BulkUserUpdateRepresentation":190,"../model/ResultListDataRepresentation":240,"../model/UserRepresentation":256}],141:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/AbstractUserRepresentation":183,"../model/BulkUserUpdateRepresentation":192,"../model/ResultListDataRepresentation":242,"../model/UserRepresentation":258}],143:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -39110,7 +39673,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240}],142:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242}],144:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -39371,7 +39934,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/AppDefinitionPublishRepresentation":184,"../model/AppDefinitionRepresentation":185,"../model/AppDefinitionUpdateResultRepresentation":186,"../model/ResultListDataRepresentation":240,"../model/RuntimeAppDefinitionSaveRepresentation":241}],143:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/AppDefinitionPublishRepresentation":186,"../model/AppDefinitionRepresentation":187,"../model/AppDefinitionUpdateResultRepresentation":188,"../model/ResultListDataRepresentation":242,"../model/RuntimeAppDefinitionSaveRepresentation":243}],145:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -39569,7 +40132,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/AppDefinitionPublishRepresentation":184,"../model/AppDefinitionRepresentation":185,"../model/AppDefinitionUpdateResultRepresentation":186}],144:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/AppDefinitionPublishRepresentation":186,"../model/AppDefinitionRepresentation":187,"../model/AppDefinitionUpdateResultRepresentation":188}],146:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -39673,7 +40236,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240,"../model/RuntimeAppDefinitionSaveRepresentation":241}],145:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242,"../model/RuntimeAppDefinitionSaveRepresentation":243}],147:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -39878,7 +40441,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/CommentRepresentation":193,"../model/ResultListDataRepresentation":240}],146:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/CommentRepresentation":195,"../model/ResultListDataRepresentation":242}],148:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -40365,7 +40928,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/RelatedContentRepresentation":237,"../model/ResultListDataRepresentation":240}],147:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/RelatedContentRepresentation":239,"../model/ResultListDataRepresentation":242}],149:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -40449,7 +41012,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],148:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],150:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -40674,7 +41237,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/FormRepresentation":209,"../model/FormSaveRepresentation":210,"../model/ValidationErrorRepresentation":258}],149:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/FormRepresentation":211,"../model/FormSaveRepresentation":212,"../model/ValidationErrorRepresentation":260}],151:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -40790,7 +41353,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240}],150:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242}],152:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -40902,7 +41465,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/SyncLogEntryRepresentation":243}],151:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/SyncLogEntryRepresentation":245}],153:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -40973,7 +41536,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240}],152:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242}],154:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -41194,7 +41757,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240}],153:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242}],155:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -41388,7 +41951,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240}],154:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242}],156:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -42071,7 +42634,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/BoxUserAccountCredentialsRepresentation":189,"../model/ResultListDataRepresentation":240,"../model/UserAccountCredentialsRepresentation":252}],155:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/BoxUserAccountCredentialsRepresentation":191,"../model/ResultListDataRepresentation":242,"../model/UserAccountCredentialsRepresentation":254}],157:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -42356,7 +42919,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/BoxUserAccountCredentialsRepresentation":189,"../model/ResultListDataRepresentation":240,"../model/UserAccountCredentialsRepresentation":252}],156:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/BoxUserAccountCredentialsRepresentation":191,"../model/ResultListDataRepresentation":242,"../model/UserAccountCredentialsRepresentation":254}],158:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -42469,7 +43032,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240}],157:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242}],159:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -42587,7 +43150,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],158:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],160:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -43107,7 +43670,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ModelRepresentation":226,"../model/ObjectNode":227,"../model/ResultListDataRepresentation":240,"../model/ValidationErrorRepresentation":258}],159:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ModelRepresentation":228,"../model/ObjectNode":229,"../model/ResultListDataRepresentation":242,"../model/ValidationErrorRepresentation":260}],161:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -43230,7 +43793,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ModelRepresentation":226,"../model/ResultListDataRepresentation":240}],160:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ModelRepresentation":228,"../model/ResultListDataRepresentation":242}],162:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -43618,7 +44181,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/CreateProcessInstanceRepresentation":197,"../model/FormDefinitionRepresentation":205,"../model/FormValueRepresentation":213,"../model/ProcessFilterRequestRepresentation":229,"../model/ProcessInstanceFilterRequestRepresentation":231,"../model/ProcessInstanceRepresentation":232,"../model/ResultListDataRepresentation":240}],161:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/CreateProcessInstanceRepresentation":199,"../model/FormDefinitionRepresentation":207,"../model/FormValueRepresentation":215,"../model/ProcessFilterRequestRepresentation":231,"../model/ProcessInstanceFilterRequestRepresentation":233,"../model/ProcessInstanceRepresentation":234,"../model/ResultListDataRepresentation":242}],163:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -43695,7 +44258,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240}],162:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242}],164:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -43816,7 +44379,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/FormDefinitionRepresentation":205,"../model/FormValueRepresentation":213}],163:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/FormDefinitionRepresentation":207,"../model/FormValueRepresentation":215}],165:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -44041,7 +44604,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/CommentRepresentation":193,"../model/FormDefinitionRepresentation":205,"../model/ProcessInstanceRepresentation":232,"../model/ResultListDataRepresentation":240}],164:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/CommentRepresentation":195,"../model/FormDefinitionRepresentation":207,"../model/ProcessInstanceRepresentation":234,"../model/ResultListDataRepresentation":242}],166:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -44150,7 +44713,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/CreateProcessInstanceRepresentation":197,"../model/ProcessInstanceRepresentation":232,"../model/ResultListDataRepresentation":240}],165:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/CreateProcessInstanceRepresentation":199,"../model/ProcessInstanceRepresentation":234,"../model/ResultListDataRepresentation":242}],167:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -44257,7 +44820,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ObjectNode":227,"../model/ProcessInstanceFilterRequestRepresentation":231,"../model/ResultListDataRepresentation":240}],166:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ObjectNode":229,"../model/ProcessInstanceFilterRequestRepresentation":233,"../model/ResultListDataRepresentation":242}],168:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -44332,7 +44895,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ProcessScopeRepresentation":234,"../model/ProcessScopesRequestRepresentation":235}],167:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ProcessScopeRepresentation":236,"../model/ProcessScopesRequestRepresentation":237}],169:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -44528,7 +45091,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ChangePasswordRepresentation":191,"../model/ImageUploadRepresentation":216,"../model/UserRepresentation":256}],168:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ChangePasswordRepresentation":193,"../model/ImageUploadRepresentation":218,"../model/UserRepresentation":258}],170:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -44623,7 +45186,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],169:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],171:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -44693,7 +45256,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/SystemPropertiesRepresentation":244}],170:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/SystemPropertiesRepresentation":246}],172:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -45035,7 +45598,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ObjectNode":227,"../model/TaskRepresentation":248}],171:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ObjectNode":229,"../model/TaskRepresentation":250}],173:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -45605,7 +46168,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }; /** - * Function to receive the result of the getRestFieldValues operation. + * Function to receive the result of the getRestFieldValuesColumn operation. * @param {String} error Error message, if any. * @param {Array.} data The data returned by the service call. * @param {String} response The complete HTTP response. @@ -45618,7 +46181,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol * @param {String} field field * @param {String} column column */ - this.getRestFieldValues = function (taskId, field, column) { + this.getRestFieldValuesColumn = function (taskId, field, column) { var postBody = null; // verify the required parameter 'taskId' is set @@ -46105,7 +46668,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ChecklistOrderRepresentation":192,"../model/CommentRepresentation":193,"../model/CompleteFormRepresentation":194,"../model/FormDefinitionRepresentation":205,"../model/FormValueRepresentation":213,"../model/ObjectNode":227,"../model/RelatedContentRepresentation":237,"../model/ResultListDataRepresentation":240,"../model/SaveFormRepresentation":242,"../model/TaskFilterRequestRepresentation":246,"../model/TaskRepresentation":248,"../model/TaskUpdateRepresentation":249}],172:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ChecklistOrderRepresentation":194,"../model/CommentRepresentation":195,"../model/CompleteFormRepresentation":196,"../model/FormDefinitionRepresentation":207,"../model/FormValueRepresentation":215,"../model/ObjectNode":229,"../model/RelatedContentRepresentation":239,"../model/ResultListDataRepresentation":242,"../model/SaveFormRepresentation":244,"../model/TaskFilterRequestRepresentation":248,"../model/TaskRepresentation":250,"../model/TaskUpdateRepresentation":251}],174:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -46262,7 +46825,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ChecklistOrderRepresentation":192,"../model/ResultListDataRepresentation":240,"../model/TaskRepresentation":248}],173:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ChecklistOrderRepresentation":194,"../model/ResultListDataRepresentation":242,"../model/TaskRepresentation":250}],175:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -46510,7 +47073,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/CompleteFormRepresentation":194,"../model/FormDefinitionRepresentation":205,"../model/FormValueRepresentation":213,"../model/SaveFormRepresentation":242}],174:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/CompleteFormRepresentation":196,"../model/FormDefinitionRepresentation":207,"../model/FormValueRepresentation":215,"../model/SaveFormRepresentation":244}],176:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -46687,7 +47250,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ArrayNode":188}],175:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ArrayNode":190}],177:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -46957,7 +47520,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResetPasswordRepresentation":238,"../model/ResultListDataRepresentation":240,"../model/UserActionRepresentation":253,"../model/UserRepresentation":256}],176:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResetPasswordRepresentation":240,"../model/ResultListDataRepresentation":242,"../model/UserActionRepresentation":255,"../model/UserRepresentation":258}],178:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -47414,7 +47977,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240,"../model/UserFilterOrderRepresentation":254,"../model/UserProcessInstanceFilterRepresentation":255,"../model/UserTaskFilterRepresentation":257}],177:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242,"../model/UserFilterOrderRepresentation":256,"../model/UserProcessInstanceFilterRepresentation":257,"../model/UserTaskFilterRepresentation":259}],179:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -47504,7 +48067,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/ResultListDataRepresentation":240}],178:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/ResultListDataRepresentation":242}],180:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -48181,7 +48744,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../alfrescoApiClient":395,"./api/AboutApi":136,"./api/AdminEndpointsApi":137,"./api/AdminGroupsApi":138,"./api/AdminTenantsApi":139,"./api/AdminUsersApi":140,"./api/AlfrescoApi":141,"./api/AppsApi":142,"./api/AppsDefinitionApi":143,"./api/AppsRuntimeApi":144,"./api/CommentsApi":145,"./api/ContentApi":146,"./api/ContentRenditionApi":147,"./api/EditorApi":148,"./api/GroupsApi":149,"./api/IDMSyncApi":150,"./api/IntegrationAccountApi":151,"./api/IntegrationAlfrescoCloudApi":152,"./api/IntegrationAlfrescoOnPremiseApi":153,"./api/IntegrationApi":154,"./api/IntegrationBoxApi":155,"./api/IntegrationDriveApi":156,"./api/ModelBpmnApi":157,"./api/ModelsApi":158,"./api/ModelsHistoryApi":159,"./api/ProcessApi":160,"./api/ProcessDefinitionsApi":161,"./api/ProcessDefinitionsFormApi":162,"./api/ProcessInstancesApi":163,"./api/ProcessInstancesInformationApi":164,"./api/ProcessInstancesListingApi":165,"./api/ProcessScopeApi":166,"./api/ProfileApi":167,"./api/ScriptFileApi":168,"./api/SystemPropertiesApi":169,"./api/TaskActionsApi":170,"./api/TaskApi":171,"./api/TaskCheckListApi":172,"./api/TaskFormsApi":173,"./api/TemporaryApi":174,"./api/UserApi":175,"./api/UserFiltersApi":176,"./api/UsersWorkflowApi":177,"./model/AbstractGroupRepresentation":179,"./model/AbstractRepresentation":180,"./model/AbstractUserRepresentation":181,"./model/AddGroupCapabilitiesRepresentation":182,"./model/AppDefinition":183,"./model/AppDefinitionPublishRepresentation":184,"./model/AppDefinitionRepresentation":185,"./model/AppDefinitionUpdateResultRepresentation":186,"./model/AppModelDefinition":187,"./model/ArrayNode":188,"./model/BoxUserAccountCredentialsRepresentation":189,"./model/BulkUserUpdateRepresentation":190,"./model/ChangePasswordRepresentation":191,"./model/ChecklistOrderRepresentation":192,"./model/CommentRepresentation":193,"./model/CompleteFormRepresentation":194,"./model/ConditionRepresentation":195,"./model/CreateEndpointBasicAuthRepresentation":196,"./model/CreateProcessInstanceRepresentation":197,"./model/CreateTenantRepresentation":198,"./model/EndpointBasicAuthRepresentation":199,"./model/EndpointConfigurationRepresentation":200,"./model/EndpointRequestHeaderRepresentation":201,"./model/EntityAttributeScopeRepresentation":202,"./model/EntityVariableScopeRepresentation":203,"./model/File":204,"./model/FormDefinitionRepresentation":205,"./model/FormFieldRepresentation":206,"./model/FormJavascriptEventRepresentation":207,"./model/FormOutcomeRepresentation":208,"./model/FormRepresentation":209,"./model/FormSaveRepresentation":210,"./model/FormScopeRepresentation":211,"./model/FormTabRepresentation":212,"./model/FormValueRepresentation":213,"./model/GroupCapabilityRepresentation":214,"./model/GroupRepresentation":215,"./model/ImageUploadRepresentation":216,"./model/LayoutRepresentation":217,"./model/LightAppRepresentation":218,"./model/LightGroupRepresentation":219,"./model/LightTenantRepresentation":220,"./model/LightUserRepresentation":221,"./model/MaplongListstring":222,"./model/MapstringListEntityVariableScopeRepresentation":223,"./model/MapstringListVariableScopeRepresentation":224,"./model/Mapstringstring":225,"./model/ModelRepresentation":226,"./model/ObjectNode":227,"./model/OptionRepresentation":228,"./model/ProcessFilterRequestRepresentation":229,"./model/ProcessInstanceFilterRepresentation":230,"./model/ProcessInstanceFilterRequestRepresentation":231,"./model/ProcessInstanceRepresentation":232,"./model/ProcessScopeIdentifierRepresentation":233,"./model/ProcessScopeRepresentation":234,"./model/ProcessScopesRequestRepresentation":235,"./model/PublishIdentityInfoRepresentation":236,"./model/RelatedContentRepresentation":237,"./model/ResetPasswordRepresentation":238,"./model/RestVariable":239,"./model/ResultListDataRepresentation":240,"./model/RuntimeAppDefinitionSaveRepresentation":241,"./model/SaveFormRepresentation":242,"./model/SyncLogEntryRepresentation":243,"./model/SystemPropertiesRepresentation":244,"./model/TaskFilterRepresentation":245,"./model/TaskFilterRequestRepresentation":246,"./model/TaskQueryRequestRepresentation":247,"./model/TaskRepresentation":248,"./model/TaskUpdateRepresentation":249,"./model/TenantEvent":250,"./model/TenantRepresentation":251,"./model/UserAccountCredentialsRepresentation":252,"./model/UserActionRepresentation":253,"./model/UserFilterOrderRepresentation":254,"./model/UserProcessInstanceFilterRepresentation":255,"./model/UserRepresentation":256,"./model/UserTaskFilterRepresentation":257,"./model/ValidationErrorRepresentation":258,"./model/VariableScopeRepresentation":259}],179:[function(require,module,exports){ +},{"../../alfrescoApiClient":397,"./api/AboutApi":138,"./api/AdminEndpointsApi":139,"./api/AdminGroupsApi":140,"./api/AdminTenantsApi":141,"./api/AdminUsersApi":142,"./api/AlfrescoApi":143,"./api/AppsApi":144,"./api/AppsDefinitionApi":145,"./api/AppsRuntimeApi":146,"./api/CommentsApi":147,"./api/ContentApi":148,"./api/ContentRenditionApi":149,"./api/EditorApi":150,"./api/GroupsApi":151,"./api/IDMSyncApi":152,"./api/IntegrationAccountApi":153,"./api/IntegrationAlfrescoCloudApi":154,"./api/IntegrationAlfrescoOnPremiseApi":155,"./api/IntegrationApi":156,"./api/IntegrationBoxApi":157,"./api/IntegrationDriveApi":158,"./api/ModelBpmnApi":159,"./api/ModelsApi":160,"./api/ModelsHistoryApi":161,"./api/ProcessApi":162,"./api/ProcessDefinitionsApi":163,"./api/ProcessDefinitionsFormApi":164,"./api/ProcessInstancesApi":165,"./api/ProcessInstancesInformationApi":166,"./api/ProcessInstancesListingApi":167,"./api/ProcessScopeApi":168,"./api/ProfileApi":169,"./api/ScriptFileApi":170,"./api/SystemPropertiesApi":171,"./api/TaskActionsApi":172,"./api/TaskApi":173,"./api/TaskCheckListApi":174,"./api/TaskFormsApi":175,"./api/TemporaryApi":176,"./api/UserApi":177,"./api/UserFiltersApi":178,"./api/UsersWorkflowApi":179,"./model/AbstractGroupRepresentation":181,"./model/AbstractRepresentation":182,"./model/AbstractUserRepresentation":183,"./model/AddGroupCapabilitiesRepresentation":184,"./model/AppDefinition":185,"./model/AppDefinitionPublishRepresentation":186,"./model/AppDefinitionRepresentation":187,"./model/AppDefinitionUpdateResultRepresentation":188,"./model/AppModelDefinition":189,"./model/ArrayNode":190,"./model/BoxUserAccountCredentialsRepresentation":191,"./model/BulkUserUpdateRepresentation":192,"./model/ChangePasswordRepresentation":193,"./model/ChecklistOrderRepresentation":194,"./model/CommentRepresentation":195,"./model/CompleteFormRepresentation":196,"./model/ConditionRepresentation":197,"./model/CreateEndpointBasicAuthRepresentation":198,"./model/CreateProcessInstanceRepresentation":199,"./model/CreateTenantRepresentation":200,"./model/EndpointBasicAuthRepresentation":201,"./model/EndpointConfigurationRepresentation":202,"./model/EndpointRequestHeaderRepresentation":203,"./model/EntityAttributeScopeRepresentation":204,"./model/EntityVariableScopeRepresentation":205,"./model/File":206,"./model/FormDefinitionRepresentation":207,"./model/FormFieldRepresentation":208,"./model/FormJavascriptEventRepresentation":209,"./model/FormOutcomeRepresentation":210,"./model/FormRepresentation":211,"./model/FormSaveRepresentation":212,"./model/FormScopeRepresentation":213,"./model/FormTabRepresentation":214,"./model/FormValueRepresentation":215,"./model/GroupCapabilityRepresentation":216,"./model/GroupRepresentation":217,"./model/ImageUploadRepresentation":218,"./model/LayoutRepresentation":219,"./model/LightAppRepresentation":220,"./model/LightGroupRepresentation":221,"./model/LightTenantRepresentation":222,"./model/LightUserRepresentation":223,"./model/MaplongListstring":224,"./model/MapstringListEntityVariableScopeRepresentation":225,"./model/MapstringListVariableScopeRepresentation":226,"./model/Mapstringstring":227,"./model/ModelRepresentation":228,"./model/ObjectNode":229,"./model/OptionRepresentation":230,"./model/ProcessFilterRequestRepresentation":231,"./model/ProcessInstanceFilterRepresentation":232,"./model/ProcessInstanceFilterRequestRepresentation":233,"./model/ProcessInstanceRepresentation":234,"./model/ProcessScopeIdentifierRepresentation":235,"./model/ProcessScopeRepresentation":236,"./model/ProcessScopesRequestRepresentation":237,"./model/PublishIdentityInfoRepresentation":238,"./model/RelatedContentRepresentation":239,"./model/ResetPasswordRepresentation":240,"./model/RestVariable":241,"./model/ResultListDataRepresentation":242,"./model/RuntimeAppDefinitionSaveRepresentation":243,"./model/SaveFormRepresentation":244,"./model/SyncLogEntryRepresentation":245,"./model/SystemPropertiesRepresentation":246,"./model/TaskFilterRepresentation":247,"./model/TaskFilterRequestRepresentation":248,"./model/TaskQueryRequestRepresentation":249,"./model/TaskRepresentation":250,"./model/TaskUpdateRepresentation":251,"./model/TenantEvent":252,"./model/TenantRepresentation":253,"./model/UserAccountCredentialsRepresentation":254,"./model/UserActionRepresentation":255,"./model/UserFilterOrderRepresentation":256,"./model/UserProcessInstanceFilterRepresentation":257,"./model/UserRepresentation":258,"./model/UserTaskFilterRepresentation":259,"./model/ValidationErrorRepresentation":260,"./model/VariableScopeRepresentation":261}],181:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -48266,7 +48829,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],180:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],182:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -48321,7 +48884,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],181:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],183:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -48420,7 +48983,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],182:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],184:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -48484,7 +49047,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],183:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],185:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -48569,7 +49132,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./AppModelDefinition":187,"./PublishIdentityInfoRepresentation":236}],184:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./AppModelDefinition":189,"./PublishIdentityInfoRepresentation":238}],186:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -48640,7 +49203,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],185:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],187:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -48760,7 +49323,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],186:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],188:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -48866,7 +49429,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./AppDefinitionRepresentation":185}],187:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./AppDefinitionRepresentation":187}],189:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49000,7 +49563,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],188:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],190:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49256,7 +49819,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],189:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],191:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49334,7 +49897,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],190:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],192:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49433,7 +49996,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],191:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],193:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49504,7 +50067,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],192:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],194:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49568,7 +50131,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],193:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],195:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49653,7 +50216,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./LightUserRepresentation":221}],194:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./LightUserRepresentation":223}],196:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49724,7 +50287,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],195:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],197:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49837,7 +50400,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],196:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],198:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -49922,7 +50485,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],197:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],199:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -50007,7 +50570,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],198:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],200:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -50092,7 +50655,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],199:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],201:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -50191,7 +50754,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],200:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],202:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -50318,7 +50881,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./EndpointRequestHeaderRepresentation":201}],201:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./EndpointRequestHeaderRepresentation":203}],203:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -50389,7 +50952,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],202:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],204:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -50460,7 +51023,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],203:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],205:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -50545,7 +51108,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./EntityAttributeScopeRepresentation":202}],204:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./EntityAttributeScopeRepresentation":204}],206:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -50707,7 +51270,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],205:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],207:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -50897,7 +51460,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./FormFieldRepresentation":206,"./FormJavascriptEventRepresentation":207,"./FormOutcomeRepresentation":208,"./FormTabRepresentation":212}],206:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./FormFieldRepresentation":208,"./FormJavascriptEventRepresentation":209,"./FormOutcomeRepresentation":210,"./FormTabRepresentation":214}],208:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51164,7 +51727,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./ConditionRepresentation":195,"./LayoutRepresentation":217,"./OptionRepresentation":228}],207:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./ConditionRepresentation":197,"./LayoutRepresentation":219,"./OptionRepresentation":230}],209:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51235,7 +51798,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],208:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],210:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51306,7 +51869,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],209:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],211:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51433,7 +51996,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./FormDefinitionRepresentation":205}],210:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./FormDefinitionRepresentation":207}],212:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51532,7 +52095,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./FormRepresentation":209,"./ProcessScopeIdentifierRepresentation":233}],211:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./FormRepresentation":211,"./ProcessScopeIdentifierRepresentation":235}],213:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51631,7 +52194,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./FormFieldRepresentation":206,"./FormOutcomeRepresentation":208}],212:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./FormFieldRepresentation":208,"./FormOutcomeRepresentation":210}],214:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51709,7 +52272,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./ConditionRepresentation":195}],213:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./ConditionRepresentation":197}],215:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51780,7 +52343,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],214:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],216:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51851,7 +52414,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],215:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],217:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -51992,7 +52555,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./GroupCapabilityRepresentation":214,"./GroupRepresentation":215,"./UserRepresentation":256}],216:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./GroupCapabilityRepresentation":216,"./GroupRepresentation":217,"./UserRepresentation":258}],218:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52077,7 +52640,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],217:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],219:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52155,7 +52718,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],218:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],220:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52247,7 +52810,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],219:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],221:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52339,7 +52902,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./LightGroupRepresentation":219}],220:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./LightGroupRepresentation":221}],222:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52410,7 +52973,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],221:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],223:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52509,7 +53072,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],222:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],224:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52568,7 +53131,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],223:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],225:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52627,7 +53190,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],224:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],226:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52686,7 +53249,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],225:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],227:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52745,7 +53308,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],226:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],228:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52914,7 +53477,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],227:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],229:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -52969,7 +53532,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],228:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],230:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -53040,7 +53603,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],229:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],231:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -53145,7 +53708,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],230:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],232:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -53244,7 +53807,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],231:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],233:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -53336,7 +53899,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./ProcessInstanceFilterRepresentation":230}],232:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./ProcessInstanceFilterRepresentation":232}],234:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -53512,7 +54075,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./LightUserRepresentation":221,"./RestVariable":239}],233:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./LightUserRepresentation":223,"./RestVariable":241}],235:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -53583,7 +54146,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],234:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],236:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -53738,7 +54301,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./FormScopeRepresentation":211}],235:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./FormScopeRepresentation":213}],237:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -53809,7 +54372,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./ProcessScopeIdentifierRepresentation":233}],236:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./ProcessScopeIdentifierRepresentation":235}],238:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -53887,7 +54450,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./LightGroupRepresentation":219,"./LightUserRepresentation":221}],237:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./LightGroupRepresentation":221,"./LightUserRepresentation":223}],239:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54035,7 +54598,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./LightUserRepresentation":221}],238:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./LightUserRepresentation":223}],240:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54099,7 +54662,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],239:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],241:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54191,7 +54754,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],240:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],242:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54276,7 +54839,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./AbstractRepresentation":180}],241:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./AbstractRepresentation":182}],243:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54340,7 +54903,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./AppDefinitionRepresentation":185}],242:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./AppDefinitionRepresentation":187}],244:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54404,7 +54967,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],243:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],245:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54482,7 +55045,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],244:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],246:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54546,7 +55109,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],245:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],247:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54666,7 +55229,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],246:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],248:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54767,7 +55330,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./TaskFilterRepresentation":245}],247:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./TaskFilterRepresentation":247}],249:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -54866,7 +55429,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],248:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],250:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -55119,7 +55682,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./LightUserRepresentation":221}],249:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./LightUserRepresentation":223}],251:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -55218,7 +55781,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],250:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],252:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -55324,7 +55887,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],251:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],253:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -55437,7 +56000,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],252:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],254:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -55508,7 +56071,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],253:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],255:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -55586,7 +56149,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],254:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],256:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -55657,7 +56220,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],255:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],257:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -55763,7 +56326,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./ProcessInstanceFilterRepresentation":230}],256:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./ProcessInstanceFilterRepresentation":232}],258:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -55960,7 +56523,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./GroupRepresentation":215,"./LightAppRepresentation":218}],257:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./GroupRepresentation":217,"./LightAppRepresentation":220}],259:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56066,7 +56629,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./TaskFilterRepresentation":245}],258:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./TaskFilterRepresentation":247}],260:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56172,7 +56735,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],259:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],261:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56278,7 +56841,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],260:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],262:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56389,7 +56952,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"../model/Error":262,"../model/LoginRequest":264,"../model/LoginTicketEntry":265,"../model/ValidateTicketEntry":267}],261:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"../model/Error":264,"../model/LoginRequest":266,"../model/LoginTicketEntry":267,"../model/ValidateTicketEntry":269}],263:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56488,7 +57051,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../alfrescoApiClient":395,"./api/AuthenticationApi":260,"./model/Error":262,"./model/ErrorError":263,"./model/LoginRequest":264,"./model/LoginTicketEntry":265,"./model/LoginTicketEntryEntry":266,"./model/ValidateTicketEntry":267,"./model/ValidateTicketEntryEntry":268}],262:[function(require,module,exports){ +},{"../../alfrescoApiClient":397,"./api/AuthenticationApi":262,"./model/Error":264,"./model/ErrorError":265,"./model/LoginRequest":266,"./model/LoginTicketEntry":267,"./model/LoginTicketEntryEntry":268,"./model/ValidateTicketEntry":269,"./model/ValidateTicketEntryEntry":270}],264:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56550,7 +57113,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./ErrorError":263}],263:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./ErrorError":265}],265:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56663,7 +57226,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],264:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],266:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56733,7 +57296,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],265:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],267:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56795,7 +57358,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./LoginTicketEntryEntry":266}],266:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./LoginTicketEntryEntry":268}],268:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56865,7 +57428,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],267:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],269:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56927,7 +57490,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395,"./ValidateTicketEntryEntry":268}],268:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397,"./ValidateTicketEntryEntry":270}],270:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -56989,7 +57552,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../../../alfrescoApiClient":395}],269:[function(require,module,exports){ +},{"../../../alfrescoApiClient":397}],271:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -57472,7 +58035,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol }); }).call(this,require("buffer").Buffer) -},{"buffer":8,"fs":6,"superagent":125}],270:[function(require,module,exports){ +},{"buffer":8,"fs":6,"superagent":127}],272:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -57665,7 +58228,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/AssocTargetBody":292,"../model/Error":310,"../model/NodeAssocPaging":324}],271:[function(require,module,exports){ +},{"../ApiClient":271,"../model/AssocTargetBody":294,"../model/Error":312,"../model/NodeAssocPaging":326}],273:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -59026,7 +59589,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/AssocChildBody":290,"../model/AssocTargetBody":292,"../model/CopyBody":302,"../model/DeletedNodeEntry":304,"../model/DeletedNodesPaging":307,"../model/EmailSharedLinkBody":309,"../model/Error":310,"../model/MoveBody":320,"../model/NodeAssocPaging":324,"../model/NodeBody":326,"../model/NodeBody1":327,"../model/NodeChildAssocPaging":330,"../model/NodeEntry":332,"../model/NodePaging":336,"../model/NodeSharedLinkEntry":339,"../model/NodeSharedLinkPaging":340,"../model/RenditionBody":363,"../model/RenditionEntry":364,"../model/RenditionPaging":365,"../model/SharedLinkBody":367,"../model/SiteBody":369,"../model/SiteEntry":373}],272:[function(require,module,exports){ +},{"../ApiClient":271,"../model/AssocChildBody":292,"../model/AssocTargetBody":294,"../model/CopyBody":304,"../model/DeletedNodeEntry":306,"../model/DeletedNodesPaging":309,"../model/EmailSharedLinkBody":311,"../model/Error":312,"../model/MoveBody":322,"../model/NodeAssocPaging":326,"../model/NodeBody":328,"../model/NodeBody1":329,"../model/NodeChildAssocPaging":332,"../model/NodeEntry":334,"../model/NodePaging":338,"../model/NodeSharedLinkEntry":341,"../model/NodeSharedLinkPaging":342,"../model/RenditionBody":365,"../model/RenditionEntry":366,"../model/RenditionPaging":367,"../model/SharedLinkBody":369,"../model/SiteBody":371,"../model/SiteEntry":375}],274:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -59388,7 +59951,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/AssocChildBody":290,"../model/Error":310,"../model/MoveBody":320,"../model/NodeAssocPaging":324,"../model/NodeBody1":327,"../model/NodeChildAssocPaging":330,"../model/NodeEntry":332,"../model/NodePaging":336}],273:[function(require,module,exports){ +},{"../ApiClient":271,"../model/AssocChildBody":292,"../model/Error":312,"../model/MoveBody":322,"../model/NodeAssocPaging":326,"../model/NodeBody1":329,"../model/NodeChildAssocPaging":332,"../model/NodeEntry":334,"../model/NodePaging":338}],275:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -59586,7 +60149,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/CommentBody":295,"../model/CommentBody1":296,"../model/CommentEntry":297,"../model/CommentPaging":298,"../model/Error":310}],274:[function(require,module,exports){ +},{"../ApiClient":271,"../model/CommentBody":297,"../model/CommentBody1":298,"../model/CommentEntry":299,"../model/CommentPaging":300,"../model/Error":312}],276:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -59780,7 +60343,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/Error":310,"../model/FavoriteBody":313,"../model/FavoriteEntry":314,"../model/FavoritePaging":315}],275:[function(require,module,exports){ +},{"../ApiClient":271,"../model/Error":312,"../model/FavoriteBody":315,"../model/FavoriteEntry":316,"../model/FavoritePaging":317}],277:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -59857,7 +60420,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/Error":310,"../model/PersonNetworkEntry":349}],276:[function(require,module,exports){ +},{"../ApiClient":271,"../model/Error":312,"../model/PersonNetworkEntry":351}],278:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -60392,7 +60955,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/CopyBody":302,"../model/DeletedNodeEntry":304,"../model/DeletedNodesPaging":307,"../model/Error":310,"../model/MoveBody":320,"../model/NodeBody":326,"../model/NodeBody1":327,"../model/NodeEntry":332,"../model/NodePaging":336}],277:[function(require,module,exports){ +},{"../ApiClient":271,"../model/CopyBody":304,"../model/DeletedNodeEntry":306,"../model/DeletedNodesPaging":309,"../model/Error":312,"../model/MoveBody":322,"../model/NodeBody":328,"../model/NodeBody1":329,"../model/NodeEntry":334,"../model/NodePaging":338}],279:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -61201,7 +61764,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/ActivityPaging":288,"../model/Error":310,"../model/FavoriteBody":313,"../model/FavoriteEntry":314,"../model/FavoritePaging":315,"../model/FavoriteSiteBody":317,"../model/InlineResponse201":318,"../model/PersonEntry":347,"../model/PersonNetworkEntry":349,"../model/PersonNetworkPaging":350,"../model/PreferenceEntry":353,"../model/PreferencePaging":354,"../model/SiteEntry":373,"../model/SiteMembershipBody":379,"../model/SiteMembershipBody1":380,"../model/SiteMembershipRequestEntry":382,"../model/SiteMembershipRequestPaging":383,"../model/SitePaging":385}],278:[function(require,module,exports){ +},{"../ApiClient":271,"../model/ActivityPaging":290,"../model/Error":312,"../model/FavoriteBody":315,"../model/FavoriteEntry":316,"../model/FavoritePaging":317,"../model/FavoriteSiteBody":319,"../model/InlineResponse201":320,"../model/PersonEntry":349,"../model/PersonNetworkEntry":351,"../model/PersonNetworkPaging":352,"../model/PreferenceEntry":355,"../model/PreferencePaging":356,"../model/SiteEntry":375,"../model/SiteMembershipBody":381,"../model/SiteMembershipBody1":382,"../model/SiteMembershipRequestEntry":384,"../model/SiteMembershipRequestPaging":385,"../model/SitePaging":387}],280:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -61393,7 +61956,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/Error":310,"../model/RatingBody":358,"../model/RatingEntry":359,"../model/RatingPaging":360}],279:[function(require,module,exports){ +},{"../ApiClient":271,"../model/Error":312,"../model/RatingBody":360,"../model/RatingEntry":361,"../model/RatingPaging":362}],281:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -61650,7 +62213,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/Error":310,"../model/RenditionBody":363,"../model/RenditionEntry":364,"../model/RenditionPaging":365}],280:[function(require,module,exports){ +},{"../ApiClient":271,"../model/Error":312,"../model/RenditionBody":365,"../model/RenditionEntry":366,"../model/RenditionPaging":367}],282:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -61738,7 +62301,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/Error":310,"../model/NodePaging":336}],281:[function(require,module,exports){ +},{"../ApiClient":271,"../model/Error":312,"../model/NodePaging":338}],283:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -61979,7 +62542,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/EmailSharedLinkBody":309,"../model/Error":310,"../model/NodeSharedLinkEntry":339,"../model/NodeSharedLinkPaging":340,"../model/SharedLinkBody":367}],282:[function(require,module,exports){ +},{"../ApiClient":271,"../model/EmailSharedLinkBody":311,"../model/Error":312,"../model/NodeSharedLinkEntry":341,"../model/NodeSharedLinkPaging":342,"../model/SharedLinkBody":369}],284:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -62429,7 +62992,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/Error":310,"../model/SiteBody":369,"../model/SiteContainerEntry":371,"../model/SiteContainerPaging":372,"../model/SiteEntry":373,"../model/SiteMemberBody":375,"../model/SiteMemberEntry":376,"../model/SiteMemberPaging":377,"../model/SiteMemberRoleBody":378,"../model/SitePaging":385}],283:[function(require,module,exports){ +},{"../ApiClient":271,"../model/Error":312,"../model/SiteBody":371,"../model/SiteContainerEntry":373,"../model/SiteContainerPaging":374,"../model/SiteEntry":375,"../model/SiteMemberBody":377,"../model/SiteMemberEntry":378,"../model/SiteMemberPaging":379,"../model/SiteMemberRoleBody":380,"../model/SitePaging":387}],285:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -62679,7 +63242,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"../model/Error":310,"../model/TagBody":388,"../model/TagBody1":389,"../model/TagEntry":390,"../model/TagPaging":391}],284:[function(require,module,exports){ +},{"../ApiClient":271,"../model/Error":312,"../model/TagBody":390,"../model/TagBody1":391,"../model/TagEntry":392,"../model/TagPaging":393}],286:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -63353,7 +63916,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"./ApiClient":269,"./api/AssociationsApi":270,"./api/ChangesApi":271,"./api/ChildAssociationsApi":272,"./api/CommentsApi":273,"./api/FavoritesApi":274,"./api/NetworksApi":275,"./api/NodesApi":276,"./api/PeopleApi":277,"./api/RatingsApi":278,"./api/RenditionsApi":279,"./api/SearchApi":280,"./api/SharedlinksApi":281,"./api/SitesApi":282,"./api/TagsApi":283,"./model/Activity":285,"./model/ActivityActivitySummary":286,"./model/ActivityEntry":287,"./model/ActivityPaging":288,"./model/ActivityPagingList":289,"./model/AssocChildBody":290,"./model/AssocInfo":291,"./model/AssocTargetBody":292,"./model/ChildAssocInfo":293,"./model/Comment":294,"./model/CommentBody":295,"./model/CommentBody1":296,"./model/CommentEntry":297,"./model/CommentPaging":298,"./model/CommentPagingList":299,"./model/Company":300,"./model/ContentInfo":301,"./model/CopyBody":302,"./model/DeletedNode":303,"./model/DeletedNodeEntry":304,"./model/DeletedNodeMinimal":305,"./model/DeletedNodeMinimalEntry":306,"./model/DeletedNodesPaging":307,"./model/DeletedNodesPagingList":308,"./model/EmailSharedLinkBody":309,"./model/Error":310,"./model/ErrorError":311,"./model/Favorite":312,"./model/FavoriteBody":313,"./model/FavoriteEntry":314,"./model/FavoritePaging":315,"./model/FavoritePagingList":316,"./model/FavoriteSiteBody":317,"./model/InlineResponse201":318,"./model/InlineResponse201Entry":319,"./model/MoveBody":320,"./model/NetworkQuota":321,"./model/NodeAssocMinimal":322,"./model/NodeAssocMinimalEntry":323,"./model/NodeAssocPaging":324,"./model/NodeAssocPagingList":325,"./model/NodeBody":326,"./model/NodeBody1":327,"./model/NodeChildAssocMinimal":328,"./model/NodeChildAssocMinimalEntry":329,"./model/NodeChildAssocPaging":330,"./model/NodeChildAssocPagingList":331,"./model/NodeEntry":332,"./model/NodeFull":333,"./model/NodeMinimal":334,"./model/NodeMinimalEntry":335,"./model/NodePaging":336,"./model/NodePagingList":337,"./model/NodeSharedLink":338,"./model/NodeSharedLinkEntry":339,"./model/NodeSharedLinkPaging":340,"./model/NodeSharedLinkPagingList":341,"./model/NodesnodeIdchildrenContent":342,"./model/Pagination":343,"./model/PathElement":344,"./model/PathInfo":345,"./model/Person":346,"./model/PersonEntry":347,"./model/PersonNetwork":348,"./model/PersonNetworkEntry":349,"./model/PersonNetworkPaging":350,"./model/PersonNetworkPagingList":351,"./model/Preference":352,"./model/PreferenceEntry":353,"./model/PreferencePaging":354,"./model/PreferencePagingList":355,"./model/Rating":356,"./model/RatingAggregate":357,"./model/RatingBody":358,"./model/RatingEntry":359,"./model/RatingPaging":360,"./model/RatingPagingList":361,"./model/Rendition":362,"./model/RenditionBody":363,"./model/RenditionEntry":364,"./model/RenditionPaging":365,"./model/RenditionPagingList":366,"./model/SharedLinkBody":367,"./model/Site":368,"./model/SiteBody":369,"./model/SiteContainer":370,"./model/SiteContainerEntry":371,"./model/SiteContainerPaging":372,"./model/SiteEntry":373,"./model/SiteMember":374,"./model/SiteMemberBody":375,"./model/SiteMemberEntry":376,"./model/SiteMemberPaging":377,"./model/SiteMemberRoleBody":378,"./model/SiteMembershipBody":379,"./model/SiteMembershipBody1":380,"./model/SiteMembershipRequest":381,"./model/SiteMembershipRequestEntry":382,"./model/SiteMembershipRequestPaging":383,"./model/SiteMembershipRequestPagingList":384,"./model/SitePaging":385,"./model/SitePagingList":386,"./model/Tag":387,"./model/TagBody":388,"./model/TagBody1":389,"./model/TagEntry":390,"./model/TagPaging":391,"./model/TagPagingList":392,"./model/UserInfo":393}],285:[function(require,module,exports){ +},{"./ApiClient":271,"./api/AssociationsApi":272,"./api/ChangesApi":273,"./api/ChildAssociationsApi":274,"./api/CommentsApi":275,"./api/FavoritesApi":276,"./api/NetworksApi":277,"./api/NodesApi":278,"./api/PeopleApi":279,"./api/RatingsApi":280,"./api/RenditionsApi":281,"./api/SearchApi":282,"./api/SharedlinksApi":283,"./api/SitesApi":284,"./api/TagsApi":285,"./model/Activity":287,"./model/ActivityActivitySummary":288,"./model/ActivityEntry":289,"./model/ActivityPaging":290,"./model/ActivityPagingList":291,"./model/AssocChildBody":292,"./model/AssocInfo":293,"./model/AssocTargetBody":294,"./model/ChildAssocInfo":295,"./model/Comment":296,"./model/CommentBody":297,"./model/CommentBody1":298,"./model/CommentEntry":299,"./model/CommentPaging":300,"./model/CommentPagingList":301,"./model/Company":302,"./model/ContentInfo":303,"./model/CopyBody":304,"./model/DeletedNode":305,"./model/DeletedNodeEntry":306,"./model/DeletedNodeMinimal":307,"./model/DeletedNodeMinimalEntry":308,"./model/DeletedNodesPaging":309,"./model/DeletedNodesPagingList":310,"./model/EmailSharedLinkBody":311,"./model/Error":312,"./model/ErrorError":313,"./model/Favorite":314,"./model/FavoriteBody":315,"./model/FavoriteEntry":316,"./model/FavoritePaging":317,"./model/FavoritePagingList":318,"./model/FavoriteSiteBody":319,"./model/InlineResponse201":320,"./model/InlineResponse201Entry":321,"./model/MoveBody":322,"./model/NetworkQuota":323,"./model/NodeAssocMinimal":324,"./model/NodeAssocMinimalEntry":325,"./model/NodeAssocPaging":326,"./model/NodeAssocPagingList":327,"./model/NodeBody":328,"./model/NodeBody1":329,"./model/NodeChildAssocMinimal":330,"./model/NodeChildAssocMinimalEntry":331,"./model/NodeChildAssocPaging":332,"./model/NodeChildAssocPagingList":333,"./model/NodeEntry":334,"./model/NodeFull":335,"./model/NodeMinimal":336,"./model/NodeMinimalEntry":337,"./model/NodePaging":338,"./model/NodePagingList":339,"./model/NodeSharedLink":340,"./model/NodeSharedLinkEntry":341,"./model/NodeSharedLinkPaging":342,"./model/NodeSharedLinkPagingList":343,"./model/NodesnodeIdchildrenContent":344,"./model/Pagination":345,"./model/PathElement":346,"./model/PathInfo":347,"./model/Person":348,"./model/PersonEntry":349,"./model/PersonNetwork":350,"./model/PersonNetworkEntry":351,"./model/PersonNetworkPaging":352,"./model/PersonNetworkPagingList":353,"./model/Preference":354,"./model/PreferenceEntry":355,"./model/PreferencePaging":356,"./model/PreferencePagingList":357,"./model/Rating":358,"./model/RatingAggregate":359,"./model/RatingBody":360,"./model/RatingEntry":361,"./model/RatingPaging":362,"./model/RatingPagingList":363,"./model/Rendition":364,"./model/RenditionBody":365,"./model/RenditionEntry":366,"./model/RenditionPaging":367,"./model/RenditionPagingList":368,"./model/SharedLinkBody":369,"./model/Site":370,"./model/SiteBody":371,"./model/SiteContainer":372,"./model/SiteContainerEntry":373,"./model/SiteContainerPaging":374,"./model/SiteEntry":375,"./model/SiteMember":376,"./model/SiteMemberBody":377,"./model/SiteMemberEntry":378,"./model/SiteMemberPaging":379,"./model/SiteMemberRoleBody":380,"./model/SiteMembershipBody":381,"./model/SiteMembershipBody1":382,"./model/SiteMembershipRequest":383,"./model/SiteMembershipRequestEntry":384,"./model/SiteMembershipRequestPaging":385,"./model/SiteMembershipRequestPagingList":386,"./model/SitePaging":387,"./model/SitePagingList":388,"./model/Tag":389,"./model/TagBody":390,"./model/TagBody1":391,"./model/TagEntry":392,"./model/TagPaging":393,"./model/TagPagingList":394,"./model/UserInfo":395}],287:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -63627,7 +64190,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ActivityActivitySummary":286}],286:[function(require,module,exports){ +},{"../ApiClient":271,"./ActivityActivitySummary":288}],288:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -63722,7 +64285,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],287:[function(require,module,exports){ +},{"../ApiClient":271}],289:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -63788,7 +64351,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Activity":285}],288:[function(require,module,exports){ +},{"../ApiClient":271,"./Activity":287}],290:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -63850,7 +64413,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ActivityPagingList":289}],289:[function(require,module,exports){ +},{"../ApiClient":271,"./ActivityPagingList":291}],291:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -63926,7 +64489,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ActivityEntry":287,"./Pagination":343}],290:[function(require,module,exports){ +},{"../ApiClient":271,"./ActivityEntry":289,"./Pagination":345}],292:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -63996,7 +64559,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],291:[function(require,module,exports){ +},{"../ApiClient":271}],293:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64058,7 +64621,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],292:[function(require,module,exports){ +},{"../ApiClient":271}],294:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64128,7 +64691,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],293:[function(require,module,exports){ +},{"../ApiClient":271}],295:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64198,7 +64761,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],294:[function(require,module,exports){ +},{"../ApiClient":271}],296:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64344,7 +64907,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Person":346}],295:[function(require,module,exports){ +},{"../ApiClient":271,"./Person":348}],297:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64410,7 +64973,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],296:[function(require,module,exports){ +},{"../ApiClient":271}],298:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64476,7 +65039,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],297:[function(require,module,exports){ +},{"../ApiClient":271}],299:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64542,7 +65105,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Comment":294}],298:[function(require,module,exports){ +},{"../ApiClient":271,"./Comment":296}],300:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64604,7 +65167,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./CommentPagingList":299}],299:[function(require,module,exports){ +},{"../ApiClient":271,"./CommentPagingList":301}],301:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64680,7 +65243,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./CommentEntry":297,"./Pagination":343}],300:[function(require,module,exports){ +},{"../ApiClient":271,"./CommentEntry":299,"./Pagination":345}],302:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64798,7 +65361,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],301:[function(require,module,exports){ +},{"../ApiClient":271}],303:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64884,7 +65447,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],302:[function(require,module,exports){ +},{"../ApiClient":271}],304:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -64954,7 +65517,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],303:[function(require,module,exports){ +},{"../ApiClient":271}],305:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65034,7 +65597,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ContentInfo":301,"./NodeFull":333,"./UserInfo":393}],304:[function(require,module,exports){ +},{"../ApiClient":271,"./ContentInfo":303,"./NodeFull":335,"./UserInfo":395}],306:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65096,7 +65659,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./DeletedNode":303}],305:[function(require,module,exports){ +},{"../ApiClient":271,"./DeletedNode":305}],307:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65176,7 +65739,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ContentInfo":301,"./NodeMinimal":334,"./PathElement":344,"./UserInfo":393}],306:[function(require,module,exports){ +},{"../ApiClient":271,"./ContentInfo":303,"./NodeMinimal":336,"./PathElement":346,"./UserInfo":395}],308:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65238,7 +65801,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./DeletedNodeMinimal":305}],307:[function(require,module,exports){ +},{"../ApiClient":271,"./DeletedNodeMinimal":307}],309:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65300,7 +65863,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./DeletedNodesPagingList":308}],308:[function(require,module,exports){ +},{"../ApiClient":271,"./DeletedNodesPagingList":310}],310:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65370,7 +65933,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./DeletedNodeMinimalEntry":306,"./Pagination":343}],309:[function(require,module,exports){ +},{"../ApiClient":271,"./DeletedNodeMinimalEntry":308,"./Pagination":345}],311:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65456,7 +66019,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],310:[function(require,module,exports){ +},{"../ApiClient":271}],312:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65518,7 +66081,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ErrorError":311}],311:[function(require,module,exports){ +},{"../ApiClient":271,"./ErrorError":313}],313:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65631,7 +66194,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],312:[function(require,module,exports){ +},{"../ApiClient":271}],314:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65719,7 +66282,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],313:[function(require,module,exports){ +},{"../ApiClient":271}],315:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65785,7 +66348,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],314:[function(require,module,exports){ +},{"../ApiClient":271}],316:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65851,7 +66414,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Favorite":312}],315:[function(require,module,exports){ +},{"../ApiClient":271,"./Favorite":314}],317:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65913,7 +66476,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./FavoritePagingList":316}],316:[function(require,module,exports){ +},{"../ApiClient":271,"./FavoritePagingList":318}],318:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -65989,7 +66552,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./FavoriteEntry":314,"./Pagination":343}],317:[function(require,module,exports){ +},{"../ApiClient":271,"./FavoriteEntry":316,"./Pagination":345}],319:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66051,7 +66614,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],318:[function(require,module,exports){ +},{"../ApiClient":271}],320:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66113,7 +66676,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./InlineResponse201Entry":319}],319:[function(require,module,exports){ +},{"../ApiClient":271,"./InlineResponse201Entry":321}],321:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66179,7 +66742,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],320:[function(require,module,exports){ +},{"../ApiClient":271}],322:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66249,7 +66812,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],321:[function(require,module,exports){ +},{"../ApiClient":271}],323:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66336,7 +66899,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],322:[function(require,module,exports){ +},{"../ApiClient":271}],324:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66486,7 +67049,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./AssocInfo":291,"./ContentInfo":301,"./UserInfo":393}],323:[function(require,module,exports){ +},{"../ApiClient":271,"./AssocInfo":293,"./ContentInfo":303,"./UserInfo":395}],325:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66552,7 +67115,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeAssocMinimal":322}],324:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeAssocMinimal":324}],326:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66614,7 +67177,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeAssocPagingList":325}],325:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeAssocPagingList":327}],327:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66684,7 +67247,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeAssocMinimalEntry":323,"./Pagination":343}],326:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeAssocMinimalEntry":325,"./Pagination":345}],328:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66770,7 +67333,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],327:[function(require,module,exports){ +},{"../ApiClient":271}],329:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -66872,7 +67435,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodesnodeIdchildrenContent":342}],328:[function(require,module,exports){ +},{"../ApiClient":271,"./NodesnodeIdchildrenContent":344}],330:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67022,7 +67585,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ChildAssocInfo":293,"./ContentInfo":301,"./UserInfo":393}],329:[function(require,module,exports){ +},{"../ApiClient":271,"./ChildAssocInfo":295,"./ContentInfo":303,"./UserInfo":395}],331:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67088,7 +67651,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeChildAssocMinimal":328}],330:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeChildAssocMinimal":330}],332:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67150,7 +67713,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeChildAssocPagingList":331}],331:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeChildAssocPagingList":333}],333:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67220,7 +67783,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeChildAssocMinimalEntry":329,"./Pagination":343}],332:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeChildAssocMinimalEntry":331,"./Pagination":345}],334:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67286,7 +67849,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeFull":333}],333:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeFull":335}],335:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67452,7 +68015,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ContentInfo":301,"./UserInfo":393}],334:[function(require,module,exports){ +},{"../ApiClient":271,"./ContentInfo":303,"./UserInfo":395}],336:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67605,7 +68168,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ContentInfo":301,"./PathElement":344,"./UserInfo":393}],335:[function(require,module,exports){ +},{"../ApiClient":271,"./ContentInfo":303,"./PathElement":346,"./UserInfo":395}],337:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67671,7 +68234,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeMinimal":334}],336:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeMinimal":336}],338:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67733,7 +68296,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodePagingList":337}],337:[function(require,module,exports){ +},{"../ApiClient":271,"./NodePagingList":339}],339:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67803,7 +68366,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeMinimalEntry":335,"./Pagination":343}],338:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeMinimalEntry":337,"./Pagination":345}],340:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67921,7 +68484,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ContentInfo":301,"./UserInfo":393}],339:[function(require,module,exports){ +},{"../ApiClient":271,"./ContentInfo":303,"./UserInfo":395}],341:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -67987,7 +68550,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeSharedLink":338}],340:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeSharedLink":340}],342:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68049,7 +68612,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeSharedLinkPagingList":341}],341:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeSharedLinkPagingList":343}],343:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68125,7 +68688,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NodeSharedLinkEntry":339,"./Pagination":343}],342:[function(require,module,exports){ +},{"../ApiClient":271,"./NodeSharedLinkEntry":341,"./Pagination":345}],344:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68195,7 +68758,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],343:[function(require,module,exports){ +},{"../ApiClient":271}],345:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68305,7 +68868,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],344:[function(require,module,exports){ +},{"../ApiClient":271}],346:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68375,7 +68938,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],345:[function(require,module,exports){ +},{"../ApiClient":271}],347:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68453,7 +69016,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./PathElement":344}],346:[function(require,module,exports){ +},{"../ApiClient":271,"./PathElement":346}],348:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68666,7 +69229,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Company":300}],347:[function(require,module,exports){ +},{"../ApiClient":271,"./Company":302}],349:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68732,7 +69295,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Person":346}],348:[function(require,module,exports){ +},{"../ApiClient":271,"./Person":348}],350:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68877,7 +69440,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./NetworkQuota":321}],349:[function(require,module,exports){ +},{"../ApiClient":271,"./NetworkQuota":323}],351:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -68943,7 +69506,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./PersonNetwork":348}],350:[function(require,module,exports){ +},{"../ApiClient":271,"./PersonNetwork":350}],352:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69005,7 +69568,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./PersonNetworkPagingList":351}],351:[function(require,module,exports){ +},{"../ApiClient":271,"./PersonNetworkPagingList":353}],353:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69081,7 +69644,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Pagination":343,"./PersonNetworkEntry":349}],352:[function(require,module,exports){ +},{"../ApiClient":271,"./Pagination":345,"./PersonNetworkEntry":351}],354:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69160,7 +69723,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],353:[function(require,module,exports){ +},{"../ApiClient":271}],355:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69226,7 +69789,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Preference":352}],354:[function(require,module,exports){ +},{"../ApiClient":271,"./Preference":354}],356:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69288,7 +69851,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./PreferencePagingList":355}],355:[function(require,module,exports){ +},{"../ApiClient":271,"./PreferencePagingList":357}],357:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69364,7 +69927,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Pagination":343,"./PreferenceEntry":353}],356:[function(require,module,exports){ +},{"../ApiClient":271,"./Pagination":345,"./PreferenceEntry":355}],358:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69456,7 +70019,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./RatingAggregate":357}],357:[function(require,module,exports){ +},{"../ApiClient":271,"./RatingAggregate":359}],359:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69530,7 +70093,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],358:[function(require,module,exports){ +},{"../ApiClient":271}],360:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69628,7 +70191,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],359:[function(require,module,exports){ +},{"../ApiClient":271}],361:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69694,7 +70257,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Rating":356}],360:[function(require,module,exports){ +},{"../ApiClient":271,"./Rating":358}],362:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69756,7 +70319,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./RatingPagingList":361}],361:[function(require,module,exports){ +},{"../ApiClient":271,"./RatingPagingList":363}],363:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69832,7 +70395,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Pagination":343,"./RatingEntry":359}],362:[function(require,module,exports){ +},{"../ApiClient":271,"./Pagination":345,"./RatingEntry":361}],364:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69910,7 +70473,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./ContentInfo":301}],363:[function(require,module,exports){ +},{"../ApiClient":271,"./ContentInfo":303}],365:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -69972,7 +70535,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],364:[function(require,module,exports){ +},{"../ApiClient":271}],366:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70038,7 +70601,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Rendition":362}],365:[function(require,module,exports){ +},{"../ApiClient":271,"./Rendition":364}],367:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70100,7 +70663,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./RenditionPagingList":366}],366:[function(require,module,exports){ +},{"../ApiClient":271,"./RenditionPagingList":368}],368:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70170,7 +70733,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Pagination":343,"./RenditionEntry":364}],367:[function(require,module,exports){ +},{"../ApiClient":271,"./Pagination":345,"./RenditionEntry":366}],369:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70232,7 +70795,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],368:[function(require,module,exports){ +},{"../ApiClient":271}],370:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70370,7 +70933,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],369:[function(require,module,exports){ +},{"../ApiClient":271}],371:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70489,7 +71052,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],370:[function(require,module,exports){ +},{"../ApiClient":271}],372:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70565,7 +71128,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],371:[function(require,module,exports){ +},{"../ApiClient":271}],373:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70631,7 +71194,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./SiteContainer":370}],372:[function(require,module,exports){ +},{"../ApiClient":271,"./SiteContainer":372}],374:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70693,7 +71256,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./SitePagingList":386}],373:[function(require,module,exports){ +},{"../ApiClient":271,"./SitePagingList":388}],375:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70759,7 +71322,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Site":368}],374:[function(require,module,exports){ +},{"../ApiClient":271,"./Site":370}],376:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70876,7 +71439,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Person":346}],375:[function(require,module,exports){ +},{"../ApiClient":271,"./Person":348}],377:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -70977,7 +71540,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],376:[function(require,module,exports){ +},{"../ApiClient":271}],378:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71043,7 +71606,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./SiteMember":374}],377:[function(require,module,exports){ +},{"../ApiClient":271,"./SiteMember":376}],379:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71105,7 +71668,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./SitePagingList":386}],378:[function(require,module,exports){ +},{"../ApiClient":271,"./SitePagingList":388}],380:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71198,7 +71761,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],379:[function(require,module,exports){ +},{"../ApiClient":271}],381:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71276,7 +71839,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],380:[function(require,module,exports){ +},{"../ApiClient":271}],382:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71338,7 +71901,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],381:[function(require,module,exports){ +},{"../ApiClient":271}],383:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71424,7 +71987,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Site":368}],382:[function(require,module,exports){ +},{"../ApiClient":271,"./Site":370}],384:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71490,7 +72053,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./SiteMembershipRequest":381}],383:[function(require,module,exports){ +},{"../ApiClient":271,"./SiteMembershipRequest":383}],385:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71552,7 +72115,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./SiteMembershipRequestPagingList":384}],384:[function(require,module,exports){ +},{"../ApiClient":271,"./SiteMembershipRequestPagingList":386}],386:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71628,7 +72191,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Pagination":343,"./SiteMembershipRequestEntry":382}],385:[function(require,module,exports){ +},{"../ApiClient":271,"./Pagination":345,"./SiteMembershipRequestEntry":384}],387:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71690,7 +72253,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./SitePagingList":386}],386:[function(require,module,exports){ +},{"../ApiClient":271,"./SitePagingList":388}],388:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71756,7 +72319,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Pagination":343}],387:[function(require,module,exports){ +},{"../ApiClient":271,"./Pagination":345}],389:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71832,7 +72395,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],388:[function(require,module,exports){ +},{"../ApiClient":271}],390:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71898,7 +72461,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],389:[function(require,module,exports){ +},{"../ApiClient":271}],391:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -71960,7 +72523,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],390:[function(require,module,exports){ +},{"../ApiClient":271}],392:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -72026,7 +72589,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Tag":387}],391:[function(require,module,exports){ +},{"../ApiClient":271,"./Tag":389}],393:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -72088,7 +72651,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./TagPagingList":392}],392:[function(require,module,exports){ +},{"../ApiClient":271,"./TagPagingList":394}],394:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -72164,7 +72727,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269,"./Pagination":343,"./TagEntry":390}],393:[function(require,module,exports){ +},{"../ApiClient":271,"./Pagination":345,"./TagEntry":392}],395:[function(require,module,exports){ 'use strict'; var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol ? "symbol" : typeof obj; }; @@ -72234,7 +72797,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol return exports; }); -},{"../ApiClient":269}],394:[function(require,module,exports){ +},{"../ApiClient":271}],396:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -72599,7 +73162,7 @@ module.exports.Core = AlfrescoCoreRestApi; module.exports.Auth = AlfrescoAuthRestApi; module.exports.Mock = AlfrescoMock; -},{"../test/mockObjects/mockAlfrescoApi.js":414,"./alfresco-activiti-rest-api/src/index":178,"./alfresco-auth-rest-api/src/index":261,"./alfresco-core-rest-api/src/index.js":284,"./alfrescoContent":396,"./alfrescoNode":397,"./alfrescoUpload":398,"./alfrescoWebScript":399,"./bpmAuth":400,"./ecmAuth":401,"event-emitter":65,"lodash":72}],395:[function(require,module,exports){ +},{"../test/mockObjects/mockAlfrescoApi.js":416,"./alfresco-activiti-rest-api/src/index":180,"./alfresco-auth-rest-api/src/index":263,"./alfresco-core-rest-api/src/index.js":286,"./alfrescoContent":398,"./alfrescoNode":399,"./alfrescoUpload":400,"./alfrescoWebScript":401,"./bpmAuth":402,"./ecmAuth":403,"event-emitter":65,"lodash":72}],397:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -72864,7 +73427,7 @@ var AlfrescoApiClient = function (_ApiClient) { Emitter(AlfrescoApiClient.prototype); // jshint ignore:line module.exports = AlfrescoApiClient; -},{"./alfresco-core-rest-api/src/ApiClient":269,"event-emitter":65,"lodash":72,"superagent":125}],396:[function(require,module,exports){ +},{"./alfresco-core-rest-api/src/ApiClient":271,"event-emitter":65,"lodash":72,"superagent":127}],398:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -72930,7 +73493,7 @@ var AlfrescoContent = function () { module.exports = AlfrescoContent; -},{}],397:[function(require,module,exports){ +},{}],399:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -73043,7 +73606,7 @@ var AlfrescoNode = function (_AlfrescoCoreRestApi$) { module.exports = AlfrescoNode; -},{"./alfresco-core-rest-api/src/index.js":284,"lodash":72}],398:[function(require,module,exports){ +},{"./alfresco-core-rest-api/src/index.js":286,"lodash":72}],400:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -73141,7 +73704,7 @@ var AlfrescoUpload = function (_AlfrescoCoreRestApi$) { Emitter(AlfrescoUpload.prototype); // jshint ignore:line module.exports = AlfrescoUpload; -},{"./alfresco-core-rest-api/src/index.js":284,"event-emitter":65,"lodash":72}],399:[function(require,module,exports){ +},{"./alfresco-core-rest-api/src/index.js":286,"event-emitter":65,"lodash":72}],401:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -73205,7 +73768,7 @@ var AlfrescoWebScriptApi = function () { module.exports = AlfrescoWebScriptApi; -},{"./alfresco-core-rest-api/src/ApiClient":269}],400:[function(require,module,exports){ +},{"./alfresco-core-rest-api/src/ApiClient":271}],402:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -73410,7 +73973,7 @@ Emitter(BpmAuth.prototype); // jshint ignore:line module.exports = BpmAuth; }).call(this,require("buffer").Buffer) -},{"./alfrescoApiClient":395,"buffer":8,"event-emitter":65}],401:[function(require,module,exports){ +},{"./alfrescoApiClient":397,"buffer":8,"event-emitter":65}],403:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -73628,7 +74191,7 @@ var EcmAuth = function (_AlfrescoApiClient) { Emitter(EcmAuth.prototype); // jshint ignore:line module.exports = EcmAuth; -},{"./alfresco-auth-rest-api/src/index":261,"./alfrescoApiClient":395,"event-emitter":65}],402:[function(require,module,exports){ +},{"./alfresco-auth-rest-api/src/index":263,"./alfrescoApiClient":397,"event-emitter":65}],404:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -73677,7 +74240,7 @@ var AuthResponseMock = function (_BaseMock) { module.exports = AuthResponseMock; -},{"../baseMock":413,"nock":75}],403:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],405:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -73735,7 +74298,7 @@ var ModelsMock = function (_BaseMock) { module.exports = ModelsMock; -},{"../baseMock":413,"nock":75}],404:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],406:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -73823,7 +74386,7 @@ var ProcessMock = function (_BaseMock) { module.exports = ProcessMock; -},{"../baseMock":413,"nock":75}],405:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],407:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -74743,6 +75306,34 @@ var TasksMock = function (_BaseMock) { 'gridsterForm': false }); } + }, { + key: 'get200getRestFieldValuesColumn', + value: function get200getRestFieldValuesColumn() { + nock('http://127.0.0.1:9999', { 'encodedQueryParams': true }).get('/activiti-app/api/enterprise/task-forms/1/form-values/label/user').reply(200, [{ 'id': '1', 'name': 'Leanne Graham' }, { 'id': '2', 'name': 'Ervin Howell' }, { + 'id': '3', + 'name': 'Clementine Bauch' + }, { 'id': '4', 'name': 'Patricia Lebsack' }, { 'id': '5', 'name': 'Chelsey Dietrich' }, { + 'id': '6', + 'name': 'Mrs. Dennis Schulist' + }, { 'id': '7', 'name': 'Kurtis Weissnat' }, { 'id': '8', 'name': 'Nicholas Runolfsdottir V' }, { + 'id': '9', + 'name': 'Glenna Reichert' + }, { 'id': '10', 'name': 'Clementina DuBuque' }]); + } + }, { + key: 'get200getRestFieldValues', + value: function get200getRestFieldValues() { + nock('http://127.0.0.1:9999', { 'encodedQueryParams': true }).get('/activiti-app/api/enterprise/task-forms/2/form-values/label').reply(200, [{ 'id': '1', 'name': 'Leanne Graham' }, { 'id': '2', 'name': 'Ervin Howell' }, { + 'id': '3', + 'name': 'Clementine Bauch' + }, { 'id': '4', 'name': 'Patricia Lebsack' }, { 'id': '5', 'name': 'Chelsey Dietrich' }, { + 'id': '6', + 'name': 'Mrs. Dennis Schulist' + }, { 'id': '7', 'name': 'Kurtis Weissnat' }, { 'id': '8', 'name': 'Nicholas Runolfsdottir V' }, { + 'id': '9', + 'name': 'Glenna Reichert' + }, { 'id': '10', 'name': 'Clementina DuBuque' }]); + } }]); return TasksMock; @@ -74750,7 +75341,7 @@ var TasksMock = function (_BaseMock) { module.exports = TasksMock; -},{"../baseMock":413,"nock":75}],406:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],408:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -74818,7 +75409,7 @@ var userFiltersMock = function (_BaseMock) { module.exports = userFiltersMock; -},{"../baseMock":413,"nock":75}],407:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],409:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -74929,7 +75520,7 @@ var AuthResponseMock = function (_BaseMock) { module.exports = AuthResponseMock; -},{"../baseMock":413,"nock":75}],408:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],410:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -75250,7 +75841,7 @@ var NodeMock = function (_BaseMock) { module.exports = NodeMock; -},{"../baseMock":413,"nock":75}],409:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],411:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -75348,7 +75939,7 @@ var RenditionMock = function (_BaseMock) { module.exports = RenditionMock; -},{"../baseMock":413,"nock":75}],410:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],412:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -75411,7 +76002,7 @@ var TagMock = function (_BaseMock) { module.exports = TagMock; -},{"../baseMock":413,"nock":75}],411:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],413:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -75519,7 +76110,7 @@ var UploadMock = function (_BaseMock) { module.exports = UploadMock; -},{"../baseMock":413,"nock":75}],412:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],414:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -75598,7 +76189,7 @@ var WebScriptMock = function (_BaseMock) { module.exports = WebScriptMock; -},{"../baseMock":413,"nock":75}],413:[function(require,module,exports){ +},{"../baseMock":415,"nock":75}],415:[function(require,module,exports){ 'use strict'; var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); @@ -75646,7 +76237,7 @@ var BaseMock = function () { module.exports = BaseMock; -},{"nock":75}],414:[function(require,module,exports){ +},{"nock":75}],416:[function(require,module,exports){ 'use strict'; var mockAlfrescoApi = {}; @@ -75669,5 +76260,5 @@ mockAlfrescoApi.ActivitiMock.UserFilters = require('./activiti/userFiltersMock.j module.exports = mockAlfrescoApi; -},{"./activiti/authResponseMock.js":402,"./activiti/modelsMock.js":403,"./activiti/processMock.js":404,"./activiti/tasksMock.js":405,"./activiti/userFiltersMock.js":406,"./alfresco/authResponseMock.js":407,"./alfresco/nodeMock.js":408,"./alfresco/renditionMock.js":409,"./alfresco/tagMock.js":410,"./alfresco/uploadMock.js":411,"./alfresco/webScriptMock.js":412}]},{},[1])(1) +},{"./activiti/authResponseMock.js":404,"./activiti/modelsMock.js":405,"./activiti/processMock.js":406,"./activiti/tasksMock.js":407,"./activiti/userFiltersMock.js":408,"./alfresco/authResponseMock.js":409,"./alfresco/nodeMock.js":410,"./alfresco/renditionMock.js":411,"./alfresco/tagMock.js":412,"./alfresco/uploadMock.js":413,"./alfresco/webScriptMock.js":414}]},{},[1])(1) }); \ No newline at end of file diff --git a/dist/alfresco-js-api.min.js b/dist/alfresco-js-api.min.js index 139be81dc7..a32868457f 100644 --- a/dist/alfresco-js-api.min.js +++ b/dist/alfresco-js-api.min.js @@ -1,31 +1,31 @@ (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.AlfrescoApi = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=0;r--)if(s[r]!=a[r])return!1;for(r=s.length-1;r>=0;r--)if(o=s[r],!p(e[o],t[o]))return!1;return!0}function u(e,t){return!(!e||!t)&&("[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t||t.call({},e)===!0)}function d(e,t,n,i){var o;f.isString(n)&&(i=n,n=null);try{t()}catch(e){o=e}if(i=(n&&n.name?" ("+n.name+").":".")+(i?" "+i:"."),e&&!o&&s(o,n,"Missing expected exception"+i),!e&&u(o,n)&&s(o,n,"Got unwanted exception"+i),e&&o&&n&&!u(o,n)||!e&&o)throw o}var f=e("util/"),y=Array.prototype.slice,h=Object.prototype.hasOwnProperty,m=t.exports=a;m.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=r(this),this.generatedMessage=!0);var t=e.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var i=n.stack,o=t.name,a=i.indexOf("\n"+o);if(a>=0){var p=i.indexOf("\n",a+1);i=i.substring(p+1)}this.stack=i}}},f.inherits(m.AssertionError,Error),m.fail=s,m.ok=a,m.equal=function(e,t,n){e!=t&&s(e,t,n,"==",m.equal)},m.notEqual=function(e,t,n){e==t&&s(e,t,n,"!=",m.notEqual)},m.deepEqual=function(e,t,n){p(e,t)||s(e,t,n,"deepEqual",m.deepEqual)},m.notDeepEqual=function(e,t,n){p(e,t)&&s(e,t,n,"notDeepEqual",m.notDeepEqual)},m.strictEqual=function(e,t,n){e!==t&&s(e,t,n,"===",m.strictEqual)},m.notStrictEqual=function(e,t,n){e===t&&s(e,t,n,"!==",m.notStrictEqual)},m.throws=function(e,t,n){d.apply(this,[!0].concat(y.call(arguments)))},m.doesNotThrow=function(e,t){d.apply(this,[!1].concat(y.call(arguments)))},m.ifError=function(e){if(e)throw e};var v=Object.keys||function(e){var t=[];for(var n in e)h.call(e,n)&&t.push(n);return t}},{"util/":134}],3:[function(e,t,n){function i(){function e(e,n){Object.keys(n).forEach(function(i){~t.indexOf(i)||(e[i]=n[i])})}var t=[].slice.call(arguments);return function(){for(var t=[].slice.call(arguments),n=0,i={};n0)throw new Error("Invalid string. Length must be a multiple of 4");r="="===e[a-2]?2:"="===e[a-1]?1:0,s=new l(3*a/4-r),i=r>0?a-4:a;var p=0;for(t=0,n=0;t>16&255,s[p++]=o>>8&255,s[p++]=255&o;return 2===r?(o=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,s[p++]=255&o):1===r&&(o=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,s[p++]=o>>8&255,s[p++]=255&o),s}function r(e){return p[e>>18&63]+p[e>>12&63]+p[e>>6&63]+p[63&e]}function s(e,t,n){for(var i,o=[],s=t;sl?l:c+a));return 1===i?(t=e[n-1],o+=p[t>>2],o+=p[t<<4&63],o+="=="):2===i&&(t=(e[n-2]<<8)+e[n-1],o+=p[t>>10],o+=p[t>>4&63],o+=p[t<<2&63],o+="="),r.push(o),r.join("")}n.toByteArray=o,n.fromByteArray=a;var p=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array;i()},{}],5:[function(e,t,n){},{}],6:[function(e,t,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],7:[function(e,t,n){(function(t){"use strict";var i=e("buffer"),o=i.Buffer,r=i.SlowBuffer,s=i.kMaxLength||2147483647;n.alloc=function(e,t,n){if("function"==typeof o.alloc)return o.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>s)throw new RangeError("size is too large");var i=n,r=t;void 0===r&&(i=void 0,r=0);var a=new o(e);if("string"==typeof r)for(var p=new o(r,i),c=p.length,l=-1;++ls)throw new RangeError("size is too large");return new o(e)},n.from=function(e,n,i){if("function"==typeof o.from&&(!t.Uint8Array||Uint8Array.from!==o.from))return o.from(e,n,i);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new o(e,n);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var r=n;if(1===arguments.length)return new o(e);"undefined"==typeof r&&(r=0);var s=i;if("undefined"==typeof s&&(s=e.byteLength-r),r>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(s>e.byteLength-r)throw new RangeError("'length' is out of bounds");return new o(e.slice(r,r+s))}if(o.isBuffer(e)){var a=new o(e.length);return e.copy(a,0,0,e.length),a}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new o(e);if("Buffer"===e.type&&Array.isArray(e.data))return new o(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},n.allocUnsafeSlow=function(e){if("function"==typeof o.allocUnsafeSlow)return o.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=s)throw new RangeError("size is too large");return new r(e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:8}],8:[function(e,t,n){(function(t){"use strict";function i(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function o(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),s.alloc(+e)}function v(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"binary":case"raw":case"raws":return n;case"utf8":case"utf-8":case void 0:return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return W(e).length;default:if(i)return z(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return O(this,t,n);case"ascii":return E(this,t,n);case"binary":return k(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function A(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function b(e,t,n,i){function o(e,t){return 1===r?e[t]:e.readUInt16BE(t*r)}var r=1,s=e.length,a=t.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;r=2,s/=2,a/=2,n/=2}for(var p=-1,c=n;co&&(i=o)):i=o;var r=t.length;if(r%2!==0)throw new Error("Invalid hex string");i>r/2&&(i=r/2);for(var s=0;s239?4:r>223?3:r>191?2:1;if(o+a<=n){var p,c,l,u;switch(a){case 1:r<128&&(s=r);break;case 2:p=e[o+1],128===(192&p)&&(u=(31&r)<<6|63&p,u>127&&(s=u));break;case 3:p=e[o+1],c=e[o+2],128===(192&p)&&128===(192&c)&&(u=(15&r)<<12|(63&p)<<6|63&c,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:p=e[o+1],c=e[o+2],l=e[o+3],128===(192&p)&&128===(192&c)&&128===(192&l)&&(u=(15&r)<<18|(63&p)<<12|(63&c)<<6|63&l,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),o+=a}return j(i)}function j(e){var t=e.length;if(t<=Z)return String.fromCharCode.apply(String,e);for(var n="",i=0;ii)&&(n=i);for(var o="",r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,n,i,o,r){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function N(e,t,n,i){t<0&&(t=65535+t+1);for(var o=0,r=Math.min(e.length-n,2);o>>8*(i?o:1-o)}function D(e,t,n,i){t<0&&(t=4294967295+t+1);for(var o=0,r=Math.min(e.length-n,4);o>>8*(i?o:3-o)&255}function L(e,t,n,i,o,r){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function q(e,t,n,i,o){return o||L(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,i,23,4),n+4}function B(e,t,n,i,o){return o||L(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,i,52,8),n+8}function U(e){if(e=G(e).replace(ee,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function G(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function V(e){return e<16?"0"+e.toString(16):e.toString(16)}function z(e,t){t=t||1/0;for(var n,i=e.length,o=null,r=[],s=0;s55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&r.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&r.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(t-=3)>-1&&r.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;r.push(n)}else if(n<2048){if((t-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function H(e){for(var t=[],n=0;n>8,o=n%256,r.push(o),r.push(i);return r}function W(e){return Q.toByteArray(U(e))}function Y(e,t,n,i){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function J(e){return e!==e}var Q=e("base64-js"),$=e("ieee754"),X=e("isarray");n.Buffer=s,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),n.kMaxLength=o(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,n){return a(null,e,t,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,n){return c(null,e,t,n)},s.allocUnsafe=function(e){return l(null,e)},s.allocUnsafeSlow=function(e){return l(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,o=0,r=Math.min(n,i);o0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},s.prototype.compare=function(e,t,n,i,o){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var r=o-i,a=n-t,p=Math.min(r,a),c=this.slice(i,o),l=e.slice(t,n),u=0;u2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t>>=0,0===this.length)return-1;if(t>=this.length)return-1;if(t<0&&(t=Math.max(this.length+t,0)),"string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:b(this,e,t,n);if("number"==typeof e)return s.TYPED_ARRAY_SUPPORT&&"function"===Uint8Array.prototype.indexOf?Uint8Array.prototype.indexOf.call(this,e,t):b(this,[e],t,n);throw new TypeError("val must be string, number or Buffer")},s.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},s.prototype.write=function(e,t,n,i){if(void 0===t)i="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)i=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t=0|t,isFinite(n)?(n=0|n,void 0===i&&(i="utf8")):(i=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return C(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return R(this,e,t,n);case"binary":return P(this,e,t,n);case"base64":return T(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,t,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Z=4096;s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t0&&(o*=256);)i+=this[e+--t]*o;return i},s.prototype.readUInt8=function(e,t){return t||M(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||M(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||M(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||M(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||M(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||M(e,t,this.length);for(var i=this[e],o=1,r=0;++r=o&&(i-=Math.pow(2,8*t)),i},s.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||M(e,t,this.length);for(var i=t,o=1,r=this[e+--i];i>0&&(o*=256);)r+=this[e+--i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},s.prototype.readInt8=function(e,t){return t||M(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){t||M(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||M(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||M(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||M(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||M(e,4,this.length),$.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||M(e,4,this.length),$.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||M(e,8,this.length),$.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||M(e,8,this.length),$.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=0|t,n=0|n,!i){var o=Math.pow(2,8*n)-1;F(this,e,t,n,o,0)}var r=1,s=0;for(this[t]=255&e;++s=0&&(s*=256);)this[t+r]=e/s&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):D(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=0|t,!i){var o=Math.pow(2,8*n-1);F(this,e,t,n,o-1,-o)}var r=0,s=1,a=0;for(this[t]=255&e;++r>0)-a&255;return t+n},s.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=0|t,!i){var o=Math.pow(2,8*n-1);F(this,e,t,n,o-1,-o)}var r=n-1,s=1,a=0;for(this[t+r]=255&e;--r>=0&&(s*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/s>>0)-a&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):D(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):D(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return q(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return q(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return B(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return B(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(r<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var r;if("number"==typeof e)for(r=t;re,"expected #{this} to have a length above #{exp} but got #{act}","expected #{this} to not have a length above #{exp}",e,i)}else this.assert(n>e,"expected #{this} to be above "+e,"expected #{this} to be at most "+e)}function c(e,t){t&&j(this,"message",t);var n=j(this,"object");if(j(this,"doLength")){new O(n,t).to.have.property("length");var i=n.length;this.assert(i>=e,"expected #{this} to have a length at least #{exp} but got #{act}","expected #{this} to have a length below #{exp}",e,i)}else this.assert(n>=e,"expected #{this} to be at least "+e,"expected #{this} to be below "+e)}function l(e,t){t&&j(this,"message",t);var n=j(this,"object");if(j(this,"doLength")){new O(n,t).to.have.property("length");var i=n.length;this.assert(i1)throw new Error(r);break;case"object":if(arguments.length>1)throw new Error(r);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}if(!e.length)throw new Error("keys required");var s=Object.keys(i),a=e,p=e.length,c=j(this,"any"),l=j(this,"all");if(c||l||(l=!0),c){var u=a.filter(function(e){return~s.indexOf(e)});o=u.length>0}if(l&&(o=e.every(function(e){return~s.indexOf(e)}),j(this,"negate")||j(this,"contains")||(o=o&&e.length==s.length)),p>1){e=e.map(function(e){return t.inspect(e)});var d=e.pop();l&&(n=e.join(", ")+", and "+d),c&&(n=e.join(", ")+", or "+d)}else n=t.inspect(e[0]);n=(p>1?"keys ":"key ")+n,n=(j(this,"contains")?"contain ":"have ")+n,this.assert(o,"expected #{this} to "+n,"expected #{this} to not "+n,a.slice(0).sort(),s.sort(),!0)}function A(e,n,i){i&&j(this,"message",i);var o=j(this,"object");new O(o,i).is.a("function");var r=!1,s=null,a=null,p=null;0===arguments.length?(n=null,e=null):e&&(e instanceof RegExp||"string"==typeof e)?(n=e,e=null):e&&e instanceof Error?(s=e,e=null,n=null):"function"==typeof e?(a=e.prototype.name,(!a||"Error"===a&&e!==Error)&&(a=e.name||(new e).name)):e=null;try{o()}catch(i){if(s)return this.assert(i===s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}",s instanceof Error?s.toString():s,i instanceof Error?i.toString():i),j(this,"object",i),this;if(e&&(this.assert(i instanceof e,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp} but #{act} was thrown",a,i instanceof Error?i.toString():i),!n))return j(this,"object",i),this;var c="error"===t.type(i)&&"message"in i?i.message:""+i;if(null!=c&&n&&n instanceof RegExp)return this.assert(n.exec(c),"expected #{this} to throw error matching #{exp} but got #{act}","expected #{this} to throw error not matching #{exp}",n,c),j(this,"object",i),this;if(null!=c&&n&&"string"==typeof n)return this.assert(~c.indexOf(n),"expected #{this} to throw error including #{exp} but got #{act}","expected #{this} to throw error not including #{act}",n,c),j(this,"object",i),this;r=!0,p=i}var l="",u=null!==a?a:s?"#{exp}":"an error";r&&(l=" but #{act} was thrown"),this.assert(r===!0,"expected #{this} to throw "+u+l,"expected #{this} to not throw "+u+l,s instanceof Error?s.toString():s,p instanceof Error?p.toString():p),j(this,"object",p)}function b(e,n){n&&j(this,"message",n);var i=j(this,"object"),o=j(this,"itself"),r="function"!==t.type(i)||o?i[e]:i.prototype[e];this.assert("function"==typeof r,"expected #{this} to respond to "+t.inspect(e),"expected #{this} to not respond to "+t.inspect(e))}function C(e,n){n&&j(this,"message",n);var i=j(this,"object"),o=e(i);this.assert(o,"expected #{this} to satisfy "+t.objDisplay(e),"expected #{this} to not satisfy"+t.objDisplay(e),!this.negate,o)}function w(e,n,i){i&&j(this,"message",i);var o=j(this,"object");if(new O(o,i).is.a("number"),"number"!==t.type(e)||"number"!==t.type(n))throw new Error("the arguments to closeTo or approximately must be numbers");this.assert(Math.abs(o-e)<=n,"expected #{this} to be close to "+e+" +/- "+n,"expected #{this} not to be close to "+e+" +/- "+n)}function R(e,t,n){return e.every(function(e){return n?t.some(function(t){return n(e,t)}):t.indexOf(e)!==-1})}function P(e,t){t&&j(this,"message",t);var n=j(this,"object");new O(e).to.be.an("array"),this.assert(e.indexOf(n)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",e,n)}function T(e,t,n){n&&j(this,"message",n);var i=j(this,"object");new O(e,n).to.have.property(t),new O(i).is.a("function");var o=e[t];i(),this.assert(o!==e[t],"expected ."+t+" to change","expected ."+t+" to not change")}function S(e,t,n){n&&j(this,"message",n);var i=j(this,"object");new O(e,n).to.have.property(t),new O(i).is.a("function");var o=e[t];i(),this.assert(e[t]-o>0,"expected ."+t+" to increase","expected ."+t+" to not increase")}function I(e,t,n){n&&j(this,"message",n);var i=j(this,"object");new O(e,n).to.have.property(t),new O(i).is.a("function");var o=e[t];i(),this.assert(e[t]-o<0,"expected ."+t+" to decrease","expected ."+t+" to not decrease")}var O=e.Assertion,j=(Object.prototype.toString,t.flag);["to","be","been","is","and","has","have","with","that","which","at","of","same"].forEach(function(e){O.addProperty(e,function(){return this})}),O.addProperty("not",function(){j(this,"negate",!0)}),O.addProperty("deep",function(){j(this,"deep",!0)}),O.addProperty("any",function(){j(this,"any",!0),j(this,"all",!1)}),O.addProperty("all",function(){j(this,"all",!0),j(this,"any",!1)}),O.addChainableMethod("an",n),O.addChainableMethod("a",n),O.addChainableMethod("include",o,i),O.addChainableMethod("contain",o,i),O.addChainableMethod("contains",o,i),O.addChainableMethod("includes",o,i),O.addProperty("ok",function(){this.assert(j(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),O.addProperty("true",function(){this.assert(!0===j(this,"object"),"expected #{this} to be true","expected #{this} to be false",!this.negate)}),O.addProperty("false",function(){this.assert(!1===j(this,"object"),"expected #{this} to be false","expected #{this} to be true",!!this.negate)}),O.addProperty("null",function(){this.assert(null===j(this,"object"),"expected #{this} to be null","expected #{this} not to be null")}),O.addProperty("undefined",function(){this.assert(void 0===j(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")}),O.addProperty("NaN",function(){this.assert(isNaN(j(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")}),O.addProperty("exist",function(){this.assert(null!=j(this,"object"),"expected #{this} to exist","expected #{this} to not exist")}),O.addProperty("empty",function(){var e=j(this,"object"),t=e;Array.isArray(e)||"string"==typeof object?t=e.length:"object"==typeof e&&(t=Object.keys(e).length),this.assert(!t,"expected #{this} to be empty","expected #{this} not to be empty")}),O.addProperty("arguments",r),O.addProperty("Arguments",r),O.addMethod("equal",s),O.addMethod("equals",s),O.addMethod("eq",s),O.addMethod("eql",a),O.addMethod("eqls",a),O.addMethod("above",p),O.addMethod("gt",p),O.addMethod("greaterThan",p),O.addMethod("least",c),O.addMethod("gte",c),O.addMethod("below",l),O.addMethod("lt",l),O.addMethod("lessThan",l),O.addMethod("most",u),O.addMethod("lte",u),O.addMethod("within",function(e,t,n){n&&j(this,"message",n);var i=j(this,"object"),o=e+".."+t;if(j(this,"doLength")){new O(i,n).to.have.property("length");var r=i.length;this.assert(r>=e&&r<=t,"expected #{this} to have a length within "+o,"expected #{this} to not have a length within "+o)}else this.assert(i>=e&&i<=t,"expected #{this} to be within "+o,"expected #{this} to not be within "+o)}),O.addMethod("instanceof",d),O.addMethod("instanceOf",d),O.addMethod("property",function(e,n,i){i&&j(this,"message",i);var o=!!j(this,"deep"),r=o?"deep property ":"property ",s=j(this,"negate"),a=j(this,"object"),p=o?t.getPathInfo(e,a):null,c=o?p.exists:t.hasProperty(e,a),l=o?p.value:a[e];if(s&&arguments.length>1){if(void 0===l)throw i=null!=i?i+": ":"",new Error(i+t.inspect(a)+" has no "+r+t.inspect(e))}else this.assert(c,"expected #{this} to have a "+r+t.inspect(e),"expected #{this} to not have "+r+t.inspect(e));arguments.length>1&&this.assert(n===l,"expected #{this} to have a "+r+t.inspect(e)+" of #{exp}, but got #{act}","expected #{this} to not have a "+r+t.inspect(e)+" of #{act}",n,l),j(this,"object",l)}),O.addMethod("ownProperty",f),O.addMethod("haveOwnProperty",f),O.addMethod("ownPropertyDescriptor",y),O.addMethod("haveOwnPropertyDescriptor",y),O.addChainableMethod("length",m,h),O.addMethod("lengthOf",m),O.addMethod("match",v),O.addMethod("matches",v),O.addMethod("string",function(e,n){n&&j(this,"message",n);var i=j(this,"object");new O(i,n).is.a("string"),this.assert(~i.indexOf(e),"expected #{this} to contain "+t.inspect(e),"expected #{this} to not contain "+t.inspect(e))}),O.addMethod("keys",g),O.addMethod("key",g),O.addMethod("throw",A),O.addMethod("throws",A),O.addMethod("Throw",A),O.addMethod("respondTo",b),O.addMethod("respondsTo",b),O.addProperty("itself",function(){j(this,"itself",!0)}),O.addMethod("satisfy",C),O.addMethod("satisfies",C),O.addMethod("closeTo",w),O.addMethod("approximately",w),O.addMethod("members",function(e,n){n&&j(this,"message",n);var i=j(this,"object");new O(i).to.be.an("array"),new O(e).to.be.an("array");var o=j(this,"deep")?t.eql:void 0;return j(this,"contains")?this.assert(R(e,i,o),"expected #{this} to be a superset of #{act}","expected #{this} to not be a superset of #{act}",i,e):void this.assert(R(i,e,o)&&R(e,i,o),"expected #{this} to have the same members as #{act}","expected #{this} to not have the same members as #{act}",i,e)}),O.addMethod("oneOf",P),O.addChainableMethod("change",T),O.addChainableMethod("changes",T),O.addChainableMethod("increase",S),O.addChainableMethod("increases",S),O.addChainableMethod("decrease",I),O.addChainableMethod("decreases",I),O.addProperty("extensible",function(){var e,t=j(this,"object");try{e=Object.isExtensible(t)}catch(t){if(!(t instanceof TypeError))throw t;e=!1}this.assert(e,"expected #{this} to be extensible","expected #{this} to not be extensible")}),O.addProperty("sealed",function(){var e,t=j(this,"object");try{e=Object.isSealed(t)}catch(t){if(!(t instanceof TypeError))throw t;e=!0}this.assert(e,"expected #{this} to be sealed","expected #{this} to not be sealed")}),O.addProperty("frozen",function(){var e,t=j(this,"object");try{e=Object.isFrozen(t)}catch(t){if(!(t instanceof TypeError))throw t;e=!0}this.assert(e,"expected #{this} to be frozen","expected #{this} to not be frozen")})}},{}],16:[function(e,t,n){t.exports=function(e,t){var n=e.Assertion,i=t.flag,o=e.assert=function(t,i){var o=new n(null,null,e.assert);o.assert(t,i,"[ negation message unavailable ]")};o.fail=function(t,n,i,r){throw i=i||"assert.fail()",new e.AssertionError(i,{actual:t,expected:n,operator:r},o.fail)},o.isOk=function(e,t){new n(e,t).is.ok},o.isNotOk=function(e,t){new n(e,t).is.not.ok},o.equal=function(e,t,r){var s=new n(e,r,o.equal);s.assert(t==i(s,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e)},o.notEqual=function(e,t,r){var s=new n(e,r,o.notEqual);s.assert(t!=i(s,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e)},o.strictEqual=function(e,t,i){new n(e,i).to.equal(t)},o.notStrictEqual=function(e,t,i){new n(e,i).to.not.equal(t)},o.deepEqual=function(e,t,i){new n(e,i).to.eql(t)},o.notDeepEqual=function(e,t,i){new n(e,i).to.not.eql(t)},o.isAbove=function(e,t,i){new n(e,i).to.be.above(t)},o.isAtLeast=function(e,t,i){new n(e,i).to.be.least(t)},o.isBelow=function(e,t,i){new n(e,i).to.be.below(t)},o.isAtMost=function(e,t,i){new n(e,i).to.be.most(t)},o.isTrue=function(e,t){new n(e,t).is.true},o.isNotTrue=function(e,t){new n(e,t).to.not.equal(!0)},o.isFalse=function(e,t){new n(e,t).is.false},o.isNotFalse=function(e,t){new n(e,t).to.not.equal(!1)},o.isNull=function(e,t){new n(e,t).to.equal(null)},o.isNotNull=function(e,t){new n(e,t).to.not.equal(null)},o.isNaN=function(e,t){new n(e,t).to.be.NaN},o.isNotNaN=function(e,t){new n(e,t).not.to.be.NaN},o.isUndefined=function(e,t){new n(e,t).to.equal(void 0)},o.isDefined=function(e,t){new n(e,t).to.not.equal(void 0)},o.isFunction=function(e,t){new n(e,t).to.be.a("function")},o.isNotFunction=function(e,t){new n(e,t).to.not.be.a("function")},o.isObject=function(e,t){new n(e,t).to.be.a("object")},o.isNotObject=function(e,t){new n(e,t).to.not.be.a("object")},o.isArray=function(e,t){new n(e,t).to.be.an("array")},o.isNotArray=function(e,t){new n(e,t).to.not.be.an("array")},o.isString=function(e,t){new n(e,t).to.be.a("string")},o.isNotString=function(e,t){new n(e,t).to.not.be.a("string")},o.isNumber=function(e,t){new n(e,t).to.be.a("number")},o.isNotNumber=function(e,t){new n(e,t).to.not.be.a("number")},o.isBoolean=function(e,t){new n(e,t).to.be.a("boolean")},o.isNotBoolean=function(e,t){new n(e,t).to.not.be.a("boolean")},o.typeOf=function(e,t,i){new n(e,i).to.be.a(t)},o.notTypeOf=function(e,t,i){new n(e,i).to.not.be.a(t)},o.instanceOf=function(e,t,i){new n(e,i).to.be.instanceOf(t)},o.notInstanceOf=function(e,t,i){new n(e,i).to.not.be.instanceOf(t)},o.include=function(e,t,i){new n(e,i,o.include).include(t)},o.notInclude=function(e,t,i){new n(e,i,o.notInclude).not.include(t)},o.match=function(e,t,i){new n(e,i).to.match(t)},o.notMatch=function(e,t,i){new n(e,i).to.not.match(t)},o.property=function(e,t,i){new n(e,i).to.have.property(t)},o.notProperty=function(e,t,i){new n(e,i).to.not.have.property(t)},o.deepProperty=function(e,t,i){new n(e,i).to.have.deep.property(t)},o.notDeepProperty=function(e,t,i){new n(e,i).to.not.have.deep.property(t)},o.propertyVal=function(e,t,i,o){new n(e,o).to.have.property(t,i)},o.propertyNotVal=function(e,t,i,o){new n(e,o).to.not.have.property(t,i)},o.deepPropertyVal=function(e,t,i,o){new n(e,o).to.have.deep.property(t,i)},o.deepPropertyNotVal=function(e,t,i,o){new n(e,o).to.not.have.deep.property(t,i)},o.lengthOf=function(e,t,i){new n(e,i).to.have.length(t)},o.throws=function(e,t,o,r){("string"==typeof t||t instanceof RegExp)&&(o=t,t=null);var s=new n(e,r).to.throw(t,o);return i(s,"object")},o.doesNotThrow=function(e,t,i){"string"==typeof t&&(i=t,t=null),new n(e,i).to.not.Throw(t)},o.operator=function(e,o,r,s){var a;switch(o){case"==":a=e==r;break;case"===":a=e===r;break;case">":a=e>r;break;case">=":a=e>=r;break;case"<":a=e1&&n===t.length-1?"or ":"";return o+i+" "+e}).join(", ");if(!t.some(function(t){return r(e)===t}))throw new i("object tested must be "+n+", but "+r(e)+" given")}},{"./flag":23,"assertion-error":3,"type-detect":128}],23:[function(e,t,n){t.exports=function(e,t,n){var i=e.__flags||(e.__flags=Object.create(null));return 3!==arguments.length?i[t]:void(i[t]=n)}},{}],24:[function(e,t,n){t.exports=function(e,t){return t.length>4?t[4]:e._obj}},{}],25:[function(e,t,n){t.exports=function(e){var t=[];for(var n in e)t.push(n);return t}},{}],26:[function(e,t,n){var i=e("./flag"),o=e("./getActual"),r=(e("./inspect"),e("./objDisplay"));t.exports=function(e,t){var n=i(e,"negate"),s=i(e,"object"),a=t[3],p=o(e,t),c=n?t[2]:t[1],l=i(e,"message");return"function"==typeof c&&(c=c()),c=c||"",c=c.replace(/#\{this\}/g,function(){return r(s)}).replace(/#\{act\}/g,function(){return r(p)}).replace(/#\{exp\}/g,function(){return r(a)}),l?l+": "+c:c}},{"./flag":23,"./getActual":24,"./inspect":33,"./objDisplay":34}],27:[function(e,t,n){t.exports=function(e){if(e.name)return e.name;var t=/^\s?function ([^(]*)\(/.exec(e);return t&&t[1]?t[1]:""}},{}],28:[function(e,t,n){function i(e){var t=e.replace(/([^\\])\[/g,"$1.["),n=t.match(/(\\\.|[^.]+?)+/g);return n.map(function(e){var t=/^\[(\d+)\]$/,n=t.exec(e);return n?{i:parseFloat(n[1])}:{p:e.replace(/\\([.\[\]])/g,"$1")}})}function o(e,t,n){var i,o=t;n=void 0===n?e.length:n;for(var r=0,s=n;r1?o(n,t,n.length-1):t,name:s.p||s.i,value:o(n,t)};return a.exists=r(a.name,a.parent),a}},{"./hasProperty":31}],29:[function(e,t,n){var i=e("./getPathInfo");t.exports=function(e,t){var n=i(e,t);return n.value}},{"./getPathInfo":28}],30:[function(e,t,n){t.exports=function(e){function t(e){n.indexOf(e)===-1&&n.push(e)}for(var n=Object.getOwnPropertyNames(e),i=Object.getPrototypeOf(e);null!==i;)Object.getOwnPropertyNames(i).forEach(t),i=Object.getPrototypeOf(i);return n}},{}],31:[function(e,t,n){var i=e("type-detect"),o={number:Number,string:String};t.exports=function(e,t){var n=i(t);return"null"!==n&&"undefined"!==n&&(o[n]&&"object"!=typeof t&&(t=new o[n](t)),e in t)}},{"type-detect":128}],32:[function(e,t,n){var n=t.exports={};n.test=e("./test"),n.type=e("type-detect"),n.expectTypes=e("./expectTypes"),n.getMessage=e("./getMessage"),n.getActual=e("./getActual"),n.inspect=e("./inspect"),n.objDisplay=e("./objDisplay"),n.flag=e("./flag"),n.transferFlags=e("./transferFlags"),n.eql=e("deep-eql"),n.getPathValue=e("./getPathValue"),n.getPathInfo=e("./getPathInfo"),n.hasProperty=e("./hasProperty"),n.getName=e("./getName"),n.addProperty=e("./addProperty"),n.addMethod=e("./addMethod"),n.overwriteProperty=e("./overwriteProperty"),n.overwriteMethod=e("./overwriteMethod"),n.addChainableMethod=e("./addChainableMethod"),n.overwriteChainableMethod=e("./overwriteChainableMethod")},{"./addChainableMethod":19,"./addMethod":20,"./addProperty":21,"./expectTypes":22,"./flag":23,"./getActual":24,"./getMessage":26,"./getName":27,"./getPathInfo":28,"./getPathValue":29,"./hasProperty":31,"./inspect":33,"./objDisplay":34,"./overwriteChainableMethod":35,"./overwriteMethod":36,"./overwriteProperty":37,"./test":38,"./transferFlags":39,"deep-eql":45,"type-detect":128}],33:[function(e,t,n){function i(e,t,n,i){var r={showHidden:t,seen:[],stylize:function(e){return e}};return o(r,e,"undefined"==typeof n?2:n)}function o(e,t,i){if(t&&"function"==typeof t.inspect&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var y=t.inspect(i);return"string"!=typeof y&&(y=o(e,y,i)),y}var A=r(e,t);if(A)return A;if(g(t)){if("outerHTML"in t)return t.outerHTML;try{if(document.xmlVersion){var b=new XMLSerializer;return b.serializeToString(t)}var C="http://www.w3.org/1999/xhtml",w=document.createElementNS(C,"_");return w.appendChild(t.cloneNode(!1)),html=w.innerHTML.replace("><",">"+t.innerHTML+"<"),w.innerHTML="",html}catch(e){}}var R=v(t),P=e.showHidden?m(t):R;if(0===P.length||f(t)&&(1===P.length&&"stack"===P[0]||2===P.length&&"description"===P[0]&&"stack"===P[1])){if("function"==typeof t){var T=h(t),S=T?": "+T:"";return e.stylize("[Function"+S+"]","special")}if(u(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(d(t))return e.stylize(Date.prototype.toUTCString.call(t),"date");if(f(t))return s(t)}var I="",O=!1,j=["{","}"];if(l(t)&&(O=!0,j=["[","]"]),"function"==typeof t){var T=h(t),S=T?": "+T:"";I=" [Function"+S+"]"}if(u(t)&&(I=" "+RegExp.prototype.toString.call(t)),d(t)&&(I=" "+Date.prototype.toUTCString.call(t)),f(t))return s(t);if(0===P.length&&(!O||0==t.length))return j[0]+I+j[1];if(i<0)return u(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var E;return E=O?a(e,t,i,R,P):P.map(function(n){return p(e,t,i,R,n,O)}),e.seen.pop(),c(E,I,j)}function r(e,t){switch(typeof t){case"undefined":return e.stylize("undefined","undefined");case"string":var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string");case"number":return 0===t&&1/t===-(1/0)?e.stylize("-0","number"):e.stylize(""+t,"number");case"boolean":return e.stylize(""+t,"boolean")}if(null===t)return e.stylize("null","null")}function s(e){return"["+Error.prototype.toString.call(e)+"]"}function a(e,t,n,i,o){for(var r=[],s=0,a=t.length;s-1&&(p=s?p.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+p.split("\n").map(function(e){return" "+e}).join("\n"))):p=e.stylize("[Circular]","special")),"undefined"==typeof a){if(s&&r.match(/^\d+$/))return p;a=JSON.stringify(""+r),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+p}function c(e,t,n){var i=0,o=e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.length+1},0);return o>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function l(e){return Array.isArray(e)||"object"==typeof e&&"[object Array]"===y(e)}function u(e){return"object"==typeof e&&"[object RegExp]"===y(e)}function d(e){return"object"==typeof e&&"[object Date]"===y(e)}function f(e){return"object"==typeof e&&"[object Error]"===y(e)}function y(e){return Object.prototype.toString.call(e)}var h=e("./getName"),m=e("./getProperties"),v=e("./getEnumerableProperties");t.exports=i;var g=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}},{"./getEnumerableProperties":25,"./getName":27,"./getProperties":30}],34:[function(e,t,n){var i=e("./inspect"),o=e("../config");t.exports=function(e){var t=i(e),n=Object.prototype.toString.call(e);if(o.truncateThreshold&&t.length>=o.truncateThreshold){if("[object Function]"===n)return e.name&&""!==e.name?"[Function: "+e.name+"]":"[Function]";if("[object Array]"===n)return"[ Array("+e.length+") ]";if("[object Object]"===n){var r=Object.keys(e),s=r.length>2?r.splice(0,2).join(", ")+", ...":r.join(", ");return"{ Object ("+s+") }"}return t}return t}},{"../config":14,"./inspect":33}],35:[function(e,t,n){t.exports=function(e,t,n,i){var o=e.__methods[t],r=o.chainingBehavior;o.chainingBehavior=function(){var e=i(r).call(this);return void 0===e?this:e};var s=o.method;o.method=function(){var e=n(s).apply(this,arguments);return void 0===e?this:e}}},{}],36:[function(e,t,n){t.exports=function(e,t,n){var i=e[t],o=function(){return this};i&&"function"==typeof i&&(o=i),e[t]=function(){var e=n(o).apply(this,arguments);return void 0===e?this:e}}},{}],37:[function(e,t,n){t.exports=function(e,t,n){var i=Object.getOwnPropertyDescriptor(e,t),o=function(){};i&&"function"==typeof i.get&&(o=i.get),Object.defineProperty(e,t,{get:function(){var e=n(o).call(this);return void 0===e?this:e},configurable:!0})}},{}],38:[function(e,t,n){var i=e("./flag");t.exports=function(e,t){var n=i(e,"negate"),o=t[0];return n?!o:o}},{"./flag":23}],39:[function(e,t,n){t.exports=function(e,t,n){var i=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),n=3!==arguments.length||n;for(var o in i)(n||"object"!==o&&"ssfi"!==o&&"message"!=o)&&(t.__flags[o]=i[o])}},{}],40:[function(e,t,n){function i(e){if(e)return o(e)}function o(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}"undefined"!=typeof t&&(t.exports=i),i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},i.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i,o=0;o=31}function o(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var o=0,r=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(r=o))}),e.splice(r,0,i),e}function r(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(e){}}function a(){var e;try{e=n.storage.debug}catch(e){}return e}function p(){try{return window.localStorage}catch(e){}}n=t.exports=e("./debug"),n.log=r,n.formatArgs=o,n.save=s,n.load=a,n.useColors=i,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:p(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(a())},{"./debug":44}],44:[function(e,t,n){function i(){return n.colors[l++%n.colors.length]}function o(e){function t(){}function o(){var e=o,t=+new Date,r=t-(c||t);e.diff=r,e.prev=c,e.curr=t,c=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=i());var s=Array.prototype.slice.call(arguments);s[0]=n.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(t,i){if("%%"===t)return t;a++;var o=n.formatters[i];if("function"==typeof o){var r=s[a];t=o.call(e,r),s.splice(a,1),a--}return t}),"function"==typeof n.formatArgs&&(s=n.formatArgs.apply(e,s));var p=o.log||n.log||console.log.bind(console);p.apply(e,s)}t.enabled=!1,o.enabled=!0;var r=n.enabled(e)?o:t;return r.namespace=e,r}function r(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),i=t.length,o=0;o=0;o--)if(a=r[o],!i(e[a],t[a],n))return!1;return!0}var y,h=e("type-detect");try{y=e("buffer").Buffer}catch(e){y={},y.isBuffer=function(){return!1}}t.exports=i},{buffer:8,"type-detect":47}],47:[function(e,t,n){t.exports=e("./lib/type")},{"./lib/type":48}],48:[function(e,t,n){function i(e){var t=Object.prototype.toString.call(e);return r[t]?r[t]:null===e?"null":void 0===e?"undefined":e===Object(e)?"object":typeof e}function o(){this.tests={}}var n=t.exports=i,r={"[object Array]":"array","[object RegExp]":"regexp","[object Function]":"function","[object Arguments]":"arguments","[object Date]":"date"};n.Library=o,o.prototype.of=i,o.prototype.define=function(e,t){return 1===arguments.length?this.tests[e]:(this.tests[e]=t,this)},o.prototype.test=function(e,t){if(t===i(e))return!0;var n=this.tests[t];if(n&&"regexp"===i(n))return n.test(e);if(n&&"function"===i(n))return n(e);throw new ReferenceError('Type test "'+t+'" not defined or invalid.')}},{}],49:[function(e,t,n){function i(e){return null===e||void 0===e}function o(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}function r(e,t,n){var r,l;if(i(e)||i(t))return!1;if(e.prototype!==t.prototype)return!1;if(p(e))return!!p(t)&&(e=s.call(e),t=s.call(t),c(e,t,n));if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(r=0;r=0;r--)if(u[r]!=d[r])return!1;for(r=u.length-1;r>=0;r--)if(l=u[r],!c(e[l],t[l],n))return!1;return typeof e==typeof t}var s=Array.prototype.slice,a=e("./lib/keys.js"),p=e("./lib/is_arguments.js"),c=t.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:r(e,t,n))}},{"./lib/is_arguments.js":50,"./lib/keys.js":51}],50:[function(e,t,n){function i(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var r="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();n=t.exports=r?i:o,n.supported=i,n.unsupported=o},{}],51:[function(e,t,n){function i(e){var t=[];for(var n in e)t.push(n);return t}n=t.exports="function"==typeof Object.keys?Object.keys:i,n.shim=i},{}],52:[function(e,t,n){"use strict";t.exports=e("./is-implemented")()?Object.assign:e("./shim")},{"./is-implemented":53,"./shim":54}],53:[function(e,t,n){"use strict";t.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(e={foo:"raz"},t(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},{}],54:[function(e,t,n){"use strict";var i=e("../keys"),o=e("../valid-value"),r=Math.max;t.exports=function(e,t){var n,s,a,p=r(arguments.length,2);for(e=Object(o(e)),a=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},s=1;s-1}},{}],65:[function(e,t,n){"use strict";var i,o,r,s,a,p,c,l=e("d"),u=e("es5-ext/object/valid-callable"),d=Function.prototype.apply,f=Function.prototype.call,y=Object.create,h=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};i=function(e,t){var n;return u(t),v.call(this,"__ee__")?n=this.__ee__:(n=g.value=y(null),h(this,"__ee__",g),g.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},o=function(e,t){var n,o;return u(t),o=this,i.call(this,e,n=function(){r.call(o,e,n),d.call(t,this,arguments)}),n.__eeOnceListener__=t,this},r=function(e,t){var n,i,o,r;if(u(t),!v.call(this,"__ee__"))return this;if(n=this.__ee__,!n[e])return this;if(i=n[e],"object"==typeof i)for(r=0;o=i[r];++r)o!==t&&o.__eeOnceListener__!==t||(2===i.length?n[e]=i[r?0:1]:i.splice(r,1));else i!==t&&i.__eeOnceListener__!==t||delete n[e];return this},s=function(e){var t,n,i,o,r;if(v.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,r=new Array(n-1),t=1;t0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!o(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},i.prototype.removeListener=function(e,t){var n,i,r,a;if(!o(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],r=n.length,i=-1,n===t||o(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(a=r;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],o(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?o(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(o(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],67:[function(e,t,n){var i=e("http"),o=t.exports;for(var r in i)i.hasOwnProperty(r)&&(o[r]=i[r]);o.request=function(e,t){return e||(e={}),e.scheme="https",e.protocol="https:",i.request.call(this,e,t)}},{http:113}],68:[function(e,t,n){n.read=function(e,t,n,i,o){var r,s,a=8*o-i-1,p=(1<>1,l=-7,u=n?o-1:0,d=n?-1:1,f=e[t+u];for(u+=d,r=f&(1<<-l)-1,f>>=-l,l+=a;l>0;r=256*r+e[t+u],u+=d,l-=8);for(s=r&(1<<-l)-1,r>>=-l,l+=i;l>0;s=256*s+e[t+u],u+=d,l-=8);if(0===r)r=1-c;else{if(r===p)return s?NaN:(f?-1:1)*(1/0);s+=Math.pow(2,i),r-=c}return(f?-1:1)*s*Math.pow(2,r-i)},n.write=function(e,t,n,i,o,r){var s,a,p,c=8*r-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:r-1,y=i?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-s))<1&&(s--,p*=2),t+=s+u>=1?d/p:d*Math.pow(2,1-u),t*p>=2&&(s++,p/=2),s+u>=l?(a=0,s=l):s+u>=1?(a=(t*p-1)*Math.pow(2,o),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;e[n+f]=255&a,f+=y,a/=256,o-=8);for(s=s<0;e[n+f]=255&s,f+=y,s/=256,c-=8);e[n+f-y]|=128*h}},{}],69:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],70:[function(e,t,n){t.exports=function(e){return!(null==e||!(e._isBuffer||e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)))}},{}],71:[function(e,t,n){function i(e,t,n,i){return JSON.stringify(e,o(t,i),n)}function o(e,t){var n=[],i=[];return null==t&&(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,r){if(n.length>0){var s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?i.splice(s,1/0,o):i.push(o),~n.indexOf(r)&&(r=t.call(this,o,r))}else n.push(r);return null==e?r:e.call(this,o,r)}}n=t.exports=i,n.getSerialize=o},{}],72:[function(t,n,i){(function(t){(function(){function o(e,t){return e.set(t[0],t[1]),e}function r(e,t){return e.add(t),e}function s(e,t,n){var i=n.length;switch(i){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function a(e,t,n,i){for(var o=-1,r=e?e.length:0;++o-1}function f(e,t,n){for(var i=-1,o=e?e.length:0;++i-1;);return n}function _(e,t){for(var n=e.length;n--&&C(t,e[n],0)>-1;);return n}function M(e){return e&&e.Object===Object?e:null}function F(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&i++;return i}function N(e){return On[e]}function D(e){return jn[e]}function L(e){return"\\"+kn[e]}function q(e,t){return null==e?$:e[t]}function B(e,t,n){for(var i=e.length,o=t+(n?1:-1);n?o--:++o-1}function Yt(e,t){var n=this.__data__,i=yn(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}function Jt(e){var t=-1,n=e?e.length:0;for(this.clear();++t=t?e:t)),e}function On(e,t,n,i,o,r,s){var a;if(i&&(a=r?i(e,o,r,s):i(e)),a!==$)return a;if(!va(e))return e;var c=mu(e);if(c){if(a=Ho(e),!t)return no(e,a)}else{var l=Go(e),u=l==Me||l==Fe;if(vu(e))return zi(e,t);if(l==Le||l==je||u&&!r){if(U(e))return r?e:{};if(a=Ko(u?{}:e),!t)return oo(e,mn(a,e))}else{if(!In[l])return r?e:{};a=Wo(e,l,On,t)}}s||(s=new rn);var d=s.get(e);if(d)return d;if(s.set(e,a),!c)var f=n?xo(e):ip(e);return p(f||e,function(o,r){f&&(r=o,o=e[r]),fn(a,r,On(o,t,n,i,r,e,s))}),a}function jn(e){var t=ip(e),n=t.length;return function(i){if(null==i)return!n;for(var o=n;o--;){var r=t[o],s=e[r],a=i[r];if(a===$&&!(r in Object(i))||!s(a))return!1}return!0}}function En(e){return va(e)?Gc(e):{}}function kn(e,t,n){if("function"!=typeof e)throw new wc(ee);return Hc(function(){e.apply($,n)},t)}function Mn(e,t,n,i){var o=-1,r=d,s=!0,a=e.length,p=[],c=t.length;if(!a)return p;n&&(t=y(t,j(n))),i?(r=f,s=!1):t.length>=Z&&(r=k,s=!1,t=new tn(t));e:for(;++oo?0:o+n),i=i===$||i>o?o:qa(i),i<0&&(i+=o),i=n>i?0:Ba(i);n0&&n(a)?t>1?Gn(a,t-1,n,i,o):h(o,a):i||(o[o.length]=a)}return o}function Vn(e,t){return e&&Pl(e,t,ip)}function zn(e,t){return e&&Tl(e,t,ip)}function Hn(e,t){return u(t,function(t){return ya(e[t])})}function Kn(e,t){t=Zo(t,e)?[t]:Gi(t);for(var n=0,i=t.length;null!=e&&nt}function Jn(e,t){return null!=e&&(jc.call(e,t)||"object"==typeof e&&t in e&&null===Bo(e))}function Qn(e,t){return null!=e&&t in Object(e)}function $n(e,t,n){return e>=Zc(t,n)&&e=120&&l.length>=120)?new tn(s&&l):$}l=e[0];var u=-1,h=a[0];e:for(;++u-1;)a!==e&&zc.call(a,p,1),zc.call(e,p,1);return e}function Ci(e,t){for(var n=e?t.length:0,i=n-1;n--;){var o=t[n];if(n==i||o!==r){var r=o;if($o(o))zc.call(e,o,1);else if(Zo(o,e))delete e[lr(o)];else{var s=Gi(o),a=pr(e,s);null!=a&&delete a[lr(kr(s))]}}}return e}function wi(e,t){return e+Wc(tl()*(t-e+1))}function Ri(e,t,n,i){for(var o=-1,r=Xc(Kc((t-e)/(n||1)),0),s=Array(r);r--;)s[i?r:++o]=e,e+=n;return s}function Pi(e,t){var n="";if(!e||t<1||t>Re)return n;do t%2&&(n+=e),t=Wc(t/2),t&&(e+=e);while(t);return n}function Ti(e,t,n,i){t=Zo(t,e)?[t]:Gi(t);for(var o=-1,r=t.length,s=r-1,a=e;null!=a&&++oo?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var r=Array(o);++i>>1,s=e[r];null!==s&&!xa(s)&&(n?s<=t:s=Z){var c=t?null:Il(e);if(c)return H(c); -s=!1,o=k,p=new tn}else p=t?[]:a;e:for(;++i=i?e:Si(e,t,n)}function zi(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function Hi(e){var t=new e.constructor(e.byteLength);return new Lc(t).set(new Lc(e)),t}function Ki(e,t){var n=t?Hi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function Wi(e,t,n){var i=t?n(V(e),!0):V(e);return m(i,o,new e.constructor)}function Yi(e){var t=new e.constructor(e.source,Pt.exec(e));return t.lastIndex=e.lastIndex,t}function Ji(e,t,n){var i=t?n(H(e),!0):H(e);return m(i,r,new e.constructor)}function Qi(e){return bl?Object(bl.call(e)):{}}function $i(e,t){var n=t?Hi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Xi(e,t){if(e!==t){var n=e!==$,i=null===e,o=e===e,r=xa(e),s=t!==$,a=null===t,p=t===t,c=xa(t);if(!a&&!c&&!r&&e>t||r&&s&&p&&!a&&!c||i&&s&&p||!n&&p||!o)return 1;if(!i&&!r&&!c&&e=a)return p;var c=n[i];return p*("desc"==c?-1:1)}}return e.index-t.index}function eo(e,t,n,i){for(var o=-1,r=e.length,s=n.length,a=-1,p=t.length,c=Xc(r-s,0),l=Array(p+c),u=!i;++a1?n[o-1]:$,s=o>2?n[2]:$;for(r=e.length>3&&"function"==typeof r?(o--,r):$,s&&Xo(n[0],n[1],s)&&(r=o<3?$:r,o=1),t=Object(t);++i-1?t[r?r[s]:s]:$}}function mo(e){return Hs(function(t){t=Gn(t,1);var n=t.length,o=n,r=i.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new wc(ee);if(r&&!a&&"wrapper"==Mo(s))var a=new i([],(!0))}for(o=a?o:n;++o=Z)return a.plant(i).value();for(var o=0,r=n?t[o].apply(this,e):i;++o1&&g.reverse(),u&&pa))return!1;var c=r.get(e);if(c)return c==t;var l=-1,u=!0,d=o&fe?new tn:$;for(r.set(e,t);++l-1&&e%1==0&&e=this.__values__.length,t=e?$:this.__values__[this.__index__++];return{done:e,value:t}}function ds(){return this}function fs(e){for(var t,i=this;i instanceof n;){var o=dr(i);o.__index__=0,o.__values__=$,t?r.__wrapped__=o:t=o;var r=o;i=i.__wrapped__}return r.__wrapped__=e,t}function ys(){var e=this.__wrapped__;if(e instanceof M){var t=e;return this.__actions__.length&&(t=new M(this)),t=t.reverse(),t.__actions__.push({func:ps,args:[Lr],thisArg:$}),new i(t,this.__chain__)}return this.thru(Lr)}function hs(){return Di(this.__wrapped__,this.__actions__)}function ms(e,t,n){var i=mu(e)?l:Fn;return n&&Xo(e,t,n)&&(t=$),i(e,No(t,3))}function vs(e,t){var n=mu(e)?u:qn;return n(e,No(t,3))}function gs(e,t){return Gn(Ps(e,t),1)}function As(e,t){return Gn(Ps(e,t),we)}function bs(e,t,n){return n=n===$?1:qa(n),Gn(Ps(e,t),n)}function Cs(e,t){var n=mu(e)?p:wl;return n(e,No(t,3))}function ws(e,t){var n=mu(e)?c:Rl;return n(e,No(t,3))}function Rs(e,t,n,i){e=oa(e)?e:mp(e),n=n&&!i?qa(n):0;var o=e.length;return n<0&&(n=Xc(o+n,0)),ka(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&C(e,t,n)>-1}function Ps(e,t){var n=mu(e)?y:ci;return n(e,No(t,3))}function Ts(e,t,n,i){return null==e?[]:(mu(t)||(t=null==t?[]:[t]),n=i?$:n,mu(n)||(n=null==n?[]:[n]),hi(e,t,n))}function Ss(e,t,n){var i=mu(e)?m:P,o=arguments.length<3;return i(e,No(t,4),n,o,wl)}function Is(e,t,n){var i=mu(e)?v:P,o=arguments.length<3;return i(e,No(t,4),n,o,Rl)}function Os(e,t){var n=mu(e)?u:qn;return t=No(t,3),n(e,function(e,n,i){return!t(e,n,i)})}function js(e){var t=oa(e)?e:mp(e),n=t.length;return n>0?t[wi(0,n-1)]:$}function Es(e,t,n){var i=-1,o=Da(e),r=o.length,s=r-1;for(t=(n?Xo(e,t,n):t===$)?1:bn(qa(t),0,r);++i0&&(n=t.apply(this,arguments)),e<=1&&(t=$),n}}function Ls(e,t,n){t=n?$:t;var i=Oo(e,se,$,$,$,$,$,t);return i.placeholder=Ls.placeholder,i}function qs(e,t,n){t=n?$:t;var i=Oo(e,ae,$,$,$,$,$,t);return i.placeholder=qs.placeholder,i}function Bs(e,t,n){function i(t){var n=d,i=f;return d=f=$,g=t,h=e.apply(i,n)}function o(e){return g=e,m=Hc(a,t),A?i(e):h}function r(e){var n=e-v,i=e-g,o=t-n;return b?Zc(o,y-i):o}function s(e){var n=e-v,i=e-g;return v===$||n>=t||n<0||b&&i>=y}function a(){var e=Ms();return s(e)?p(e):void(m=Hc(a,r(e)))}function p(e){return m=$,C&&d?i(e):(d=f=$,h)}function c(){g=0,d=v=f=m=$}function l(){return m===$?h:p(Ms())}function u(){var e=Ms(),n=s(e);if(d=arguments,f=this,v=e,n){if(m===$)return o(v);if(b)return m=Hc(a,t),i(v)}return m===$&&(m=Hc(a,t)),h}var d,f,y,h,m,v,g=0,A=!1,b=!1,C=!0;if("function"!=typeof e)throw new wc(ee);return t=Ua(t)||0,va(n)&&(A=!!n.leading,b="maxWait"in n,y=b?Xc(Ua(n.maxWait)||0,t):y,C="trailing"in n?!!n.trailing:C),u.cancel=c,u.flush=l,u}function Us(e){return Oo(e,de)}function Gs(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new wc(ee);var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=e.apply(this,i);return n.cache=r.set(o,s),s};return n.cache=new(Gs.Cache||Jt),n}function Vs(e){if("function"!=typeof e)throw new wc(ee);return function(){return!e.apply(this,arguments)}}function zs(e){return Ds(2,e)}function Hs(e,t){if("function"!=typeof e)throw new wc(ee);return t=Xc(t===$?e.length-1:qa(t),0),function(){for(var n=arguments,i=-1,o=Xc(n.length-t,0),r=Array(o);++i-1&&e%1==0&&e<=Re}function va(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ga(e){return!!e&&"object"==typeof e}function Aa(e){return ga(e)&&Go(e)==Ne}function ba(e,t){return e===t||ii(e,t,Lo(t))}function Ca(e,t,n){return n="function"==typeof n?n:$,ii(e,t,Lo(t),n)}function wa(e){return Sa(e)&&e!=+e}function Ra(e){if(kl(e))throw new Ac("This method is not supported with `core-js`. Try https://github.com/es-shims.");return oi(e)}function Pa(e){return null===e}function Ta(e){return null==e}function Sa(e){return"number"==typeof e||ga(e)&&xc.call(e)==De}function Ia(e){if(!ga(e)||xc.call(e)!=Le||U(e))return!1;var t=Bo(e);if(null===t)return!0;var n=jc.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Oc.call(n)==kc}function Oa(e){return va(e)&&xc.call(e)==Be}function ja(e){return ha(e)&&e>=-Re&&e<=Re}function Ea(e){return ga(e)&&Go(e)==Ue}function ka(e){return"string"==typeof e||!mu(e)&&ga(e)&&xc.call(e)==Ge}function xa(e){return"symbol"==typeof e||ga(e)&&xc.call(e)==Ve}function _a(e){return ga(e)&&ma(e.length)&&!!Sn[xc.call(e)]}function Ma(e){return e===$}function Fa(e){return ga(e)&&Go(e)==ze}function Na(e){return ga(e)&&xc.call(e)==He}function Da(e){if(!e)return[];if(oa(e))return ka(e)?Y(e):no(e);if(Uc&&e[Uc])return G(e[Uc]());var t=Go(e),n=t==Ne?V:t==Ue?H:mp;return n(e)}function La(e){if(!e)return 0===e?e:0;if(e=Ua(e),e===we||e===-we){var t=e<0?-1:1;return t*Pe}return e===e?e:0}function qa(e){var t=La(e),n=t%1;return t===t?n?t-n:t:0}function Ba(e){return e?bn(qa(e),0,Se):0}function Ua(e){if("number"==typeof e)return e;if(xa(e))return Te;if(va(e)){var t=ya(e.valueOf)?e.valueOf():e;e=va(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(gt,"");var n=It.test(e);return n||jt.test(e)?_n(e.slice(2),n?2:8):St.test(e)?Te:+e}function Ga(e){return io(e,op(e))}function Va(e){return bn(qa(e),-Re,Re)}function za(e){return null==e?"":xi(e)}function Ha(e,t){var n=En(e);return t?mn(n,t):n}function Ka(e,t){return A(e,No(t,3),Vn)}function Wa(e,t){return A(e,No(t,3),zn)}function Ya(e,t){return null==e?e:Pl(e,No(t,3),op)}function Ja(e,t){return null==e?e:Tl(e,No(t,3),op)}function Qa(e,t){return e&&Vn(e,No(t,3))}function $a(e,t){return e&&zn(e,No(t,3))}function Xa(e){return null==e?[]:Hn(e,ip(e))}function Za(e){return null==e?[]:Hn(e,op(e))}function ep(e,t,n){var i=null==e?$:Kn(e,t);return i===$?n:i}function tp(e,t){return null!=e&&zo(e,t,Jn)}function np(e,t){return null!=e&&zo(e,t,Qn)}function ip(e){var t=ir(e);if(!t&&!oa(e))return si(e);var n=Yo(e),i=!!n,o=n||[],r=o.length;for(var s in e)!Jn(e,s)||i&&("length"==s||$o(s,r))||t&&"constructor"==s||o.push(s);return o}function op(e){for(var t=-1,n=ir(e),i=ai(e),o=i.length,r=Yo(e),s=!!r,a=r||[],p=a.length;++tt){var i=e;e=t,t=i}if(n||e%1||t%1){var o=tl();return Zc(e+o*(t-e+xn("1e-"+((o+"").length-1))),t)}return wi(e,t)}function Cp(e){return Vu(za(e).toLowerCase())}function wp(e){return e=za(e),e&&e.replace(kt,N).replace(An,"")}function Rp(e,t,n){e=za(e),t=xi(t);var i=e.length;return n=n===$?i:bn(qa(n),0,i),n-=t.length,n>=0&&e.indexOf(t,n)==n}function Pp(e){return e=za(e),e&&ct.test(e)?e.replace(at,D):e}function Tp(e){return e=za(e),e&&vt.test(e)?e.replace(mt,"\\$&"):e}function Sp(e,t,n){e=za(e),t=qa(t);var i=t?W(e):0;if(!t||i>=t)return e;var o=(t-i)/2;return Co(Wc(o),n)+e+Co(Kc(o),n)}function Ip(e,t,n){e=za(e),t=qa(t);var i=t?W(e):0;return t&&i>>0)?(e=za(e),e&&("string"==typeof t||null!=t&&!Oa(t))&&(t=xi(t),""==t&&wn.test(e))?Vi(Y(e),0,n):ol.call(e,t,n)):[]}function _p(e,t,n){return e=za(e),n=bn(qa(n),0,e.length),e.lastIndexOf(xi(t),n)==n}function Mp(e,n,i){var o=t.templateSettings;i&&Xo(e,n,i)&&(n=$),e=za(e),n=wu({},n,o,un);var r,s,a=wu({},n.imports,o.imports,un),p=ip(a),c=E(a,p),l=0,u=n.interpolate||xt,d="__p += '",f=Cc((n.escape||xt).source+"|"+u.source+"|"+(u===dt?Rt:xt).source+"|"+(n.evaluate||xt).source+"|$","g"),y="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Tn+"]")+"\n";e.replace(f,function(t,n,i,o,a,p){return i||(i=o),d+=e.slice(l,p).replace(_t,L),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),l=p+t.length,t}),d+="';\n";var h=n.variable;h||(d="with (obj) {\n"+d+"\n}\n"),d=(s?d.replace(it,""):d).replace(ot,"$1").replace(rt,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=zu(function(){return Function(p,y+"return "+d).apply($,c)});if(m.source=d,da(m))throw m;return m}function Fp(e){return za(e).toLowerCase()}function Np(e){return za(e).toUpperCase()}function Dp(e,t,n){if(e=za(e),e&&(n||t===$))return e.replace(gt,"");if(!e||!(t=xi(t)))return e;var i=Y(e),o=Y(t),r=x(i,o),s=_(i,o)+1;return Vi(i,r,s).join("")}function Lp(e,t,n){if(e=za(e),e&&(n||t===$))return e.replace(bt,"");if(!e||!(t=xi(t)))return e;var i=Y(e),o=_(i,Y(t))+1;return Vi(i,0,o).join("")}function qp(e,t,n){if(e=za(e),e&&(n||t===$))return e.replace(At,"");if(!e||!(t=xi(t)))return e;var i=Y(e),o=x(i,Y(t));return Vi(i,o).join("")}function Bp(e,t){var n=he,i=me;if(va(t)){var o="separator"in t?t.separator:o;n="length"in t?qa(t.length):n,i="omission"in t?xi(t.omission):i}e=za(e);var r=e.length;if(wn.test(e)){var s=Y(e);r=s.length}if(n>=r)return e;var a=n-W(i);if(a<1)return i;var p=s?Vi(s,0,a).join(""):e.slice(0,a);if(o===$)return p+i;if(s&&(a+=p.length-a),Oa(o)){if(e.slice(a).search(o)){var c,l=p;for(o.global||(o=Cc(o.source,za(Pt.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var u=c.index;p=p.slice(0,u===$?a:u)}}else if(e.indexOf(xi(o),a)!=a){var d=p.lastIndexOf(o);d>-1&&(p=p.slice(0,d))}return p+i}function Up(e){return e=za(e),e&&pt.test(e)?e.replace(st,J):e}function Gp(e,t,n){return e=za(e),t=n?$:t,t===$&&(t=Rn.test(e)?Cn:Ct),e.match(t)||[]}function Vp(e){var t=e?e.length:0,n=No();return e=t?y(e,function(e){if("function"!=typeof e[1])throw new wc(ee);return[n(e[0]),e[1]]}):[],Hs(function(n){for(var i=-1;++iRe)return[];var n=Se,i=Zc(e,Se);t=No(t),e-=Se;for(var o=I(i,t);++n0){if(++e>=ve)return n}else e=0;return Sl(n,i)}}(),_l=Gs(function(e){var t=[];return za(e).replace(ht,function(e,n,i,o){t.push(i?o.replace(wt,"$1"):n||e)}),t}),Ml=Hs(function(e,t){return ra(e)?Mn(e,Gn(t,1,ra,!0)):[]}),Fl=Hs(function(e,t){var n=kr(t);return ra(n)&&(n=$),ra(e)?Mn(e,Gn(t,1,ra,!0),No(n)):[]}),Nl=Hs(function(e,t){var n=kr(t);return ra(n)&&(n=$),ra(e)?Mn(e,Gn(t,1,ra,!0),$,n):[]}),Dl=Hs(function(e){var t=y(e,Bi);return t.length&&t[0]===e[0]?Xn(t):[]}),Ll=Hs(function(e){var t=kr(e),n=y(e,Bi);return t===kr(n)?t=$:n.pop(),n.length&&n[0]===e[0]?Xn(n,No(t)):[]}),ql=Hs(function(e){var t=kr(e),n=y(e,Bi);return t===kr(n)?t=$:n.pop(),n.length&&n[0]===e[0]?Xn(n,$,t):[]}),Bl=Hs(Mr),Ul=Hs(function(e,t){t=Gn(t,1);var n=e?e.length:0,i=vn(e,t);return Ci(e,y(t,function(e){return $o(e,n)?+e:e}).sort(Xi)),i}),Gl=Hs(function(e){return _i(Gn(e,1,ra,!0))}),Vl=Hs(function(e){var t=kr(e);return ra(t)&&(t=$),_i(Gn(e,1,ra,!0),No(t))}),zl=Hs(function(e){var t=kr(e);return ra(t)&&(t=$),_i(Gn(e,1,ra,!0),$,t)}),Hl=Hs(function(e,t){return ra(e)?Mn(e,t):[]}),Kl=Hs(function(e){return Li(u(e,ra))}),Wl=Hs(function(e){var t=kr(e);return ra(t)&&(t=$),Li(u(e,ra),No(t))}),Yl=Hs(function(e){var t=kr(e);return ra(t)&&(t=$),Li(u(e,ra),$,t)}),Jl=Hs(ns),Ql=Hs(function(e){var t=e.length,n=t>1?e[t-1]:$;return n="function"==typeof n?(e.pop(),n):$,is(e,n)}),$l=Hs(function(e){e=Gn(e,1);var t=e.length,n=t?e[0]:0,o=this.__wrapped__,r=function(t){return vn(t,e)};return!(t>1||this.__actions__.length)&&o instanceof M&&$o(n)?(o=o.slice(n,+n+(t?1:0)),o.__actions__.push({func:ps,args:[r],thisArg:$}),new i(o,this.__chain__).thru(function(e){return t&&!e.length&&e.push($),e})):this.thru(r)}),Xl=ro(function(e,t,n){jc.call(e,n)?++e[n]:e[n]=1}),Zl=ho(Cr),eu=ho(wr),tu=ro(function(e,t,n){jc.call(e,n)?e[n].push(t):e[n]=[t]}),nu=Hs(function(e,t,n){var i=-1,o="function"==typeof t,r=Zo(t),a=oa(e)?Array(e.length):[];return wl(e,function(e){var p=o?t:r&&null!=e?e[t]:$;a[++i]=p?s(p,e,n):ei(e,t,n)}),a}),iu=ro(function(e,t,n){e[n]=t}),ou=ro(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ru=Hs(function(e,t){if(null==e)return[];var n=t.length;return n>1&&Xo(e,t[0],t[1])?t=[]:n>2&&Xo(t[0],t[1],t[2])&&(t=[t[0]]),t=1==t.length&&mu(t[0])?t[0]:Gn(t,1,Qo),hi(e,t,[])}),su=Hs(function(e,t,n){var i=ie;if(n.length){var o=z(n,Fo(su));i|=pe}return Oo(e,i,t,n,o)}),au=Hs(function(e,t,n){var i=ie|oe;if(n.length){var o=z(n,Fo(au));i|=pe}return Oo(t,i,e,n,o)}),pu=Hs(function(e,t){return kn(e,1,t)}),cu=Hs(function(e,t,n){return kn(e,Ua(t)||0,n)});Gs.Cache=Jt;var lu=Hs(function(e,t){t=1==t.length&&mu(t[0])?y(t[0],j(No())):y(Gn(t,1,Qo),j(No()));var n=t.length;return Hs(function(i){for(var o=-1,r=Zc(i.length,n);++o=t}),mu=Array.isArray,vu=Fc?function(e){return e instanceof Fc}:ic,gu=Po(pi),Au=Po(function(e,t){return e<=t}),bu=so(function(e,t){if(dl||ir(t)||oa(t))return void io(t,ip(t),e);for(var n in t)jc.call(t,n)&&fn(e,n,t[n])}),Cu=so(function(e,t){if(dl||ir(t)||oa(t))return void io(t,op(t),e);for(var n in t)fn(e,n,t[n])}),wu=so(function(e,t,n,i){io(t,op(t),e,i)}),Ru=so(function(e,t,n,i){io(t,ip(t),e,i)}),Pu=Hs(function(e,t){return vn(e,Gn(t,1))}),Tu=Hs(function(e){return e.push($,un),s(wu,$,e)}),Su=Hs(function(e){return e.push($,ar),s(ku,$,e)}),Iu=go(function(e,t,n){e[t]=n},Hp(Kp)),Ou=go(function(e,t,n){jc.call(e,t)?e[t].push(n):e[t]=[n]},No),ju=Hs(ei),Eu=so(function(e,t,n){di(e,t,n)}),ku=so(function(e,t,n,i){di(e,t,n,i)}),xu=Hs(function(e,t){return null==e?{}:(t=y(Gn(t,1),lr),mi(e,Mn(_o(e),t)))}),_u=Hs(function(e,t){return null==e?{}:mi(e,y(Gn(t,1),lr))}),Mu=Io(ip),Fu=Io(op),Nu=uo(function(e,t,n){return t=t.toLowerCase(),e+(n?Cp(t):t)}),Du=uo(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),Lu=uo(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),qu=lo("toLowerCase"),Bu=uo(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Uu=uo(function(e,t,n){return e+(n?" ":"")+Vu(t)}),Gu=uo(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Vu=lo("toUpperCase"),zu=Hs(function(e,t){try{return s(e,$,t)}catch(e){return da(e)?e:new Ac(e)}}),Hu=Hs(function(e,t){return p(Gn(t,1),function(t){t=lr(t),e[t]=su(e[t],e)}),e}),Ku=mo(),Wu=mo(!0),Yu=Hs(function(e,t){return function(n){return ei(n,e,t)}}),Ju=Hs(function(e,t){return function(n){return ei(e,n,t)}}),Qu=bo(y),$u=bo(l),Xu=bo(g),Zu=Ro(),ed=Ro(!0),td=Ao(function(e,t){return e+t}),nd=So("ceil"),id=Ao(function(e,t){return e/t}),od=So("floor"),rd=Ao(function(e,t){return e*t}),sd=So("round"),ad=Ao(function(e,t){return e-t});return t.after=Fs,t.ary=Ns,t.assign=bu,t.assignIn=Cu,t.assignInWith=wu,t.assignWith=Ru,t.at=Pu,t.before=Ds,t.bind=su,t.bindAll=Hu,t.bindKey=au,t.castArray=Qs,t.chain=ss,t.chunk=fr,t.compact=yr,t.concat=hr,t.cond=Vp,t.conforms=zp,t.constant=Hp,t.countBy=Xl,t.create=Ha,t.curry=Ls,t.curryRight=qs,t.debounce=Bs,t.defaults=Tu,t.defaultsDeep=Su,t.defer=pu,t.delay=cu,t.difference=Ml,t.differenceBy=Fl,t.differenceWith=Nl,t.drop=mr,t.dropRight=vr,t.dropRightWhile=gr,t.dropWhile=Ar,t.fill=br,t.filter=vs,t.flatMap=gs,t.flatMapDeep=As,t.flatMapDepth=bs,t.flatten=Rr,t.flattenDeep=Pr,t.flattenDepth=Tr,t.flip=Us,t.flow=Ku,t.flowRight=Wu,t.fromPairs=Sr,t.functions=Xa,t.functionsIn=Za,t.groupBy=tu,t.initial=jr,t.intersection=Dl,t.intersectionBy=Ll,t.intersectionWith=ql,t.invert=Iu,t.invertBy=Ou,t.invokeMap=nu,t.iteratee=Wp,t.keyBy=iu,t.keys=ip,t.keysIn=op,t.map=Ps,t.mapKeys=rp,t.mapValues=sp,t.matches=Yp,t.matchesProperty=Jp,t.memoize=Gs,t.merge=Eu,t.mergeWith=ku,t.method=Yu,t.methodOf=Ju,t.mixin=Qp,t.negate=Vs,t.nthArg=Zp,t.omit=xu,t.omitBy=ap,t.once=zs,t.orderBy=Ts,t.over=Qu,t.overArgs=lu,t.overEvery=$u,t.overSome=Xu,t.partial=uu,t.partialRight=du,t.partition=ou,t.pick=_u,t.pickBy=pp,t.property=ec,t.propertyOf=tc,t.pull=Bl,t.pullAll=Mr,t.pullAllBy=Fr,t.pullAllWith=Nr,t.pullAt=Ul,t.range=Zu,t.rangeRight=ed,t.rearg=fu,t.reject=Os,t.remove=Dr,t.rest=Hs,t.reverse=Lr,t.sampleSize=Es,t.set=lp,t.setWith=up,t.shuffle=ks,t.slice=qr,t.sortBy=ru,t.sortedUniq=Kr,t.sortedUniqBy=Wr,t.split=xp,t.spread=Ks,t.tail=Yr,t.take=Jr,t.takeRight=Qr,t.takeRightWhile=$r,t.takeWhile=Xr,t.tap=as,t.throttle=Ws,t.thru=ps,t.toArray=Da,t.toPairs=Mu,t.toPairsIn=Fu,t.toPath=pc,t.toPlainObject=Ga,t.transform=dp,t.unary=Ys,t.union=Gl,t.unionBy=Vl,t.unionWith=zl,t.uniq=Zr,t.uniqBy=es,t.uniqWith=ts,t.unset=fp,t.unzip=ns,t.unzipWith=is,t.update=yp,t.updateWith=hp,t.values=mp,t.valuesIn=vp,t.without=Hl,t.words=Gp,t.wrap=Js,t.xor=Kl,t.xorBy=Wl,t.xorWith=Yl,t.zip=Jl,t.zipObject=os,t.zipObjectDeep=rs,t.zipWith=Ql,t.entries=Mu,t.entriesIn=Fu,t.extend=Cu,t.extendWith=wu,Qp(t,t),t.add=td,t.attempt=zu,t.camelCase=Nu,t.capitalize=Cp,t.ceil=nd,t.clamp=gp,t.clone=$s,t.cloneDeep=Zs,t.cloneDeepWith=ea,t.cloneWith=Xs,t.deburr=wp,t.divide=id,t.endsWith=Rp,t.eq=ta,t.escape=Pp,t.escapeRegExp=Tp,t.every=ms,t.find=Zl,t.findIndex=Cr,t.findKey=Ka,t.findLast=eu,t.findLastIndex=wr,t.findLastKey=Wa,t.floor=od,t.forEach=Cs,t.forEachRight=ws,t.forIn=Ya,t.forInRight=Ja,t.forOwn=Qa,t.forOwnRight=$a,t.get=ep,t.gt=yu,t.gte=hu,t.has=tp,t.hasIn=np,t.head=Ir,t.identity=Kp,t.includes=Rs,t.indexOf=Or,t.inRange=Ap,t.invoke=ju,t.isArguments=na,t.isArray=mu,t.isArrayBuffer=ia,t.isArrayLike=oa,t.isArrayLikeObject=ra,t.isBoolean=sa,t.isBuffer=vu,t.isDate=aa,t.isElement=pa,t.isEmpty=ca,t.isEqual=la,t.isEqualWith=ua,t.isError=da,t.isFinite=fa,t.isFunction=ya,t.isInteger=ha,t.isLength=ma,t.isMap=Aa,t.isMatch=ba,t.isMatchWith=Ca,t.isNaN=wa,t.isNative=Ra,t.isNil=Ta,t.isNull=Pa,t.isNumber=Sa,t.isObject=va,t.isObjectLike=ga,t.isPlainObject=Ia,t.isRegExp=Oa,t.isSafeInteger=ja,t.isSet=Ea,t.isString=ka,t.isSymbol=xa,t.isTypedArray=_a,t.isUndefined=Ma,t.isWeakMap=Fa,t.isWeakSet=Na,t.join=Er,t.kebabCase=Du,t.last=kr,t.lastIndexOf=xr,t.lowerCase=Lu,t.lowerFirst=qu,t.lt=gu,t.lte=Au,t.max=lc,t.maxBy=uc,t.mean=dc,t.meanBy=fc,t.min=yc,t.minBy=hc,t.stubArray=nc,t.stubFalse=ic,t.stubObject=oc,t.stubString=rc,t.stubTrue=sc,t.multiply=rd,t.nth=_r,t.noConflict=$p,t.noop=Xp,t.now=Ms,t.pad=Sp,t.padEnd=Ip,t.padStart=Op,t.parseInt=jp,t.random=bp,t.reduce=Ss,t.reduceRight=Is,t.repeat=Ep,t.replace=kp,t.result=cp,t.round=sd,t.runInContext=Q,t.sample=js,t.size=xs,t.snakeCase=Bu,t.some=_s,t.sortedIndex=Br,t.sortedIndexBy=Ur,t.sortedIndexOf=Gr,t.sortedLastIndex=Vr,t.sortedLastIndexBy=zr,t.sortedLastIndexOf=Hr,t.startCase=Uu,t.startsWith=_p,t.subtract=ad,t.sum=mc,t.sumBy=vc,t.template=Mp,t.times=ac,t.toFinite=La,t.toInteger=qa,t.toLength=Ba,t.toLower=Fp,t.toNumber=Ua,t.toSafeInteger=Va,t.toString=za,t.toUpper=Np,t.trim=Dp,t.trimEnd=Lp,t.trimStart=qp,t.truncate=Bp,t.unescape=Up,t.uniqueId=cc,t.upperCase=Gu,t.upperFirst=Vu,t.each=Cs,t.eachRight=ws,t.first=Ir,Qp(t,function(){var e={};return Vn(t,function(n,i){jc.call(t.prototype,i)||(e[i]=n)}),e}(),{chain:!1}),t.VERSION=X,p(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){t[e].placeholder=t}),p(["drop","take"],function(e,t){M.prototype[e]=function(n){var i=this.__filtered__;if(i&&!t)return new M(this);n=n===$?1:Xc(qa(n),0);var o=this.clone();return i?o.__takeCount__=Zc(n,o.__takeCount__):o.__views__.push({size:Zc(n,Se),type:e+(o.__dir__<0?"Right":"")}),o},M.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),p(["filter","map","takeWhile"],function(e,t){var n=t+1,i=n==Ae||n==Ce;M.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:No(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}}),p(["head","last"],function(e,t){var n="take"+(t?"Right":"");M.prototype[e]=function(){return this[n](1).value()[0]}}),p(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");M.prototype[e]=function(){return this.__filtered__?new M(this):this[n](1)}}),M.prototype.compact=function(){return this.filter(Kp)},M.prototype.find=function(e){return this.filter(e).head()},M.prototype.findLast=function(e){return this.reverse().find(e)},M.prototype.invokeMap=Hs(function(e,t){return"function"==typeof e?new M(this):this.map(function(n){return ei(n,e,t)})}),M.prototype.reject=function(e){return e=No(e,3),this.filter(function(t){return!e(t)})},M.prototype.slice=function(e,t){e=qa(e);var n=this;return n.__filtered__&&(e>0||t<0)?new M(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==$&&(t=qa(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},M.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},M.prototype.toArray=function(){return this.take(Se)},Vn(M.prototype,function(e,n){var o=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),s=t[r?"take"+("last"==n?"Right":""):n],a=r||/^find/.test(n);s&&(t.prototype[n]=function(){var n=this.__wrapped__,p=r?[1]:arguments,c=n instanceof M,l=p[0],u=c||mu(n),d=function(e){var n=s.apply(t,h([e],p));return r&&f?n[0]:n};u&&o&&"function"==typeof l&&1!=l.length&&(c=u=!1);var f=this.__chain__,y=!!this.__actions__.length,m=a&&!f,v=c&&!y;if(!a&&u){n=v?n:new M(this);var g=e.apply(n,p);return g.__actions__.push({func:ps,args:[d],thisArg:$}),new i(g,f)}return m&&v?e.apply(this,p):(g=this.thru(d),m?r?g.value()[0]:g.value():g)})}),p(["pop","push","shift","sort","splice","unshift"],function(e){var n=Rc[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);t.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var t=this.value();return n.apply(mu(t)?t:[],e)}return this[i](function(t){return n.apply(mu(t)?t:[],e)})}}),Vn(M.prototype,function(e,n){var i=t[n];if(i){var o=i.name+"",r=fl[o]||(fl[o]=[]);r.push({name:n,func:i})}}),fl[vo($,oe).name]=[{name:"wrapper",func:$}],M.prototype.clone=Mt,M.prototype.reverse=Ft,M.prototype.value=Nt,t.prototype.at=$l,t.prototype.chain=cs,t.prototype.commit=ls,t.prototype.next=us,t.prototype.plant=fs,t.prototype.reverse=ys,t.prototype.toJSON=t.prototype.valueOf=t.prototype.value=hs,Uc&&(t.prototype[Uc]=ds),t}var $,X="4.13.1",Z=200,ee="Expected a function",te="__lodash_hash_undefined__",ne="__lodash_placeholder__",ie=1,oe=2,re=4,se=8,ae=16,pe=32,ce=64,le=128,ue=256,de=512,fe=1,ye=2,he=30,me="...",ve=150,ge=16,Ae=1,be=2,Ce=3,we=1/0,Re=9007199254740991,Pe=1.7976931348623157e308,Te=NaN,Se=4294967295,Ie=Se-1,Oe=Se>>>1,je="[object Arguments]",Ee="[object Array]",ke="[object Boolean]",xe="[object Date]",_e="[object Error]",Me="[object Function]",Fe="[object GeneratorFunction]",Ne="[object Map]",De="[object Number]",Le="[object Object]",qe="[object Promise]",Be="[object RegExp]",Ue="[object Set]",Ge="[object String]",Ve="[object Symbol]",ze="[object WeakMap]",He="[object WeakSet]",Ke="[object ArrayBuffer]",We="[object DataView]",Ye="[object Float32Array]",Je="[object Float64Array]",Qe="[object Int8Array]",$e="[object Int16Array]",Xe="[object Int32Array]",Ze="[object Uint8Array]",et="[object Uint8ClampedArray]",tt="[object Uint16Array]",nt="[object Uint32Array]",it=/\b__p \+= '';/g,ot=/\b(__p \+=) '' \+/g,rt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,st=/&(?:amp|lt|gt|quot|#39|#96);/g,at=/[&<>"'`]/g,pt=RegExp(st.source),ct=RegExp(at.source),lt=/<%-([\s\S]+?)%>/g,ut=/<%([\s\S]+?)%>/g,dt=/<%=([\s\S]+?)%>/g,ft=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yt=/^\w*$/,ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(\.|\[\])(?:\4|$))/g,mt=/[\\^$.*+?()[\]{}|]/g,vt=RegExp(mt.source),gt=/^\s+|\s+$/g,At=/^\s+/,bt=/\s+$/,Ct=/[a-zA-Z0-9]+/g,wt=/\\(\\)?/g,Rt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Pt=/\w*$/,Tt=/^0x/i,St=/^[-+]0x[0-9a-f]+$/i,It=/^0b[01]+$/i,Ot=/^\[object .+?Constructor\]$/,jt=/^0o[0-7]+$/i,Et=/^(?:0|[1-9]\d*)$/,kt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,xt=/($^)/,_t=/['\n\r\u2028\u2029\\]/g,Mt="\\ud800-\\udfff",Ft="\\u0300-\\u036f\\ufe20-\\ufe23",Nt="\\u20d0-\\u20f0",Dt="\\u2700-\\u27bf",Lt="a-z\\xdf-\\xf6\\xf8-\\xff",qt="\\xac\\xb1\\xd7\\xf7",Bt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ut="\\u2000-\\u206f",Gt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Vt="A-Z\\xc0-\\xd6\\xd8-\\xde",zt="\\ufe0e\\ufe0f",Ht=qt+Bt+Ut+Gt,Kt="['’]",Wt="["+Mt+"]",Yt="["+Ht+"]",Jt="["+Ft+Nt+"]",Qt="\\d+",$t="["+Dt+"]",Xt="["+Lt+"]",Zt="[^"+Mt+Ht+Qt+Dt+Lt+Vt+"]",en="\\ud83c[\\udffb-\\udfff]",tn="(?:"+Jt+"|"+en+")",nn="[^"+Mt+"]",on="(?:\\ud83c[\\udde6-\\uddff]){2}",rn="[\\ud800-\\udbff][\\udc00-\\udfff]",sn="["+Vt+"]",an="\\u200d",pn="(?:"+Xt+"|"+Zt+")",cn="(?:"+sn+"|"+Zt+")",ln="(?:"+Kt+"(?:d|ll|m|re|s|t|ve))?",un="(?:"+Kt+"(?:D|LL|M|RE|S|T|VE))?",dn=tn+"?",fn="["+zt+"]?",yn="(?:"+an+"(?:"+[nn,on,rn].join("|")+")"+fn+dn+")*",hn=fn+dn+yn,mn="(?:"+[$t,on,rn].join("|")+")"+hn,vn="(?:"+[nn+Jt+"?",Jt,on,rn,Wt].join("|")+")",gn=RegExp(Kt,"g"),An=RegExp(Jt,"g"),bn=RegExp(en+"(?="+en+")|"+vn+hn,"g"),Cn=RegExp([sn+"?"+Xt+"+"+ln+"(?="+[Yt,sn,"$"].join("|")+")",cn+"+"+un+"(?="+[Yt,sn+pn,"$"].join("|")+")",sn+"?"+pn+"+"+ln,sn+"+"+un,Qt,mn].join("|"),"g"),wn=RegExp("["+an+Mt+Ft+Nt+zt+"]"),Rn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Pn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","Reflect","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","isFinite","parseInt","setTimeout"],Tn=-1,Sn={};Sn[Ye]=Sn[Je]=Sn[Qe]=Sn[$e]=Sn[Xe]=Sn[Ze]=Sn[et]=Sn[tt]=Sn[nt]=!0,Sn[je]=Sn[Ee]=Sn[Ke]=Sn[ke]=Sn[We]=Sn[xe]=Sn[_e]=Sn[Me]=Sn[Ne]=Sn[De]=Sn[Le]=Sn[Be]=Sn[Ue]=Sn[Ge]=Sn[ze]=!1;var In={};In[je]=In[Ee]=In[Ke]=In[We]=In[ke]=In[xe]=In[Ye]=In[Je]=In[Qe]=In[$e]=In[Xe]=In[Ne]=In[De]=In[Le]=In[Be]=In[Ue]=In[Ge]=In[Ve]=In[Ze]=In[et]=In[tt]=In[nt]=!0,In[_e]=In[Me]=In[ze]=!1;var On={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},jn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},En={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},kn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xn=parseFloat,_n=parseInt,Mn="object"==typeof i&&i,Fn=Mn&&"object"==typeof n&&n,Nn=Fn&&Fn.exports===Mn,Dn=M("object"==typeof t&&t),Ln=M("object"==typeof self&&self),qn=M("object"==typeof this&&this),Bn=Dn||Ln||qn||Function("return this")(),Un=Q();(Ln||{})._=Un,"function"==typeof e&&"object"==typeof e.amd&&e.amd?e(function(){return Un}):Fn?((Fn.exports=Un)._=Un,Mn._=Un):Bn._=Un}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],73:[function(e,t,n){(function(n){function i(e,t,a,p){"function"==typeof t?(a=t,t={}):t&&"object"==typeof t||(t={mode:t});var c=t.mode,l=t.fs||r;void 0===c&&(c=s&~n.umask()),p||(p=null);var u=a||function(){};e=o.resolve(e),l.mkdir(e,c,function(n){if(!n)return p=p||e,u(null,p);switch(n.code){case"ENOENT":i(o.dirname(e),t,function(n,o){n?u(n,o):i(e,t,u,o)});break;default:l.stat(e,function(e,t){e||!t.isDirectory()?u(n,p):u(null,p)})}})}var o=e("path"),r=e("fs"),s=parseInt("0777",8);t.exports=i.mkdirp=i.mkdirP=i,i.sync=function e(t,i,a){i&&"object"==typeof i||(i={mode:i});var p=i.mode,c=i.fs||r;void 0===p&&(p=s&~n.umask()),a||(a=null),t=o.resolve(t);try{c.mkdirSync(t,p),a=a||t}catch(n){switch(n.code){case"ENOENT":a=e(o.dirname(t),i,a),e(t,i,a);break;default:var l;try{l=c.statSync(t)}catch(e){throw n}if(!l.isDirectory())throw n}}return a}}).call(this,e("_process"))},{_process:94,fs:6,path:92}],74:[function(e,t,n){function i(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return n*u;case"days":case"day":case"d":return n*l;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*p;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function o(e){return e>=l?Math.round(e/l)+"d":e>=c?Math.round(e/c)+"h":e>=p?Math.round(e/p)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function r(e){return s(e,l,"day")||s(e,c,"hour")||s(e,p,"minute")||s(e,a,"second")||e+" ms"}function s(e,t,n){if(!(e0)){var t=e.basePath,n=M[t]&&M[t].scopes||[];n.some(function(t,i){return t===e&&n.splice(i,1)})}}function u(){M={}}function d(e){var t,n;return w.normalizeRequestOptions(e),O("interceptors for %j",e.host),t=e.proto+"://"+e.host,O("filtering interceptors for basepath",t),I.each(M,function(e,i){return I.each(e.scopes,function(i){var o=i.__nock_scopeOptions.filteringScope;if(o&&o(t))return O("found matching scope interceptor"),i.__nock_filteredScope=i.__nock_scopeKey,n=e.scopes,!1}),!n&&w.matchStringOrRegexp(t,e.key)?(n=e.scopes,!1):!n}),n}function f(e){var t,n,i,o;if(e instanceof P?(t=e.basePath,n=e._key):(o=e.proto?e.proto:"http",w.normalizeRequestOptions(e),t=o+"://"+e.host,i=e.method&&e.method.toUpperCase()||"GET",n=i+" "+t+(e.path||"/")),M[t]&&M[t].scopes.length>0){if(n){for(var r=0;r0)&&this.filePath&&(this.body=o.createReadStream(this.filePath),this.body.pause()),!this.scope.shouldPersist()&&this.counter<1&&this.scope.remove(this._key,this)},i.prototype.matchHeader=function(e,t){return this.interceptorMatchHeaders.push({name:e,value:t}),this},i.prototype.basicAuth=function(e){var t=e.user,i=e.pass||"",o="authorization",r="Basic "+new n(t+":"+i).toString("base64");return this.interceptorMatchHeaders.push({name:o,value:r}),this},i.prototype.query=function(e){if(this.queries=this.queries||{},e===!0&&(this.queries=e),p.isFunction(e))return this.queries=e,this;for(var t in e)if(p.isUndefined(this.queries[t])){var n=e[t],i=a.formatQueryValue(t,n,this.scope.scopeOptions);this.queries[i[0]]=i[1]}return this},i.prototype.times=function(e){return e<1?this:(this.counter=e,this)},i.prototype.once=function(){return this.times(1)},i.prototype.twice=function(){return this.times(2)},i.prototype.thrice=function(){return this.times(3)},i.prototype.delay=function(e){var t=0,n=0;if(p.isNumber(e))t=e;else{if(!p.isObject(e))throw new Error("Unexpected input opts"+e);t=e.head||0,n=e.body||0}return this.delayConnection(t).delayBody(n)},i.prototype.delayBody=function(e){return this.delayInMs+=e,this},i.prototype.delayConnection=function(e){return this.delayConnectionInMs+=e,this},i.prototype.getTotalDelay=function(){return this.delayInMs+this.delayConnectionInMs},i.prototype.socketDelay=function(e){return this.socketDelayInMs=e,this}}).call(this,e("buffer").Buffer)},{"./common":77,"./match_body":82,"./mixin":83,buffer:8,debug:43,fs:6,"json-stringify-safe":71,lodash:72,qs:88,util:134}],82:[function(e,t,n){(function(n){"use strict";function i(e,t){if(e&&e.constructor===RegExp)return e.test(t);if(e&&e.constructor===Object&&t){for(var n=Object.keys(e),r=0;r>>>>>\n",g=!1,A=[],b=function(e,n){if(d.isContentEncoded(n))return h.map(e,function(e){if(!t.isBuffer(e)){if("string"!=typeof e)throw new Error("content-encoded responses must all be binary buffers");e=new t(e)}return e.toString("hex")});var i=d.mergeChunks(e);if(d.isBinaryBuffer(i))return i.toString("hex");var o=i.toString("utf8");try{return JSON.parse(o)}catch(e){return o}},C=0;n.record=a,n.outputs=function(){return A},n.restore=p,n.clear=c}).call(this,e("buffer").Buffer)},{"./common":77,"./intercept":80,buffer:8,debug:43,lodash:72,stream:101,url:130,util:134}],85:[function(e,t,n){(function(n,i){"use strict";function o(e,t){if(e._headers){var n=t.toLowerCase();return e._headers[n]}}function r(e,t,n){v("setHeader",t,n);var i=t.toLowerCase();e._headers=e._headers||{},e._headerNames=e._headerNames||{},e._removedHeader=e._removedHeader||{},e._headers[i]=n,e._headerNames[i]=t,"expect"==t&&"100-continue"==n&&g.setImmediate(function(){v("continue"),e.emit("continue")})}function s(e,t,n){n.reqheaders&&m.forOwn(n.reqheaders,function(t,n){r(e,n,t)});var i="host";if(n.__nock_filteredScope&&n.__nock_scopeHost)t&&t.headers&&(t.headers[i]=n.__nock_scopeHost),r(e,i,n.__nock_scopeHost);else if(t.host&&!o(e,i)){var s=t.host;80!==t.port&&443!==t.port||(s=s.split(":")[0]),r(e,i,s)}}function a(e,t,a,c,C){var w;d?w=new d(new p):(w=new A,w._read=function(){});var R,P,T,S,I,O=[];return t=m.clone(t)||{},w.req=e,t.headers&&(t.headers=y.headersFieldNamesToLowerCase(t.headers),I=t.headers,m.forOwn(I,function(t,n){r(e,n,t)})),!t.auth||t.headers&&t.headers.authorization||r(e,"Authorization","Basic "+new i(t.auth).toString("base64")),e.connection||(e.connection=new p),e.path=t.path,t.getHeader=function(t){return o(e,t)},e.socket=w.socket=h({proto:t.proto}),e.write=function(t,n){return v("write",arguments),t&&!R&&(i.isBuffer(t)||(t=new i(t,n)),O.push(t)),R&&P(new Error("Request aborted")),g.setImmediate(function(){e.emit("drain")}),!1},e.end=function(t,n){v("req.end"),R||S||(e.write(t,n),T(C),e.emit("finish"),e.emit("end")),R&&P(new Error("Request aborted"))},e.abort=function(){v("req.abort"),R=!0,S||T();var t=new Error;t.code="aborted",w.emit("close",t),e.socket.destroy(),e.emit("abort");var n=new Error("socket hang up");n.code="ECONNRESET",P(n)},e.once=e.on=function(t,n){return"socket"==t&&(n(e.socket),e.socket.emit("connect",e.socket),e.socket.emit("secureConnect",e.socket)),p.prototype.on.call(this,t,n),this},P=function(t){n.nextTick(function(){e.emit("error",t)})},T=function(o){function r(t,r){function s(){function t(){R||(v("emitting response"),"function"==typeof o&&(v("callback with response"),o(w)),R?P(new Error("Request aborted")):e.emit("response",w),y.isStream(r)?(v("resuming response stream"),r.resume()):(h=h||[],"undefined"!=typeof r&&(v("adding body to buffer list"),h.push(r)),g.setImmediate(function t(){var n=h.shift();n?(v("emitting response chunk"),w.push(n),g.setImmediate(t)):(v("ending response stream"),w.push(null),A.scope.emit("replied",e,A))})))}R||(A.socketDelayInMs&&A.socketDelayInMs>0&&e.socket.applyDelay(A.socketDelayInMs),A.delayConnectionInMs&&A.delayConnectionInMs>0?setTimeout(t,A.delayConnectionInMs):t())}if(!C&&(C=!0,t&&(w.statusCode=500,r=t.stack),r&&(v("transform the response body"),Array.isArray(r)&&r.length>=2&&r.length<=3&&"number"==typeof r[0]&&(v("response body is array: %j",r),w.statusCode=Number(r[0]),v("new headers: %j",r[2]),w.headers||(w.headers={}),m.assign(w.headers,r[2]||{}),v("response.headers after: %j",w.headers),r=r[1],w.rawHeaders=w.rawHeaders||[],Object.keys(w.headers).forEach(function(e){w.rawHeaders.push(e,w.headers[e])})),A.delayInMs&&(v("delaying the response for",A.delayInMs,"milliseconds"),r=new u(A.getTotalDelay(),r)),y.isStream(r)?(v("response body is a stream"),r.pause(),r.on("data",function(e){w.push(e)}),r.on("end",function(){w.push(null)}),r.on("error",function(e){w.emit("error",e)})):r&&!i.isBuffer(r)&&("string"==typeof r?r=new i(r):(r=JSON.stringify(r),w.headers["content-type"]="application/json"))),A.interceptionCounter++,c(A),A.discard(),!R)){w.client=m.extend(w.client||{},{authorized:!0}),w.socket=m.extend(w.socket||{},{authorized:!0});var a={};Object.keys(w.headers).forEach(function(t){var n=w.headers[t];"function"==typeof n&&(w.headers[t]=a[t]=n(e,w,r))});for(var p=0;p0&&0===d.length)&&(d=new i(A.body,"utf8"))}return r(null,d)},e}var p=e("events").EventEmitter,c=e("http"),l=e("propagate"),u=e("./delayed_body"),d=c.IncomingMessage,f=c.ClientRequest,y=e("./common"),h=e("./socket"),m=e("lodash"),v=e("debug")("nock.request_overrider"),g=e("timers"),A=e("stream").Readable,b=e("./global_emitter");t.exports=a}).call(this,e("_process"),e("buffer").Buffer)},{"./common":77,"./delayed_body":78,"./global_emitter":79,"./socket":87,_process:94,buffer:8,debug:43,events:66,http:113,lodash:72,propagate:95,stream:101,timers:126}],86:[function(e,t,n){function i(e,t){return new o(e,t)}function o(e,t){return this instanceof o?(A.apply(this),this.keyedInterceptors={},this.interceptors=[],this.transformPathFunction=null,this.transformRequestBodyFunction=null,this.matchHeaders=[],this.logger=g,this.scopeOptions=t||{},this.urlParts={},this._persist=!1,this.contentLen=!1,this.date=null,this.basePath=e,this.basePathname="",this.port=null,void(e instanceof RegExp||(this.urlParts=m.parse(e),this.port=this.urlParts.port||("http:"===this.urlParts.protocol?80:443),this.basePathname=this.urlParts.pathname.replace(/\/$/,""),this.basePath=this.urlParts.protocol+"//"+this.urlParts.hostname+":"+this.port))):new o(e,t)}function r(){return f.removeAll(),t.exports}function s(e){if(!d)throw new Error("No fs");var t=d.readFileSync(e);return JSON.parse(t)}function a(e){return u(s(e))}function p(e){if(!v.isUndefined(e.reply)){var t=parseInt(e.reply,10);if(v.isNumber(t))return t}var n=200;return e.status||n}function c(e){if(!v.isUndefined(e.port)){var t=m.parse(e.scope);if(v.isNull(t.port))return e.scope+":"+e.port;if(parseInt(t.port)!==parseInt(e.port))throw new Error("Mismatched port numbers in scope and port properties of nock definition.")}return e.scope}function l(e){try{return JSON.parse(e)}catch(t){return e}}function u(e){var t=[];return e.forEach(function(e){var n=c(e),o=e.path,r=e.method.toLowerCase()||"get",s=p(e),a=e.headers||{},u=e.reqheaders||{},d=e.body||"",f=e.options||{};f=v.clone(f)||{},f.reqheaders=u;var y;y=e.response?v.isString(e.response)?l(e.response):e.response:"";var h;if("*"===d)h=i(n,f).filteringRequestBody(function(){return"*"})[r](o,"*").reply(s,y,a);else{if(h=i(n,f),v.size(u)>0)for(var m in u)h.matchHeader(m,u[m]);e.filteringRequestBody&&h.filteringRequestBody(e.filteringRequestBody),h.intercept(o,r,d).reply(s,y,a)}t.push(h)}),t}var d,f=e("./intercept"),y=e("./common"),h=e("assert"),m=e("url"),v=e("lodash"),g=e("debug")("nock.scope"),A=(e("json-stringify-safe"),e("events").EventEmitter),b=e("util")._extend,C=e("./global_emitter"),w=e("util"),R=e("./interceptor");try{d=e("fs")}catch(e){}w.inherits(o,A),o.prototype.add=function(e,t,n){this.keyedInterceptors.hasOwnProperty(e)||(this.keyedInterceptors[e]=[]),this.keyedInterceptors[e].push(t),f(this.basePath,t,this,this.scopeOptions,this.urlParts.hostname)},o.prototype.remove=function(e,t){if(!this._persist){var n=this.keyedInterceptors[e];n&&(n.splice(n.indexOf(t),1),0===n.length&&delete this.keyedInterceptors[e])}},o.prototype.intercept=function(e,t,n,i){var o=new R(this,e,t,n,i);return this.interceptors.push(o),o},o.prototype.get=function(e,t,n){return this.intercept(e,"GET",t,n)},o.prototype.post=function(e,t,n){return this.intercept(e,"POST",t,n)},o.prototype.put=function(e,t,n){return this.intercept(e,"PUT",t,n)},o.prototype.head=function(e,t,n){return this.intercept(e,"HEAD",t,n)},o.prototype.patch=function(e,t,n){return this.intercept(e,"PATCH",t,n)},o.prototype.merge=function(e,t,n){return this.intercept(e,"MERGE",t,n)},o.prototype.delete=function(e,t,n){return this.intercept(e,"DELETE",t,n)},o.prototype.pendingMocks=function(){return Object.keys(this.keyedInterceptors)},o.prototype.isDone=function(){var e=this;if(!f.isOn())return!0;var t=Object.keys(this.keyedInterceptors);if(0===t.length)return!0;var n=0;return t.forEach(function(t){var i=0;e.keyedInterceptors[t].forEach(function(t){var n=!v.isUndefined(t.options.requireDone);n&&t.options.requireDone===!1?i+=1:e._persist&&t.interceptionCounter>0&&(i+=1)}),i===e.keyedInterceptors[t].length&&(n+=1)}),n===t.length},o.prototype.done=function(){h.ok(this.isDone(),"Mocks not yet satisfied:\n"+this.pendingMocks().join("\n"))},o.prototype.buildFilter=function(){var e=arguments;return arguments[0]instanceof RegExp?function(t){return t&&(t=t.replace(e[0],e[1])),t}:v.isFunction(arguments[0])?arguments[0]:void 0},o.prototype.filteringPath=function(){if(this.transformPathFunction=this.buildFilter.apply(this,arguments),!this.transformPathFunction)throw new Error("Invalid arguments: filtering path should be a function or a regular expression");return this},o.prototype.filteringRequestBody=function(){if(this.transformRequestBodyFunction=this.buildFilter.apply(this,arguments),!this.transformRequestBodyFunction)throw new Error("Invalid arguments: filtering request body should be a function or a regular expression");return this},o.prototype.matchHeader=function(e,t){return this.matchHeaders.push({name:e.toLowerCase(),value:t}),this},o.prototype.defaultReplyHeaders=function(e){return this._defaultReplyHeaders=y.headersFieldNamesToLowerCase(e),this},o.prototype.log=function(e){return this.logger=e,this},o.prototype.persist=function(){return this._persist=!0,this},o.prototype.shouldPersist=function(){return this._persist},o.prototype.replyContentLength=function(){return this.contentLen=!0,this},o.prototype.replyDate=function(e){return this.date=e||new Date,this},t.exports=b(i,{cleanAll:r,activate:f.activate,isActive:f.isActive,isDone:f.isDone,pendingMocks:f.pendingMocks,removeInterceptor:f.removeInterceptor,disableNetConnect:f.disableNetConnect,enableNetConnect:f.enableNetConnect,load:a,loadDefs:s,define:u,emitter:C})},{"./common":77,"./global_emitter":79,"./intercept":80,"./interceptor":81,assert:2,debug:43,events:66,fs:6,"json-stringify-safe":71,lodash:72,url:130,util:134}],87:[function(e,t,n){(function(n){"use strict";function i(e){return this instanceof i?(r.apply(this),e=e||{},"https"===e.proto&&(this.authorized=!0),this.writable=!0,this.readable=!0,this.destroyed=!1,this.setNoDelay=o,this.setKeepAlive=o,this.resume=o,this.totalDelayMs=0,void(this.timeoutMs=null)):new i(e)}function o(){}var r=e("events").EventEmitter,s=e("debug")("nock.socket"),a=e("util");t.exports=i,a.inherits(i,r),i.prototype.setTimeout=function(e,t){this.timeoutMs=e,this.timeoutFunction=t},i.prototype.applyDelay=function(e){this.totalDelayMs+=e,this.timeoutMs&&this.totalDelayMs>this.timeoutMs&&(s("socket timeout"),this.timeoutFunction?this.timeoutFunction():this.emit("timeout"))},i.prototype.getPeerCertificate=function(){return new n((1e4*Math.random()+Date.now()).toString()).toString("base64")},i.prototype.destroy=function(){this.destroyed=!0,this.readable=this.writable=!1}}).call(this,e("buffer").Buffer)},{buffer:8,debug:43,events:66,util:134}],88:[function(e,t,n){"use strict";var i=e("./stringify"),o=e("./parse");t.exports={stringify:i,parse:o}},{"./parse":89,"./stringify":90}],89:[function(e,t,n){"use strict";var i=e("./utils"),o=Object.prototype.hasOwnProperty,r={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1,allowDots:!1,decoder:i.decode},s=function(e,t){for(var n={},i=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),r=0;r=0&&i.parseArrays&&a<=i.arrayLimit?(o=[],o[a]=e(t,n,i)):o[s]=e(t,n,i)}return o},p=function(e,t,n){if(e){var i=n.allowDots?e.replace(/\.([^\.\[]+)/g,"[$1]"):e,r=/^([^\[\]]*)/,s=/(\[[^\[\]]*\])/g,p=r.exec(i),c=[];if(p[1]){if(!n.plainObjects&&o.call(Object.prototype,p[1])&&!n.allowPrototypes)return;c.push(p[1])}for(var l=0;null!==(p=s.exec(i))&&l=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122?n+=t.charAt(o):r<128?n+=i[r]:r<2048?n+=i[192|r>>6]+i[128|63&r]:r<55296||r>=57344?n+=i[224|r>>12]+i[128|r>>6&63]+i[128|63&r]:(o+=1,r=65536+((1023&r)<<10|1023&t.charCodeAt(o)),n+=i[240|r>>18]+i[128|r>>12&63]+i[128|r>>6&63]+i[128|63&r])}return n},n.compact=function(e,t){if("object"!=typeof e||null===e)return e;var i=t||[],o=i.indexOf(e);if(o!==-1)return i[o];if(i.push(e),Array.isArray(e)){for(var r=[],s=0;s=0;i--){var o=e[i];"."===o?e.splice(i,1):".."===o?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],i=0;i=-1&&!o;r--){var s=r>=0?arguments[r]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,o="/"===s.charAt(0))}return n=t(i(n.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+n||"."},n.normalize=function(e){var o=n.isAbsolute(e),r="/"===s(e,-1);return e=t(i(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&r&&(e+="/"),(o?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function i(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var o=i(e.split("/")),r=i(t.split("/")),s=Math.min(o.length,r.length),a=s,p=0;p1)for(var n=1;n1&&(i=n[0]+"@",e=n[1]),e=e.replace(_,".");var o=e.split("."),r=s(o,t).join(".");return i+r}function p(e){for(var t,n,i=[],o=0,r=e.length;o=55296&&t<=56319&&o65535&&(e-=65536,t+=D(e>>>10&1023|55296),e=56320|1023&e),t+=D(e)}).join("")}function l(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:R}function u(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function d(e,t,n){var i=0;for(e=n?N(e/I):e>>1,e+=N(e/t);e>F*T>>1;i+=R)e=N(e/F);return N(i+(F+1)*e/(e+S))}function f(e){var t,n,i,o,s,a,p,u,f,y,h=[],m=e.length,v=0,g=j,A=O;for(n=e.lastIndexOf(E),n<0&&(n=0),i=0;i=128&&r("not-basic"),h.push(e.charCodeAt(i));for(o=n>0?n+1:0;o=m&&r("invalid-input"),u=l(e.charCodeAt(o++)),(u>=R||u>N((w-v)/a))&&r("overflow"),v+=u*a,f=p<=A?P:p>=A+T?T:p-A,!(uN(w/y)&&r("overflow"),a*=y;t=h.length+1,A=d(v-s,t,0==s),N(v/t)>w-g&&r("overflow"),g+=N(v/t),v%=t,h.splice(v++,0,g)}return c(h)}function y(e){var t,n,i,o,s,a,c,l,f,y,h,m,v,g,A,b=[];for(e=p(e),m=e.length,t=j,n=0,s=O,a=0;a=t&&hN((w-n)/v)&&r("overflow"),n+=(c-t)*v,t=c,a=0;aw&&r("overflow"),h==t){for(l=n,f=R;y=f<=s?P:f>=s+T?T:f-s,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=R-P,N=Math.floor,D=String.fromCharCode;if(b={version:"1.4.1",ucs2:{decode:p,encode:c},decode:f,encode:y,toASCII:m,toUnicode:h},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return b});else if(v&&g)if(n.exports==v)g.exports=b;else for(C in b)b.hasOwnProperty(C)&&(v[C]=b[C]);else o.punycode=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],97:[function(e,t,n){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,r){t=t||"&",n=n||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var p=1e3;r&&"number"==typeof r.maxKeys&&(p=r.maxKeys);var c=e.length;p>0&&c>p&&(c=p);for(var l=0;l=0?(u=h.substr(0,m),d=h.substr(m+1)):(u=h,d=""),f=decodeURIComponent(u),y=decodeURIComponent(d),i(s,f)?o(s[f])?s[f].push(y):s[f]=[s[f],y]:s[f]=y}return s};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],98:[function(e,t,n){"use strict";function i(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i0)if(t.ended&&!o){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&o){var p=new Error("stream.unshift() after end event");e.emit("error",p)}else{var c;!t.decoder||o||i||(n=t.decoder.write(n),c=!t.objectMode&&0===n.length),o||(t.reading=!1),c||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,o?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&d(e))),y(e,t)}else o||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length=q?e=q:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function c(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:null===e||isNaN(e)?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:e<=0?0:(e>t.highWaterMark&&(t.highWaterMark=p(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function l(e,t){var n=null;return k.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function u(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,d(e)}}function d(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(F("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?S(f,e):f(e))}function f(e){F("emit readable"),e.emit("readable"),b(e)}function y(e,t){t.readingMore||(t.readingMore=!0,S(h,e,t))}function h(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=o)n=r?i.join(""):1===i.length?i[0]:k.concat(i,o),i.length=0;else if(e0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,S(R,t,e))}function R(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var n=0,i=e.length;n0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return F("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?w(this):d(this),null;if(e=c(e,t),0===e&&t.ended)return 0===t.length&&w(this),null;var i=t.needReadable;F("need readable",i),(0===t.length||t.length-e0?C(e,t):null,null===o&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),n!==e&&t.ended&&0===t.length&&w(this),null!==o&&this.emit("data",o),o},r.prototype._read=function(e){this.emit("error",new Error("not implemented"))},r.prototype.pipe=function(e,t){function o(e){F("onunpipe"),e===d&&s()}function r(){F("onend"),e.end()}function s(){F("cleanup"),e.removeListener("close",c),e.removeListener("finish",l),e.removeListener("drain",v),e.removeListener("error",p),e.removeListener("unpipe",o),d.removeListener("end",r),d.removeListener("end",s),d.removeListener("data",a),g=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function a(t){F("ondata");var n=e.write(t);!1===n&&((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&T(f.pipes,e)!==-1)&&!g&&(F("false write response, pause",d._readableState.awaitDrain),d._readableState.awaitDrain++),d.pause())}function p(t){F("onerror",t),u(),e.removeListener("error",p),0===E(e,"error")&&e.emit("error",t)}function c(){e.removeListener("finish",l),u()}function l(){F("onfinish"),e.removeListener("close",c),u()}function u(){F("unpipe"),d.unpipe(e)}var d=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,F("pipe count=%d opts=%j",f.pipesCount,t);var y=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,h=y?r:s;f.endEmitted?S(h):d.once("end",h),e.on("unpipe",o);var v=m(d);e.on("drain",v);var g=!1;return d.on("data",a),i(e,"error",p),e.once("close",c),e.once("finish",l),e.emit("pipe",d),f.flowing||(F("pipe resume"),d.resume()),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o-1?setImmediate:R;s.WritableState=r;var T=e("core-util-is");T.inherits=e("inherits");var S,I={deprecate:e("util-deprecate")};!function(){try{S=e("stream")}catch(e){}finally{S||(S=e("events").EventEmitter)}}();var O=e("buffer").Buffer,j=e("buffer-shims");T.inherits(s,S);var E;r.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(r.prototype,"buffer",{get:I.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var E;s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(e,t,n){var o=this._writableState,r=!1;return"function"==typeof t&&(n=t,t=null),O.isBuffer(e)?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=i),o.ended?a(this,n):p(this,o,e,n)&&(o.pendingcb++,r=l(this,o,e,t,n)),r},s.prototype.cork=function(){var e=this._writableState;e.corked++},s.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||v(this,e))},s.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},s.prototype._write=function(e,t,n){n(new Error("not implemented"))},s.prototype._writev=null,s.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||C(this,i,n)}}).call(this,e("_process"))},{"./_stream_duplex":104,_process:94,buffer:8,"buffer-shims":7,"core-util-is":41,events:66,inherits:69,"process-nextick-args":93,"util-deprecate":132}],109:[function(e,t,n){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":105}],110:[function(e,t,n){(function(i){var o=function(){try{return e("stream")}catch(e){}}();n=t.exports=e("./lib/_stream_readable.js"),n.Stream=o||n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),!i.browser&&"disable"===i.env.READABLE_STREAM&&o&&(t.exports=o)}).call(this,e("_process"))},{"./lib/_stream_duplex.js":104,"./lib/_stream_passthrough.js":105,"./lib/_stream_readable.js":106,"./lib/_stream_transform.js":107,"./lib/_stream_writable.js":108,_process:94}],111:[function(e,t,n){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":107}],112:[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":108}],113:[function(e,t,n){(function(t){var i=e("./lib/request"),o=e("xtend"),r=e("builtin-status-codes"),s=e("url"),a=n;a.request=function(e,n){e="string"==typeof e?s.parse(e):o(e);var r=t.location.protocol.search(/^https?:$/)===-1?"http:":"",a=e.protocol||r,p=e.hostname||e.host,c=e.port,l=e.path||"/";p&&p.indexOf(":")!==-1&&(p="["+p+"]"),e.url=(p?a+"//"+p:"")+(c?":"+c:"")+l,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var u=new i(e);return n&&u.on("response",n),u},a.get=function(e,t){var n=a.request(e,t);return n.end(),n},a.Agent=function(){},a.Agent.defaultMaxSockets=4,a.STATUS_CODES=r,a.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":115,"builtin-status-codes":10,url:130,xtend:135}],114:[function(e,t,n){(function(e){function t(e){try{return o.responseType=e,o.responseType===e}catch(e){}return!1}function i(e){return"function"==typeof e}n.fetch=i(e.fetch)&&i(e.ReadableByteStream),n.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),n.blobConstructor=!0}catch(e){}var o=new e.XMLHttpRequest;o.open("GET",e.location.host?"/":"https://example.com");var r="undefined"!=typeof e.ArrayBuffer,s=r&&i(e.ArrayBuffer.prototype.slice);n.arraybuffer=r&&t("arraybuffer"),n.msstream=!n.fetch&&s&&t("ms-stream"),n.mozchunkedarraybuffer=!n.fetch&&r&&t("moz-chunked-arraybuffer"),n.overrideMimeType=i(o.overrideMimeType),n.vbArray=i(e.VBArray),o=null}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],115:[function(e,t,n){(function(n,i,o){function r(e){ -return a.fetch?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":a.vbArray&&e?"text:vbarray":"text"}function s(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}var a=e("./capability"),p=e("inherits"),c=e("./response"),l=e("readable-stream"),u=e("to-arraybuffer"),d=c.IncomingMessage,f=c.readyStates,y=t.exports=function(e){var t=this;l.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+new o(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(n){t.setHeader(n,e.headers[n])});var n;if("prefer-streaming"===e.mode)n=!1;else if("allow-wrong-content-type"===e.mode)n=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");n=!0}t._mode=r(n),t.on("finish",function(){t._onFinish()})};p(y,l.Writable),y.prototype.setHeader=function(e,t){var n=this,i=e.toLowerCase();h.indexOf(i)===-1&&(n._headers[i]={name:e,value:t})},y.prototype.getHeader=function(e){var t=this;return t._headers[e.toLowerCase()].value},y.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]},y.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t,r=e._opts,s=e._headers;if("POST"!==r.method&&"PUT"!==r.method&&"PATCH"!==r.method||(t=a.blobConstructor?new i.Blob(e._body.map(function(e){return u(e)}),{type:(s["content-type"]||{}).value||""}):o.concat(e._body).toString()),"fetch"===e._mode){var p=Object.keys(s).map(function(e){return[s[e].name,s[e].value]});i.fetch(e._opts.url,{method:e._opts.method,headers:p,body:t,mode:"cors",credentials:r.withCredentials?"include":"same-origin"}).then(function(t){e._fetchResponse=t,e._connect()},function(t){e.emit("error",t)})}else{var c=e._xhr=new i.XMLHttpRequest;try{c.open(e._opts.method,e._opts.url,!0)}catch(t){return void n.nextTick(function(){e.emit("error",t)})}"responseType"in c&&(c.responseType=e._mode.split(":")[0]),"withCredentials"in c&&(c.withCredentials=!!r.withCredentials),"text"===e._mode&&"overrideMimeType"in c&&c.overrideMimeType("text/plain; charset=x-user-defined"),Object.keys(s).forEach(function(e){c.setRequestHeader(s[e].name,s[e].value)}),e._response=null,c.onreadystatechange=function(){switch(c.readyState){case f.LOADING:case f.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(c.onprogress=function(){e._onXHRProgress()}),c.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{c.send(t)}catch(t){return void n.nextTick(function(){e.emit("error",t)})}}}},y.prototype._onXHRProgress=function(){var e=this;s(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},y.prototype._connect=function(){var e=this;e._destroyed||(e._response=new d(e._xhr,e._fetchResponse,e._mode),e.emit("response",e._response))},y.prototype._write=function(e,t,n){var i=this;i._body.push(e),n()},y.prototype.abort=y.prototype.destroy=function(){var e=this;e._destroyed=!0,e._response&&(e._response._destroyed=!0),e._xhr&&e._xhr.abort()},y.prototype.end=function(e,t,n){var i=this;"function"==typeof e&&(n=e,e=void 0),l.Writable.prototype.end.call(i,e,t,n)},y.prototype.flushHeaders=function(){},y.prototype.setTimeout=function(){},y.prototype.setNoDelay=function(){},y.prototype.setSocketKeepAlive=function(){};var h=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":114,"./response":116,_process:94,buffer:8,inherits:69,"readable-stream":123,"to-arraybuffer":127}],116:[function(e,t,n){(function(t,i,o){var r=e("./capability"),s=e("inherits"),a=e("readable-stream"),p=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=n.IncomingMessage=function(e,n,i){function s(){d.read().then(function(e){if(!p._destroyed){if(e.done)return void p.push(null);p.push(new o(e.value)),s()}})}var p=this;if(a.Readable.call(p),p._mode=i,p.headers={},p.rawHeaders=[],p.trailers={},p.rawTrailers=[],p.on("end",function(){t.nextTick(function(){p.emit("close")})}),"fetch"===i){p._fetchResponse=n,p.url=n.url,p.statusCode=n.status,p.statusMessage=n.statusText;for(var c,l,u=n.headers[Symbol.iterator]();c=(l=u.next()).value,!l.done;)p.headers[c[0].toLowerCase()]=c[1],p.rawHeaders.push(c[0],c[1]);var d=n.body.getReader();s()}else{p._xhr=e,p._pos=0,p.url=e.responseURL,p.statusCode=e.status,p.statusMessage=e.statusText;var f=e.getAllResponseHeaders().split(/\r?\n/);if(f.forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===p.headers[n]&&(p.headers[n]=[]),p.headers[n].push(t[2])):void 0!==p.headers[n]?p.headers[n]+=", "+t[2]:p.headers[n]=t[2],p.rawHeaders.push(t[1],t[2])}}),p._charset="x-user-defined",!r.overrideMimeType){var y=p.rawHeaders["mime-type"];if(y){var h=y.match(/;\s*charset=([^;])(;|$)/);h&&(p._charset=h[1].toLowerCase())}p._charset||(p._charset="utf-8")}}};s(c,a.Readable),c.prototype._read=function(){},c.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text:vbarray":if(t.readyState!==p.DONE)break;try{n=new i.VBArray(t.responseBody).toArray()}catch(e){}if(null!==n){e.push(new o(n));break}case"text":try{n=t.responseText}catch(t){e._mode="text:vbarray";break}if(n.length>e._pos){var r=n.substr(e._pos);if("x-user-defined"===e._charset){for(var s=new o(r.length),a=0;ae._pos&&(e.push(new o(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(n)}e._xhr.readyState===p.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":114,_process:94,buffer:8,inherits:69,"readable-stream":123}],117:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],118:[function(e,t,n){arguments[4][104][0].apply(n,arguments)},{"./_stream_readable":120,"./_stream_writable":122,"core-util-is":41,dup:104,inherits:69,"process-nextick-args":93}],119:[function(e,t,n){arguments[4][105][0].apply(n,arguments)},{"./_stream_transform":121,"core-util-is":41,dup:105,inherits:69}],120:[function(e,t,n){arguments[4][106][0].apply(n,arguments)},{"./_stream_duplex":118,_process:94,buffer:8,"buffer-shims":7,"core-util-is":41,dup:106,events:66,inherits:69,isarray:117,"process-nextick-args":93,"string_decoder/":124,util:5}],121:[function(e,t,n){arguments[4][107][0].apply(n,arguments)},{"./_stream_duplex":118,"core-util-is":41,dup:107,inherits:69}],122:[function(e,t,n){arguments[4][108][0].apply(n,arguments)},{"./_stream_duplex":118,_process:94,buffer:8,"buffer-shims":7,"core-util-is":41,dup:108,events:66,inherits:69,"process-nextick-args":93,"util-deprecate":132}],123:[function(e,t,n){arguments[4][110][0].apply(n,arguments)},{"./lib/_stream_duplex.js":118,"./lib/_stream_passthrough.js":119,"./lib/_stream_readable.js":120,"./lib/_stream_transform.js":121,"./lib/_stream_writable.js":122,_process:94,dup:110}],124:[function(e,t,n){function i(e){if(e&&!p(e))throw new Error("Unknown encoding: "+e)}function o(e){return e.toString(this.encoding)}function r(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=e("buffer").Buffer,p=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},c=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),i(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=o)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};c.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var o=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,o),o-=this.charReceived),t+=e.toString(this.encoding,0,o);var o=t.length-1,i=t.charCodeAt(o);if(i>=55296&&i<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),e.copy(this.charBuffer,0,0,r),t.substring(0,o)}return t},c.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},c.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,i=this.charBuffer,o=this.encoding;t+=i.slice(0,n).toString(o)}return t}},{buffer:8}],125:[function(e,t,n){function i(){}function o(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function r(e){return e===Object(e)}function s(e){if(!r(e))return e;var t=[];for(var n in e)null!=e[n]&&a(t,n,e[n]);return t.join("&")}function a(e,t,n){return Array.isArray(n)?n.forEach(function(n){a(e,t,n)}):void e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}function p(e){for(var t,n,i={},o=e.split("&"),r=0,s=o.length;r=200&&t.status<300)return n.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,n.callback(i,t)})}function h(e,t){return"function"==typeof t?new y("GET",e).end(t):1==arguments.length?new y("GET",e):new y(e,t)}function m(e,t){var n=h("DELETE",e);return t&&n.end(t),n}var v,g=e("emitter"),A=e("reduce");v="undefined"!=typeof window?window:"undefined"!=typeof self?self:this,h.getXHR=function(){if(!(!v.XMLHttpRequest||v.location&&"file:"==v.location.protocol&&v.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var b="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};h.serializeObject=s,h.parseString=p,h.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},h.serialize={"application/x-www-form-urlencoded":s,"application/json":JSON.stringify},h.parse={"application/x-www-form-urlencoded":p,"application/json":JSON.parse},f.prototype.get=function(e){return this.header[e.toLowerCase()]},f.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=u(t);var n=d(t);for(var i in n)this[i]=n[i]},f.prototype.parseBody=function(e){var t=h.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},f.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},f.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,i="cannot "+t+" "+n+" ("+this.status+")",o=new Error(i);return o.status=this.status,o.method=t,o.url=n,o},h.Response=f,g(y.prototype),y.prototype.use=function(e){return e(this),this},y.prototype.timeout=function(e){return this._timeout=e,this},y.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},y.prototype.abort=function(){if(!this.aborted)return this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this},y.prototype.set=function(e,t){if(r(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},y.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},y.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},y.prototype.type=function(e){return this.set("Content-Type",h.types[e]||e),this},y.prototype.parse=function(e){return this._parser=e,this},y.prototype.accept=function(e){return this.set("Accept",h.types[e]||e),this},y.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},y.prototype.query=function(e){return"string"!=typeof e&&(e=s(e)),e&&this._query.push(e),this},y.prototype.field=function(e,t){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t),this},y.prototype.attach=function(e,t,n){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t,n||t.name),this},y.prototype.send=function(e){var t=r(e),n=this.getHeader("Content-Type");if(t&&r(this._data))for(var i in e)this._data[i]=e[i];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||o(e)?this:(n||this.type("json"),this)},y.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},y.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},y.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},y.prototype.withCredentials=function(){return this._withCredentials=!0,this},y.prototype.end=function(e){var t=this,n=this.xhr=h.getXHR(),r=this._query.join("&"),s=this._timeout,a=this._formData||this._data;this._callback=e||i,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(t){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var p=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),e.direction="download",t.emit("progress",e)};this.hasListeners("progress")&&(n.onprogress=p);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=p)}catch(e){}if(s&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},s)),r&&(r=h.serializeObject(r),this.url+=~this.url.indexOf("?")?"&"+r:"?"+r),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof a&&!o(a)){var c=this.getHeader("Content-Type"),u=this._parser||h.serialize[c?c.split(";")[0]:""];!u&&l(c)&&(u=h.serialize["application/json"]),u&&(a=u(a))}for(var d in this.header)null!=this.header[d]&&n.setRequestHeader(d,this.header[d]);return this.emit("request",this),n.send("undefined"!=typeof a?a:null),this},y.prototype.then=function(e,t){return this.end(function(n,i){n?t(n):e(i)})},h.Request=y,h.get=function(e,t,n){var i=h("GET",e);return"function"==typeof t&&(n=t,t=null),t&&i.query(t),n&&i.end(n),i},h.head=function(e,t,n){var i=h("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},h.del=m,h.delete=m,h.patch=function(e,t,n){var i=h("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},h.post=function(e,t,n){var i=h("POST",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},h.put=function(e,t,n){var i=h("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},t.exports=h},{emitter:40,reduce:100}],126:[function(e,t,n){function i(e,t){this._id=e,this._clearFn=t}var o=e("process/browser.js").nextTick,r=Function.prototype.apply,s=Array.prototype.slice,a={},p=0;n.setTimeout=function(){return new i(r.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new i(r.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof setImmediate?setImmediate:function(e){var t=p++,i=!(arguments.length<2)&&s.call(arguments,1);return a[t]=!0,o(function(){a[t]&&(i?e.apply(null,i):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof clearImmediate?clearImmediate:function(e){delete a[e]}},{"process/browser.js":94}],127:[function(e,t,n){var i=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(i.isBuffer(e)){for(var t=new Uint8Array(e.length),n=e.length,o=0;o",'"',"`"," ","\r","\n","\t"],y=["{","}","|","\\","^","`"].concat(f),h=["'"].concat(y),m=["%","/","?",";","#"].concat(h),v=["/","?","#"],g=255,A=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,C={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},P=e("querystring");i.prototype.parse=function(e,t,n){if(!c.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=i!==-1&&i127?"x":M[N];if(!F.match(A)){var L=x.slice(0,I),q=x.slice(I+1),B=M.match(b);B&&(L.push(B[1]),q.unshift(B[2])),q.length&&(a="/"+q.join(".")+a),this.hostname=L.join(".");break}}}this.hostname.length>g?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=p.toASCII(this.hostname));var U=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+U,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!C[y])for(var I=0,_=h.length;I<_;I++){var V=h[I];if(a.indexOf(V)!==-1){var z=encodeURIComponent(V);z===V&&(z=escape(V)),a=a.split(V).join(z)}}var H=a.indexOf("#");H!==-1&&(this.hash=a.substr(H),a=a.slice(0,H));var K=a.indexOf("?");if(K!==-1?(this.search=a.substr(K),this.query=a.substr(K+1),t&&(this.query=P.parse(this.query)),a=a.slice(0,K)):t&&(this.search="",this.query={}),a&&(this.pathname=a),R[y]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var U=this.pathname||"",W=this.search||"";this.path=U+W}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",i=this.hash||"",o=!1,r="";this.host?o=e+this.host:this.hostname&&(o=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&c.isObject(this.query)&&Object.keys(this.query).length&&(r=P.stringify(this.query));var s=this.search||r&&"?"+r||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||R[t])&&o!==!1?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+o+n+s+i},i.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(c.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,o=Object.keys(this),r=0;r0)&&n.host.split("@");T&&(n.auth=T.shift(),n.host=n.hostname=T.shift())}return n.search=e.search,n.query=e.query,c.isNull(n.pathname)&&c.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!C.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=C.slice(-1)[0],I=(n.host||e.host||C.length>1)&&("."===S||".."===S)||""===S,O=0,j=C.length;j>=0;j--)S=C[j],"."===S?C.splice(j,1):".."===S?(C.splice(j,1),O++):O&&(C.splice(j,1),O--);if(!A&&!b)for(;O--;O)C.unshift("..");!A||""===C[0]||C[0]&&"/"===C[0].charAt(0)||C.unshift(""),I&&"/"!==C.join("/").substr(-1)&&C.push("");var E=""===C[0]||C[0]&&"/"===C[0].charAt(0);if(P){n.hostname=n.host=E?"":C.length?C.shift():"";var T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");T&&(n.auth=T.shift(),n.host=n.hostname=T.shift())}return A=A||n.host&&C.length,A&&!E&&C.unshift(""),C.length?n.pathname=C.join("/"):(n.pathname=null,n.path=null),c.isNull(n.pathname)&&c.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=u.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":131,punycode:96,querystring:99}],131:[function(e,t,n){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],132:[function(e,t,n){(function(e){function n(e,t){function n(){if(!o){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),o=!0}return e.apply(this,arguments)}if(i("noDeprecation"))return e;var o=!1;return n}function i(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],133:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],134:[function(e,t,n){(function(t,i){function o(e,t){var i={seen:[],stylize:s};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),h(t)?i.showHidden=t:t&&n._extend(i,t),C(i.showHidden)&&(i.showHidden=!1),C(i.depth)&&(i.depth=2),C(i.colors)&&(i.colors=!1),C(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=r),p(i,e,i.depth)}function r(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function p(e,t,i){if(e.customInspect&&t&&S(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(i,e);return A(o)||(o=p(e,o,i)),o}var r=c(e,t);if(r)return r;var s=Object.keys(t),h=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),T(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(t);if(0===s.length){if(S(t)){var m=t.name?": "+t.name:"";return e.stylize("[Function"+m+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(P(t))return e.stylize(Date.prototype.toString.call(t),"date");if(T(t))return l(t)}var v="",g=!1,b=["{","}"];if(y(t)&&(g=!0,b=["[","]"]),S(t)){var C=t.name?": "+t.name:"";v=" [Function"+C+"]"}if(w(t)&&(v=" "+RegExp.prototype.toString.call(t)),P(t)&&(v=" "+Date.prototype.toUTCString.call(t)),T(t)&&(v=" "+l(t)),0===s.length&&(!g||0==t.length))return b[0]+v+b[1];if(i<0)return w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var R;return R=g?u(e,t,i,h,s):s.map(function(n){return d(e,t,i,h,n,g)}),e.seen.pop(),f(R,v,b)}function c(e,t){if(C(t))return e.stylize("undefined","undefined");if(A(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function u(e,t,n,i,o){for(var r=[],s=0,a=t.length;s-1&&(a=r?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){ -return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),C(s)){if(r&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function f(e,t,n){var i=0,o=e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function y(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return null==e}function g(e){return"number"==typeof e}function A(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function C(e){return void 0===e}function w(e){return R(e)&&"[object RegExp]"===O(e)}function R(e){return"object"==typeof e&&null!==e}function P(e){return R(e)&&"[object Date]"===O(e)}function T(e){return R(e)&&("[object Error]"===O(e)||e instanceof Error)}function S(e){return"function"==typeof e}function I(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function O(e){return Object.prototype.toString.call(e)}function j(e){return e<10?"0"+e.toString(10):e.toString(10)}function E(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),F[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var x=/%[sdj%]/g;n.format=function(e){if(!A(e)){for(var t=[],n=0;n=r)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return e}}),a=i[n];n>e/4).toString(16):([1e16]+1e16).replace(/[01]/g,this.token)}},{key:"progress",value:function(e,t){if(e.lengthComputable&&this.promise){var n=Math.round(e.loaded/e.total*100);t.emit("progress",{total:e.total,loaded:e.loaded,percent:n})}}},{key:"buildUrlCustomBasePath",value:function(e,t,n){t.match(/^\//)||(t="/"+t);var i=e+t,o=this;return i=i.replace(/\{([\w-]+)\}/g,function(e,t){var i;return i=n.hasOwnProperty(t)?o.paramToString(n[t]):e,encodeURIComponent(i)})}}]),t}(p);a(u.prototype),t.exports=u},{"./alfresco-core-rest-api/src/ApiClient":269,"event-emitter":65,lodash:72,superagent:125}],396:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n\n \n /Company Home\n \n \n Folder: /Company Home\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
>Data Dictionary\n
>Guest Home\n
>User Homes\n
>Shared\n
>Imap Attachments\n
>IMAP Home\n
>Sites\n
>x\n
testFile.txt\n
>newFolder\n
>newFolder-1\n
testFile-1.txt\n
testFile-2.txt\n
testFile-3.txt\n
\n \n\n\n')}},{key:"get401Response",value:function(){a(this.host,{encodedQueryParams:!0}).get(this.scriptSlug).reply(401,{error:{errorKey:"framework.exception.ApiDefault",statusCode:401,briefSummary:"05210059 Authentication failed for Web Script org/alfresco/api/ResourceWebScript.get",stackTrace:"For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.",descriptionURL:"https://api-explorer.alfresco.com"}})}}]),t}(p);t.exports=c},{"../baseMock":413,nock:75}],413:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n=0;r--)if(s[r]!=a[r])return!1;for(r=s.length-1;r>=0;r--)if(o=s[r],!p(e[o],t[o]))return!1;return!0}function u(e,t){return!(!e||!t)&&("[object RegExp]"==Object.prototype.toString.call(t)?t.test(e):e instanceof t||t.call({},e)===!0)}function d(e,t,n,i){var o;f.isString(n)&&(i=n,n=null);try{t()}catch(e){o=e}if(i=(n&&n.name?" ("+n.name+").":".")+(i?" "+i:"."),e&&!o&&s(o,n,"Missing expected exception"+i),!e&&u(o,n)&&s(o,n,"Got unwanted exception"+i),e&&o&&n&&!u(o,n)||!e&&o)throw o}var f=e("util/"),y=Array.prototype.slice,h=Object.prototype.hasOwnProperty,m=t.exports=a;m.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=r(this),this.generatedMessage=!0);var t=e.stackStartFunction||s;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var n=new Error;if(n.stack){var i=n.stack,o=t.name,a=i.indexOf("\n"+o);if(a>=0){var p=i.indexOf("\n",a+1);i=i.substring(p+1)}this.stack=i}}},f.inherits(m.AssertionError,Error),m.fail=s,m.ok=a,m.equal=function(e,t,n){e!=t&&s(e,t,n,"==",m.equal)},m.notEqual=function(e,t,n){e==t&&s(e,t,n,"!=",m.notEqual)},m.deepEqual=function(e,t,n){p(e,t)||s(e,t,n,"deepEqual",m.deepEqual)},m.notDeepEqual=function(e,t,n){p(e,t)&&s(e,t,n,"notDeepEqual",m.notDeepEqual)},m.strictEqual=function(e,t,n){e!==t&&s(e,t,n,"===",m.strictEqual)},m.notStrictEqual=function(e,t,n){e===t&&s(e,t,n,"!==",m.notStrictEqual)},m.throws=function(e,t,n){d.apply(this,[!0].concat(y.call(arguments)))},m.doesNotThrow=function(e,t){d.apply(this,[!1].concat(y.call(arguments)))},m.ifError=function(e){if(e)throw e};var v=Object.keys||function(e){var t=[];for(var n in e)h.call(e,n)&&t.push(n);return t}},{"util/":136}],3:[function(e,t,n){function i(){function e(e,n){Object.keys(n).forEach(function(i){~t.indexOf(i)||(e[i]=n[i])})}var t=[].slice.call(arguments);return function(){for(var t=[].slice.call(arguments),n=0,i={};n0)throw new Error("Invalid string. Length must be a multiple of 4");r="="===e[a-2]?2:"="===e[a-1]?1:0,s=new l(3*a/4-r),i=r>0?a-4:a;var p=0;for(t=0,n=0;t>16&255,s[p++]=o>>8&255,s[p++]=255&o;return 2===r?(o=c[e.charCodeAt(t)]<<2|c[e.charCodeAt(t+1)]>>4,s[p++]=255&o):1===r&&(o=c[e.charCodeAt(t)]<<10|c[e.charCodeAt(t+1)]<<4|c[e.charCodeAt(t+2)]>>2,s[p++]=o>>8&255,s[p++]=255&o),s}function r(e){return p[e>>18&63]+p[e>>12&63]+p[e>>6&63]+p[63&e]}function s(e,t,n){for(var i,o=[],s=t;sl?l:c+a));return 1===i?(t=e[n-1],o+=p[t>>2],o+=p[t<<4&63],o+="=="):2===i&&(t=(e[n-2]<<8)+e[n-1],o+=p[t>>10],o+=p[t>>4&63],o+=p[t<<2&63],o+="="),r.push(o),r.join("")}n.toByteArray=o,n.fromByteArray=a;var p=[],c=[],l="undefined"!=typeof Uint8Array?Uint8Array:Array;i()},{}],5:[function(e,t,n){},{}],6:[function(e,t,n){arguments[4][5][0].apply(n,arguments)},{dup:5}],7:[function(e,t,n){(function(t){"use strict";var i=e("buffer"),o=i.Buffer,r=i.SlowBuffer,s=i.kMaxLength||2147483647;n.alloc=function(e,t,n){if("function"==typeof o.alloc)return o.alloc(e,t,n);if("number"==typeof n)throw new TypeError("encoding must not be number");if("number"!=typeof e)throw new TypeError("size must be a number");if(e>s)throw new RangeError("size is too large");var i=n,r=t;void 0===r&&(i=void 0,r=0);var a=new o(e);if("string"==typeof r)for(var p=new o(r,i),c=p.length,l=-1;++ls)throw new RangeError("size is too large");return new o(e)},n.from=function(e,n,i){if("function"==typeof o.from&&(!t.Uint8Array||Uint8Array.from!==o.from))return o.from(e,n,i);if("number"==typeof e)throw new TypeError('"value" argument must not be a number');if("string"==typeof e)return new o(e,n);if("undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer){var r=n;if(1===arguments.length)return new o(e);"undefined"==typeof r&&(r=0);var s=i;if("undefined"==typeof s&&(s=e.byteLength-r),r>=e.byteLength)throw new RangeError("'offset' is out of bounds");if(s>e.byteLength-r)throw new RangeError("'length' is out of bounds");return new o(e.slice(r,r+s))}if(o.isBuffer(e)){var a=new o(e.length);return e.copy(a,0,0,e.length),a}if(e){if(Array.isArray(e)||"undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return new o(e);if("Buffer"===e.type&&Array.isArray(e.data))return new o(e.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")},n.allocUnsafeSlow=function(e){if("function"==typeof o.allocUnsafeSlow)return o.allocUnsafeSlow(e);if("number"!=typeof e)throw new TypeError("size must be a number");if(e>=s)throw new RangeError("size is too large");return new r(e)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{buffer:8}],8:[function(e,t,n){(function(t){"use strict";function i(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}function o(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function r(e,t){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),s.alloc(+e)}function v(e,t){if(s.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Y(e).length;default:if(i)return H(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,n){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return _(this,t,n);case"utf8":case"utf-8":return j(this,t,n);case"ascii":return k(this,t,n);case"latin1":case"binary":return x(this,t,n);case"base64":return O(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function A(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}function b(e,t,n,i,o){if(0===e.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=s.from(t,i)),s.isBuffer(t))return 0===t.length?-1:C(e,t,n,i,o);if("number"==typeof t)return t=255&t,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):C(e,[t],n,i,o);throw new TypeError("val must be string, number or Buffer")}function C(e,t,n,i,o){function r(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}var s=1,a=e.length,p=t.length;if(void 0!==i&&(i=String(i).toLowerCase(),"ucs2"===i||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;s=2,a/=2,p/=2,n/=2}var c;if(o){var l=-1;for(c=n;ca&&(n=a-p),c=n;c>=0;c--){for(var u=!0,d=0;do&&(i=o)):i=o;var r=t.length;if(r%2!==0)throw new TypeError("Invalid hex string");i>r/2&&(i=r/2);for(var s=0;s239?4:r>223?3:r>191?2:1;if(o+a<=n){var p,c,l,u;switch(a){case 1:r<128&&(s=r);break;case 2:p=e[o+1],128===(192&p)&&(u=(31&r)<<6|63&p,u>127&&(s=u));break;case 3:p=e[o+1],c=e[o+2],128===(192&p)&&128===(192&c)&&(u=(15&r)<<12|(63&p)<<6|63&c,u>2047&&(u<55296||u>57343)&&(s=u));break;case 4:p=e[o+1],c=e[o+2],l=e[o+3],128===(192&p)&&128===(192&c)&&128===(192&l)&&(u=(15&r)<<18|(63&p)<<12|(63&c)<<6|63&l,u>65535&&u<1114112&&(s=u))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|1023&s),i.push(s),o+=a}return E(i)}function E(e){var t=e.length;if(t<=ee)return String.fromCharCode.apply(String,e);for(var n="",i=0;ii)&&(n=i);for(var o="",r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function N(e,t,n,i,o,r){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function D(e,t,n,i){t<0&&(t=65535+t+1);for(var o=0,r=Math.min(e.length-n,2);o>>8*(i?o:1-o)}function L(e,t,n,i){t<0&&(t=4294967295+t+1);for(var o=0,r=Math.min(e.length-n,4);o>>8*(i?o:3-o)&255}function q(e,t,n,i,o,r){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function B(e,t,n,i,o){return o||q(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),X.write(e,t,n,i,23,4),n+4}function U(e,t,n,i,o){return o||q(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),X.write(e,t,n,i,52,8),n+8}function G(e){if(e=V(e).replace(te,""),e.length<2)return"";for(;e.length%4!==0;)e+="=";return e}function V(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function z(e){return e<16?"0"+e.toString(16):e.toString(16)}function H(e,t){t=t||1/0;for(var n,i=e.length,o=null,r=[],s=0;s55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(s+1===i){(t-=3)>-1&&r.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&r.push(239,191,189),o=n;continue}n=(o-55296<<10|n-56320)+65536}else o&&(t-=3)>-1&&r.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;r.push(n)}else if(n<2048){if((t-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function K(e){for(var t=[],n=0;n>8,o=n%256,r.push(o),r.push(i);return r}function Y(e){return $.toByteArray(G(e))}function J(e,t,n,i){for(var o=0;o=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Q(e){return e!==e}var $=e("base64-js"),X=e("ieee754"),Z=e("isarray");n.Buffer=s,n.SlowBuffer=m,n.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:i(),n.kMaxLength=o(),s.poolSize=8192,s._augment=function(e){return e.__proto__=s.prototype,e},s.from=function(e,t,n){return a(null,e,t,n)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(e,t,n){return c(null,e,t,n)},s.allocUnsafe=function(e){return l(null,e)},s.allocUnsafeSlow=function(e){return l(null,e)},s.isBuffer=function(e){return!(null==e||!e._isBuffer)},s.compare=function(e,t){if(!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,i=t.length,o=0,r=Math.min(n,i);o0&&(e=this.toString("hex",0,t).match(/.{2}/g).join(" "),this.length>t&&(e+=" ... ")),""},s.prototype.compare=function(e,t,n,i,o){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=n)return 0;if(i>=o)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;for(var r=o-i,a=n-t,p=Math.min(r,a),c=this.slice(i,o),l=e.slice(t,n),u=0;uo)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var r=!1;;)switch(i){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return R(this,e,t,n);case"ascii":return P(this,e,t,n);case"latin1":case"binary":return T(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,e,t,n);default:if(r)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),r=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var ee=4096;s.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),t0&&(o*=256);)i+=this[e+--t]*o;return i},s.prototype.readUInt8=function(e,t){return t||F(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return t||F(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return t||F(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,n){e=0|e,t=0|t,n||F(e,t,this.length);for(var i=this[e],o=1,r=0;++r=o&&(i-=Math.pow(2,8*t)),i},s.prototype.readIntBE=function(e,t,n){e=0|e,t=0|t,n||F(e,t,this.length);for(var i=t,o=1,r=this[e+--i];i>0&&(o*=256);)r+=this[e+--i]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*t)),r},s.prototype.readInt8=function(e,t){return t||F(e,1,this.length),128&this[e]?(255-this[e]+1)*-1:this[e]},s.prototype.readInt16LE=function(e,t){t||F(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt16BE=function(e,t){t||F(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},s.prototype.readInt32LE=function(e,t){return t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return t||F(e,4,this.length),X.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return t||F(e,4,this.length),X.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return t||F(e,8,this.length),X.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return t||F(e,8,this.length),X.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,n,i){if(e=+e,t=0|t,n=0|n,!i){var o=Math.pow(2,8*n)-1;N(this,e,t,n,o,0)}var r=1,s=0;for(this[t]=255&e;++s=0&&(s*=256);)this[t+r]=e/s&255;return t+n},s.prototype.writeUInt8=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,1,255,0),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},s.prototype.writeUInt16BE=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},s.prototype.writeUInt32LE=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):L(this,e,t,!0),t+4},s.prototype.writeUInt32BE=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},s.prototype.writeIntLE=function(e,t,n,i){if(e=+e,t=0|t,!i){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var r=0,s=1,a=0;for(this[t]=255&e;++r>0)-a&255;return t+n},s.prototype.writeIntBE=function(e,t,n,i){if(e=+e,t=0|t,!i){var o=Math.pow(2,8*n-1);N(this,e,t,n,o-1,-o)}var r=n-1,s=1,a=0;for(this[t+r]=255&e;--r>=0&&(s*=256);)e<0&&0===a&&0!==this[t+r+1]&&(a=1),this[t+r]=(e/s>>0)-a&255;return t+n},s.prototype.writeInt8=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,1,127,-128),s.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):D(this,e,t,!0),t+2},s.prototype.writeInt16BE=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):D(this,e,t,!1),t+2},s.prototype.writeInt32LE=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):L(this,e,t,!0),t+4},s.prototype.writeInt32BE=function(e,t,n){return e=+e,t=0|t,n||N(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),s.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):L(this,e,t,!1),t+4},s.prototype.writeFloatLE=function(e,t,n){return B(this,e,t,!0,n)},s.prototype.writeFloatBE=function(e,t,n){return B(this,e,t,!1,n)},s.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},s.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},s.prototype.copy=function(e,t,n,i){if(n||(n=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t=0;--o)e[o+t]=this[o+n];else if(r<1e3||!s.TYPED_ARRAY_SUPPORT)for(o=0;o>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var r;if("number"==typeof e)for(r=t;re,"expected #{this} to have a length above #{exp} but got #{act}","expected #{this} to not have a length above #{exp}",e,i)}else this.assert(n>e,"expected #{this} to be above "+e,"expected #{this} to be at most "+e)}function c(e,t){t&&j(this,"message",t);var n=j(this,"object");if(j(this,"doLength")){new O(n,t).to.have.property("length");var i=n.length;this.assert(i>=e,"expected #{this} to have a length at least #{exp} but got #{act}","expected #{this} to have a length below #{exp}",e,i)}else this.assert(n>=e,"expected #{this} to be at least "+e,"expected #{this} to be below "+e)}function l(e,t){t&&j(this,"message",t);var n=j(this,"object");if(j(this,"doLength")){new O(n,t).to.have.property("length");var i=n.length;this.assert(i1)throw new Error(r);break;case"object":if(arguments.length>1)throw new Error(r);e=Object.keys(e);break;default:e=Array.prototype.slice.call(arguments)}if(!e.length)throw new Error("keys required");var s=Object.keys(i),a=e,p=e.length,c=j(this,"any"),l=j(this,"all");if(c||l||(l=!0),c){var u=a.filter(function(e){return~s.indexOf(e)});o=u.length>0}if(l&&(o=e.every(function(e){return~s.indexOf(e)}),j(this,"negate")||j(this,"contains")||(o=o&&e.length==s.length)),p>1){e=e.map(function(e){return t.inspect(e)});var d=e.pop();l&&(n=e.join(", ")+", and "+d),c&&(n=e.join(", ")+", or "+d)}else n=t.inspect(e[0]);n=(p>1?"keys ":"key ")+n,n=(j(this,"contains")?"contain ":"have ")+n,this.assert(o,"expected #{this} to "+n,"expected #{this} to not "+n,a.slice(0).sort(),s.sort(),!0)}function A(e,n,i){i&&j(this,"message",i);var o=j(this,"object");new O(o,i).is.a("function");var r=!1,s=null,a=null,p=null;0===arguments.length?(n=null,e=null):e&&(e instanceof RegExp||"string"==typeof e)?(n=e,e=null):e&&e instanceof Error?(s=e,e=null,n=null):"function"==typeof e?(a=e.prototype.name,(!a||"Error"===a&&e!==Error)&&(a=e.name||(new e).name)):e=null;try{o()}catch(i){if(s)return this.assert(i===s,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp}",s instanceof Error?s.toString():s,i instanceof Error?i.toString():i),j(this,"object",i),this;if(e&&(this.assert(i instanceof e,"expected #{this} to throw #{exp} but #{act} was thrown","expected #{this} to not throw #{exp} but #{act} was thrown",a,i instanceof Error?i.toString():i),!n))return j(this,"object",i),this;var c="error"===t.type(i)&&"message"in i?i.message:""+i;if(null!=c&&n&&n instanceof RegExp)return this.assert(n.exec(c),"expected #{this} to throw error matching #{exp} but got #{act}","expected #{this} to throw error not matching #{exp}",n,c),j(this,"object",i),this;if(null!=c&&n&&"string"==typeof n)return this.assert(~c.indexOf(n),"expected #{this} to throw error including #{exp} but got #{act}","expected #{this} to throw error not including #{act}",n,c),j(this,"object",i),this;r=!0,p=i}var l="",u=null!==a?a:s?"#{exp}":"an error";r&&(l=" but #{act} was thrown"),this.assert(r===!0,"expected #{this} to throw "+u+l,"expected #{this} to not throw "+u+l,s instanceof Error?s.toString():s,p instanceof Error?p.toString():p),j(this,"object",p)}function b(e,n){n&&j(this,"message",n);var i=j(this,"object"),o=j(this,"itself"),r="function"!==t.type(i)||o?i[e]:i.prototype[e];this.assert("function"==typeof r,"expected #{this} to respond to "+t.inspect(e),"expected #{this} to not respond to "+t.inspect(e))}function C(e,n){n&&j(this,"message",n);var i=j(this,"object"),o=e(i);this.assert(o,"expected #{this} to satisfy "+t.objDisplay(e),"expected #{this} to not satisfy"+t.objDisplay(e),!this.negate,o)}function w(e,n,i){i&&j(this,"message",i);var o=j(this,"object");if(new O(o,i).is.a("number"),"number"!==t.type(e)||"number"!==t.type(n))throw new Error("the arguments to closeTo or approximately must be numbers");this.assert(Math.abs(o-e)<=n,"expected #{this} to be close to "+e+" +/- "+n,"expected #{this} not to be close to "+e+" +/- "+n)}function R(e,t,n){return e.every(function(e){return n?t.some(function(t){return n(e,t)}):t.indexOf(e)!==-1})}function P(e,t){t&&j(this,"message",t);var n=j(this,"object");new O(e).to.be.an("array"),this.assert(e.indexOf(n)>-1,"expected #{this} to be one of #{exp}","expected #{this} to not be one of #{exp}",e,n)}function T(e,t,n){n&&j(this,"message",n);var i=j(this,"object");new O(e,n).to.have.property(t),new O(i).is.a("function");var o=e[t];i(),this.assert(o!==e[t],"expected ."+t+" to change","expected ."+t+" to not change")}function S(e,t,n){n&&j(this,"message",n);var i=j(this,"object");new O(e,n).to.have.property(t),new O(i).is.a("function");var o=e[t];i(),this.assert(e[t]-o>0,"expected ."+t+" to increase","expected ."+t+" to not increase")}function I(e,t,n){n&&j(this,"message",n);var i=j(this,"object");new O(e,n).to.have.property(t),new O(i).is.a("function");var o=e[t];i(),this.assert(e[t]-o<0,"expected ."+t+" to decrease","expected ."+t+" to not decrease")}var O=e.Assertion,j=(Object.prototype.toString,t.flag);["to","be","been","is","and","has","have","with","that","which","at","of","same"].forEach(function(e){O.addProperty(e,function(){return this})}),O.addProperty("not",function(){j(this,"negate",!0)}),O.addProperty("deep",function(){j(this,"deep",!0)}),O.addProperty("any",function(){j(this,"any",!0),j(this,"all",!1)}),O.addProperty("all",function(){j(this,"all",!0),j(this,"any",!1)}),O.addChainableMethod("an",n),O.addChainableMethod("a",n),O.addChainableMethod("include",o,i),O.addChainableMethod("contain",o,i),O.addChainableMethod("contains",o,i),O.addChainableMethod("includes",o,i),O.addProperty("ok",function(){this.assert(j(this,"object"),"expected #{this} to be truthy","expected #{this} to be falsy")}),O.addProperty("true",function(){this.assert(!0===j(this,"object"),"expected #{this} to be true","expected #{this} to be false",!this.negate)}),O.addProperty("false",function(){this.assert(!1===j(this,"object"),"expected #{this} to be false","expected #{this} to be true",!!this.negate)}),O.addProperty("null",function(){this.assert(null===j(this,"object"),"expected #{this} to be null","expected #{this} not to be null")}),O.addProperty("undefined",function(){this.assert(void 0===j(this,"object"),"expected #{this} to be undefined","expected #{this} not to be undefined")}),O.addProperty("NaN",function(){this.assert(isNaN(j(this,"object")),"expected #{this} to be NaN","expected #{this} not to be NaN")}),O.addProperty("exist",function(){this.assert(null!=j(this,"object"),"expected #{this} to exist","expected #{this} to not exist")}),O.addProperty("empty",function(){var e=j(this,"object"),t=e;Array.isArray(e)||"string"==typeof object?t=e.length:"object"==typeof e&&(t=Object.keys(e).length),this.assert(!t,"expected #{this} to be empty","expected #{this} not to be empty")}),O.addProperty("arguments",r),O.addProperty("Arguments",r),O.addMethod("equal",s),O.addMethod("equals",s),O.addMethod("eq",s),O.addMethod("eql",a),O.addMethod("eqls",a),O.addMethod("above",p),O.addMethod("gt",p),O.addMethod("greaterThan",p),O.addMethod("least",c),O.addMethod("gte",c),O.addMethod("below",l),O.addMethod("lt",l),O.addMethod("lessThan",l),O.addMethod("most",u),O.addMethod("lte",u),O.addMethod("within",function(e,t,n){n&&j(this,"message",n);var i=j(this,"object"),o=e+".."+t;if(j(this,"doLength")){new O(i,n).to.have.property("length");var r=i.length;this.assert(r>=e&&r<=t,"expected #{this} to have a length within "+o,"expected #{this} to not have a length within "+o)}else this.assert(i>=e&&i<=t,"expected #{this} to be within "+o,"expected #{this} to not be within "+o)}),O.addMethod("instanceof",d),O.addMethod("instanceOf",d),O.addMethod("property",function(e,n,i){i&&j(this,"message",i);var o=!!j(this,"deep"),r=o?"deep property ":"property ",s=j(this,"negate"),a=j(this,"object"),p=o?t.getPathInfo(e,a):null,c=o?p.exists:t.hasProperty(e,a),l=o?p.value:a[e];if(s&&arguments.length>1){if(void 0===l)throw i=null!=i?i+": ":"",new Error(i+t.inspect(a)+" has no "+r+t.inspect(e))}else this.assert(c,"expected #{this} to have a "+r+t.inspect(e),"expected #{this} to not have "+r+t.inspect(e));arguments.length>1&&this.assert(n===l,"expected #{this} to have a "+r+t.inspect(e)+" of #{exp}, but got #{act}","expected #{this} to not have a "+r+t.inspect(e)+" of #{act}",n,l),j(this,"object",l)}),O.addMethod("ownProperty",f),O.addMethod("haveOwnProperty",f),O.addMethod("ownPropertyDescriptor",y),O.addMethod("haveOwnPropertyDescriptor",y),O.addChainableMethod("length",m,h),O.addMethod("lengthOf",m),O.addMethod("match",v),O.addMethod("matches",v),O.addMethod("string",function(e,n){n&&j(this,"message",n);var i=j(this,"object");new O(i,n).is.a("string"),this.assert(~i.indexOf(e),"expected #{this} to contain "+t.inspect(e),"expected #{this} to not contain "+t.inspect(e))}),O.addMethod("keys",g),O.addMethod("key",g),O.addMethod("throw",A),O.addMethod("throws",A),O.addMethod("Throw",A),O.addMethod("respondTo",b),O.addMethod("respondsTo",b),O.addProperty("itself",function(){j(this,"itself",!0)}),O.addMethod("satisfy",C),O.addMethod("satisfies",C),O.addMethod("closeTo",w),O.addMethod("approximately",w),O.addMethod("members",function(e,n){n&&j(this,"message",n);var i=j(this,"object");new O(i).to.be.an("array"),new O(e).to.be.an("array");var o=j(this,"deep")?t.eql:void 0;return j(this,"contains")?this.assert(R(e,i,o),"expected #{this} to be a superset of #{act}","expected #{this} to not be a superset of #{act}",i,e):void this.assert(R(i,e,o)&&R(e,i,o),"expected #{this} to have the same members as #{act}","expected #{this} to not have the same members as #{act}",i,e)}),O.addMethod("oneOf",P),O.addChainableMethod("change",T),O.addChainableMethod("changes",T),O.addChainableMethod("increase",S),O.addChainableMethod("increases",S),O.addChainableMethod("decrease",I),O.addChainableMethod("decreases",I),O.addProperty("extensible",function(){var e,t=j(this,"object");try{e=Object.isExtensible(t)}catch(t){if(!(t instanceof TypeError))throw t;e=!1}this.assert(e,"expected #{this} to be extensible","expected #{this} to not be extensible")}),O.addProperty("sealed",function(){var e,t=j(this,"object");try{e=Object.isSealed(t)}catch(t){if(!(t instanceof TypeError))throw t;e=!0}this.assert(e,"expected #{this} to be sealed","expected #{this} to not be sealed")}),O.addProperty("frozen",function(){var e,t=j(this,"object");try{e=Object.isFrozen(t)}catch(t){if(!(t instanceof TypeError))throw t;e=!0}this.assert(e,"expected #{this} to be frozen","expected #{this} to not be frozen")})}},{}],16:[function(e,t,n){t.exports=function(e,t){var n=e.Assertion,i=t.flag,o=e.assert=function(t,i){var o=new n(null,null,e.assert);o.assert(t,i,"[ negation message unavailable ]")};o.fail=function(t,n,i,r){throw i=i||"assert.fail()",new e.AssertionError(i,{actual:t,expected:n,operator:r},o.fail)},o.isOk=function(e,t){new n(e,t).is.ok},o.isNotOk=function(e,t){new n(e,t).is.not.ok},o.equal=function(e,t,r){var s=new n(e,r,o.equal);s.assert(t==i(s,"object"),"expected #{this} to equal #{exp}","expected #{this} to not equal #{act}",t,e)},o.notEqual=function(e,t,r){var s=new n(e,r,o.notEqual);s.assert(t!=i(s,"object"),"expected #{this} to not equal #{exp}","expected #{this} to equal #{act}",t,e)},o.strictEqual=function(e,t,i){new n(e,i).to.equal(t)},o.notStrictEqual=function(e,t,i){new n(e,i).to.not.equal(t)},o.deepEqual=function(e,t,i){new n(e,i).to.eql(t)},o.notDeepEqual=function(e,t,i){new n(e,i).to.not.eql(t)},o.isAbove=function(e,t,i){new n(e,i).to.be.above(t)},o.isAtLeast=function(e,t,i){new n(e,i).to.be.least(t)},o.isBelow=function(e,t,i){new n(e,i).to.be.below(t)},o.isAtMost=function(e,t,i){new n(e,i).to.be.most(t)},o.isTrue=function(e,t){new n(e,t).is.true},o.isNotTrue=function(e,t){new n(e,t).to.not.equal(!0)},o.isFalse=function(e,t){new n(e,t).is.false},o.isNotFalse=function(e,t){new n(e,t).to.not.equal(!1)},o.isNull=function(e,t){new n(e,t).to.equal(null)},o.isNotNull=function(e,t){new n(e,t).to.not.equal(null)},o.isNaN=function(e,t){new n(e,t).to.be.NaN},o.isNotNaN=function(e,t){new n(e,t).not.to.be.NaN},o.isUndefined=function(e,t){new n(e,t).to.equal(void 0)},o.isDefined=function(e,t){new n(e,t).to.not.equal(void 0)},o.isFunction=function(e,t){new n(e,t).to.be.a("function")},o.isNotFunction=function(e,t){new n(e,t).to.not.be.a("function")},o.isObject=function(e,t){new n(e,t).to.be.a("object")},o.isNotObject=function(e,t){new n(e,t).to.not.be.a("object")},o.isArray=function(e,t){new n(e,t).to.be.an("array")},o.isNotArray=function(e,t){new n(e,t).to.not.be.an("array")},o.isString=function(e,t){new n(e,t).to.be.a("string")},o.isNotString=function(e,t){new n(e,t).to.not.be.a("string")},o.isNumber=function(e,t){new n(e,t).to.be.a("number")},o.isNotNumber=function(e,t){new n(e,t).to.not.be.a("number")},o.isBoolean=function(e,t){new n(e,t).to.be.a("boolean")},o.isNotBoolean=function(e,t){new n(e,t).to.not.be.a("boolean")},o.typeOf=function(e,t,i){new n(e,i).to.be.a(t)},o.notTypeOf=function(e,t,i){new n(e,i).to.not.be.a(t)},o.instanceOf=function(e,t,i){new n(e,i).to.be.instanceOf(t)},o.notInstanceOf=function(e,t,i){new n(e,i).to.not.be.instanceOf(t)},o.include=function(e,t,i){new n(e,i,o.include).include(t)},o.notInclude=function(e,t,i){new n(e,i,o.notInclude).not.include(t)},o.match=function(e,t,i){new n(e,i).to.match(t)},o.notMatch=function(e,t,i){new n(e,i).to.not.match(t)},o.property=function(e,t,i){new n(e,i).to.have.property(t)},o.notProperty=function(e,t,i){new n(e,i).to.not.have.property(t)},o.deepProperty=function(e,t,i){new n(e,i).to.have.deep.property(t)},o.notDeepProperty=function(e,t,i){new n(e,i).to.not.have.deep.property(t)},o.propertyVal=function(e,t,i,o){new n(e,o).to.have.property(t,i)},o.propertyNotVal=function(e,t,i,o){new n(e,o).to.not.have.property(t,i)},o.deepPropertyVal=function(e,t,i,o){new n(e,o).to.have.deep.property(t,i)},o.deepPropertyNotVal=function(e,t,i,o){new n(e,o).to.not.have.deep.property(t,i)},o.lengthOf=function(e,t,i){new n(e,i).to.have.length(t)},o.throws=function(e,t,o,r){("string"==typeof t||t instanceof RegExp)&&(o=t,t=null);var s=new n(e,r).to.throw(t,o);return i(s,"object")},o.doesNotThrow=function(e,t,i){"string"==typeof t&&(i=t,t=null),new n(e,i).to.not.Throw(t)},o.operator=function(e,o,r,s){var a;switch(o){case"==":a=e==r;break;case"===":a=e===r;break;case">":a=e>r;break;case">=":a=e>=r;break;case"<":a=e1&&n===t.length-1?"or ":"";return o+i+" "+e}).join(", ");if(!t.some(function(t){return r(e)===t}))throw new i("object tested must be "+n+", but "+r(e)+" given")}},{"./flag":23,"assertion-error":3,"type-detect":130}],23:[function(e,t,n){t.exports=function(e,t,n){var i=e.__flags||(e.__flags=Object.create(null));return 3!==arguments.length?i[t]:void(i[t]=n)}},{}],24:[function(e,t,n){t.exports=function(e,t){return t.length>4?t[4]:e._obj}},{}],25:[function(e,t,n){t.exports=function(e){var t=[];for(var n in e)t.push(n);return t}},{}],26:[function(e,t,n){var i=e("./flag"),o=e("./getActual"),r=(e("./inspect"),e("./objDisplay"));t.exports=function(e,t){var n=i(e,"negate"),s=i(e,"object"),a=t[3],p=o(e,t),c=n?t[2]:t[1],l=i(e,"message");return"function"==typeof c&&(c=c()),c=c||"",c=c.replace(/#\{this\}/g,function(){return r(s)}).replace(/#\{act\}/g,function(){return r(p)}).replace(/#\{exp\}/g,function(){return r(a)}),l?l+": "+c:c}},{"./flag":23,"./getActual":24,"./inspect":33,"./objDisplay":34}],27:[function(e,t,n){t.exports=function(e){if(e.name)return e.name;var t=/^\s?function ([^(]*)\(/.exec(e);return t&&t[1]?t[1]:""}},{}],28:[function(e,t,n){function i(e){var t=e.replace(/([^\\])\[/g,"$1.["),n=t.match(/(\\\.|[^.]+?)+/g);return n.map(function(e){var t=/^\[(\d+)\]$/,n=t.exec(e);return n?{i:parseFloat(n[1])}:{p:e.replace(/\\([.\[\]])/g,"$1")}})}function o(e,t,n){var i,o=t;n=void 0===n?e.length:n;for(var r=0,s=n;r1?o(n,t,n.length-1):t,name:s.p||s.i,value:o(n,t)};return a.exists=r(a.name,a.parent),a}},{"./hasProperty":31}],29:[function(e,t,n){var i=e("./getPathInfo");t.exports=function(e,t){var n=i(e,t);return n.value}},{"./getPathInfo":28}],30:[function(e,t,n){t.exports=function(e){function t(e){n.indexOf(e)===-1&&n.push(e)}for(var n=Object.getOwnPropertyNames(e),i=Object.getPrototypeOf(e);null!==i;)Object.getOwnPropertyNames(i).forEach(t),i=Object.getPrototypeOf(i);return n}},{}],31:[function(e,t,n){var i=e("type-detect"),o={number:Number,string:String};t.exports=function(e,t){var n=i(t);return"null"!==n&&"undefined"!==n&&(o[n]&&"object"!=typeof t&&(t=new o[n](t)),e in t)}},{"type-detect":130}],32:[function(e,t,n){var n=t.exports={};n.test=e("./test"),n.type=e("type-detect"),n.expectTypes=e("./expectTypes"),n.getMessage=e("./getMessage"),n.getActual=e("./getActual"),n.inspect=e("./inspect"),n.objDisplay=e("./objDisplay"),n.flag=e("./flag"),n.transferFlags=e("./transferFlags"),n.eql=e("deep-eql"),n.getPathValue=e("./getPathValue"),n.getPathInfo=e("./getPathInfo"),n.hasProperty=e("./hasProperty"),n.getName=e("./getName"),n.addProperty=e("./addProperty"),n.addMethod=e("./addMethod"),n.overwriteProperty=e("./overwriteProperty"),n.overwriteMethod=e("./overwriteMethod"),n.addChainableMethod=e("./addChainableMethod"),n.overwriteChainableMethod=e("./overwriteChainableMethod")},{"./addChainableMethod":19,"./addMethod":20,"./addProperty":21,"./expectTypes":22,"./flag":23,"./getActual":24,"./getMessage":26,"./getName":27,"./getPathInfo":28,"./getPathValue":29,"./hasProperty":31,"./inspect":33,"./objDisplay":34,"./overwriteChainableMethod":35,"./overwriteMethod":36,"./overwriteProperty":37,"./test":38,"./transferFlags":39,"deep-eql":45,"type-detect":130}],33:[function(e,t,n){function i(e,t,n,i){var r={showHidden:t,seen:[],stylize:function(e){return e}};return o(r,e,"undefined"==typeof n?2:n)}function o(e,t,i){if(t&&"function"==typeof t.inspect&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var y=t.inspect(i);return"string"!=typeof y&&(y=o(e,y,i)),y}var A=r(e,t);if(A)return A;if(g(t)){if("outerHTML"in t)return t.outerHTML;try{if(document.xmlVersion){var b=new XMLSerializer;return b.serializeToString(t)}var C="http://www.w3.org/1999/xhtml",w=document.createElementNS(C,"_");return w.appendChild(t.cloneNode(!1)),html=w.innerHTML.replace("><",">"+t.innerHTML+"<"),w.innerHTML="",html}catch(e){}}var R=v(t),P=e.showHidden?m(t):R;if(0===P.length||f(t)&&(1===P.length&&"stack"===P[0]||2===P.length&&"description"===P[0]&&"stack"===P[1])){if("function"==typeof t){var T=h(t),S=T?": "+T:"";return e.stylize("[Function"+S+"]","special")}if(u(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(d(t))return e.stylize(Date.prototype.toUTCString.call(t),"date");if(f(t))return s(t)}var I="",O=!1,j=["{","}"];if(l(t)&&(O=!0,j=["[","]"]),"function"==typeof t){var T=h(t),S=T?": "+T:"";I=" [Function"+S+"]"}if(u(t)&&(I=" "+RegExp.prototype.toString.call(t)),d(t)&&(I=" "+Date.prototype.toUTCString.call(t)),f(t))return s(t);if(0===P.length&&(!O||0==t.length))return j[0]+I+j[1];if(i<0)return u(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var E;return E=O?a(e,t,i,R,P):P.map(function(n){return p(e,t,i,R,n,O)}),e.seen.pop(),c(E,I,j)}function r(e,t){switch(typeof t){case"undefined":return e.stylize("undefined","undefined");case"string":var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string");case"number":return 0===t&&1/t===-(1/0)?e.stylize("-0","number"):e.stylize(""+t,"number");case"boolean":return e.stylize(""+t,"boolean")}if(null===t)return e.stylize("null","null")}function s(e){return"["+Error.prototype.toString.call(e)+"]"}function a(e,t,n,i,o){for(var r=[],s=0,a=t.length;s-1&&(p=s?p.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+p.split("\n").map(function(e){return" "+e}).join("\n"))):p=e.stylize("[Circular]","special")),"undefined"==typeof a){if(s&&r.match(/^\d+$/))return p;a=JSON.stringify(""+r),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+p}function c(e,t,n){var i=0,o=e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.length+1},0);return o>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function l(e){return Array.isArray(e)||"object"==typeof e&&"[object Array]"===y(e)}function u(e){return"object"==typeof e&&"[object RegExp]"===y(e)}function d(e){return"object"==typeof e&&"[object Date]"===y(e)}function f(e){return"object"==typeof e&&"[object Error]"===y(e)}function y(e){return Object.prototype.toString.call(e)}var h=e("./getName"),m=e("./getProperties"),v=e("./getEnumerableProperties");t.exports=i;var g=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&"string"==typeof e.nodeName}},{"./getEnumerableProperties":25,"./getName":27,"./getProperties":30}],34:[function(e,t,n){var i=e("./inspect"),o=e("../config");t.exports=function(e){var t=i(e),n=Object.prototype.toString.call(e);if(o.truncateThreshold&&t.length>=o.truncateThreshold){if("[object Function]"===n)return e.name&&""!==e.name?"[Function: "+e.name+"]":"[Function]";if("[object Array]"===n)return"[ Array("+e.length+") ]";if("[object Object]"===n){var r=Object.keys(e),s=r.length>2?r.splice(0,2).join(", ")+", ...":r.join(", ");return"{ Object ("+s+") }"}return t}return t}},{"../config":14,"./inspect":33}],35:[function(e,t,n){t.exports=function(e,t,n,i){var o=e.__methods[t],r=o.chainingBehavior;o.chainingBehavior=function(){var e=i(r).call(this);return void 0===e?this:e};var s=o.method;o.method=function(){var e=n(s).apply(this,arguments);return void 0===e?this:e}}},{}],36:[function(e,t,n){t.exports=function(e,t,n){var i=e[t],o=function(){return this};i&&"function"==typeof i&&(o=i),e[t]=function(){var e=n(o).apply(this,arguments);return void 0===e?this:e}}},{}],37:[function(e,t,n){t.exports=function(e,t,n){var i=Object.getOwnPropertyDescriptor(e,t),o=function(){};i&&"function"==typeof i.get&&(o=i.get),Object.defineProperty(e,t,{get:function(){var e=n(o).call(this);return void 0===e?this:e},configurable:!0})}},{}],38:[function(e,t,n){var i=e("./flag");t.exports=function(e,t){var n=i(e,"negate"),o=t[0];return n?!o:o}},{"./flag":23}],39:[function(e,t,n){t.exports=function(e,t,n){var i=e.__flags||(e.__flags=Object.create(null));t.__flags||(t.__flags=Object.create(null)),n=3!==arguments.length||n;for(var o in i)(n||"object"!==o&&"ssfi"!==o&&"message"!=o)&&(t.__flags[o]=i[o])}},{}],40:[function(e,t,n){function i(e){if(e)return o(e)}function o(e){for(var t in i.prototype)e[t]=i.prototype[t];return e}"undefined"!=typeof t&&(t.exports=i),i.prototype.on=i.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},i.prototype.once=function(e,t){ +function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},i.prototype.off=i.prototype.removeListener=i.prototype.removeAllListeners=i.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var i,o=0;o=31}function o(){var e=arguments,t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+n.humanize(this.diff),!t)return e;var i="color: "+this.color;e=[e[0],i,"color: inherit"].concat(Array.prototype.slice.call(e,1));var o=0,r=0;return e[0].replace(/%[a-z%]/g,function(e){"%%"!==e&&(o++,"%c"===e&&(r=o))}),e.splice(r,0,i),e}function r(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{null==e?n.storage.removeItem("debug"):n.storage.debug=e}catch(e){}}function a(){var e;try{e=n.storage.debug}catch(e){}return e}function p(){try{return window.localStorage}catch(e){}}n=t.exports=e("./debug"),n.log=r,n.formatArgs=o,n.save=s,n.load=a,n.useColors=i,n.storage="undefined"!=typeof chrome&&"undefined"!=typeof chrome.storage?chrome.storage.local:p(),n.colors=["lightseagreen","forestgreen","goldenrod","dodgerblue","darkorchid","crimson"],n.formatters.j=function(e){return JSON.stringify(e)},n.enable(a())},{"./debug":44}],44:[function(e,t,n){function i(){return n.colors[l++%n.colors.length]}function o(e){function t(){}function o(){var e=o,t=+new Date,r=t-(c||t);e.diff=r,e.prev=c,e.curr=t,c=t,null==e.useColors&&(e.useColors=n.useColors()),null==e.color&&e.useColors&&(e.color=i());var s=Array.prototype.slice.call(arguments);s[0]=n.coerce(s[0]),"string"!=typeof s[0]&&(s=["%o"].concat(s));var a=0;s[0]=s[0].replace(/%([a-z%])/g,function(t,i){if("%%"===t)return t;a++;var o=n.formatters[i];if("function"==typeof o){var r=s[a];t=o.call(e,r),s.splice(a,1),a--}return t}),"function"==typeof n.formatArgs&&(s=n.formatArgs.apply(e,s));var p=o.log||n.log||console.log.bind(console);p.apply(e,s)}t.enabled=!1,o.enabled=!0;var r=n.enabled(e)?o:t;return r.namespace=e,r}function r(e){n.save(e);for(var t=(e||"").split(/[\s,]+/),i=t.length,o=0;o=0;o--)if(a=r[o],!i(e[a],t[a],n))return!1;return!0}var y,h=e("type-detect");try{y=e("buffer").Buffer}catch(e){y={},y.isBuffer=function(){return!1}}t.exports=i},{buffer:8,"type-detect":47}],47:[function(e,t,n){t.exports=e("./lib/type")},{"./lib/type":48}],48:[function(e,t,n){function i(e){var t=Object.prototype.toString.call(e);return r[t]?r[t]:null===e?"null":void 0===e?"undefined":e===Object(e)?"object":typeof e}function o(){this.tests={}}var n=t.exports=i,r={"[object Array]":"array","[object RegExp]":"regexp","[object Function]":"function","[object Arguments]":"arguments","[object Date]":"date"};n.Library=o,o.prototype.of=i,o.prototype.define=function(e,t){return 1===arguments.length?this.tests[e]:(this.tests[e]=t,this)},o.prototype.test=function(e,t){if(t===i(e))return!0;var n=this.tests[t];if(n&&"regexp"===i(n))return n.test(e);if(n&&"function"===i(n))return n(e);throw new ReferenceError('Type test "'+t+'" not defined or invalid.')}},{}],49:[function(e,t,n){function i(e){return null===e||void 0===e}function o(e){return!(!e||"object"!=typeof e||"number"!=typeof e.length)&&("function"==typeof e.copy&&"function"==typeof e.slice&&!(e.length>0&&"number"!=typeof e[0]))}function r(e,t,n){var r,l;if(i(e)||i(t))return!1;if(e.prototype!==t.prototype)return!1;if(p(e))return!!p(t)&&(e=s.call(e),t=s.call(t),c(e,t,n));if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(r=0;r=0;r--)if(u[r]!=d[r])return!1;for(r=u.length-1;r>=0;r--)if(l=u[r],!c(e[l],t[l],n))return!1;return typeof e==typeof t}var s=Array.prototype.slice,a=e("./lib/keys.js"),p=e("./lib/is_arguments.js"),c=t.exports=function(e,t,n){return n||(n={}),e===t||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:r(e,t,n))}},{"./lib/is_arguments.js":50,"./lib/keys.js":51}],50:[function(e,t,n){function i(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var r="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();n=t.exports=r?i:o,n.supported=i,n.unsupported=o},{}],51:[function(e,t,n){function i(e){var t=[];for(var n in e)t.push(n);return t}n=t.exports="function"==typeof Object.keys?Object.keys:i,n.shim=i},{}],52:[function(e,t,n){"use strict";t.exports=e("./is-implemented")()?Object.assign:e("./shim")},{"./is-implemented":53,"./shim":54}],53:[function(e,t,n){"use strict";t.exports=function(){var e,t=Object.assign;return"function"==typeof t&&(e={foo:"raz"},t(e,{bar:"dwa"},{trzy:"trzy"}),e.foo+e.bar+e.trzy==="razdwatrzy")}},{}],54:[function(e,t,n){"use strict";var i=e("../keys"),o=e("../valid-value"),r=Math.max;t.exports=function(e,t){var n,s,a,p=r(arguments.length,2);for(e=Object(o(e)),a=function(i){try{e[i]=t[i]}catch(e){n||(n=e)}},s=1;s-1}},{}],65:[function(e,t,n){"use strict";var i,o,r,s,a,p,c,l=e("d"),u=e("es5-ext/object/valid-callable"),d=Function.prototype.apply,f=Function.prototype.call,y=Object.create,h=Object.defineProperty,m=Object.defineProperties,v=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};i=function(e,t){var n;return u(t),v.call(this,"__ee__")?n=this.__ee__:(n=g.value=y(null),h(this,"__ee__",g),g.value=null),n[e]?"object"==typeof n[e]?n[e].push(t):n[e]=[n[e],t]:n[e]=t,this},o=function(e,t){var n,o;return u(t),o=this,i.call(this,e,n=function(){r.call(o,e,n),d.call(t,this,arguments)}),n.__eeOnceListener__=t,this},r=function(e,t){var n,i,o,r;if(u(t),!v.call(this,"__ee__"))return this;if(n=this.__ee__,!n[e])return this;if(i=n[e],"object"==typeof i)for(r=0;o=i[r];++r)o!==t&&o.__eeOnceListener__!==t||(2===i.length?n[e]=i[r?0:1]:i.splice(r,1));else i!==t&&i.__eeOnceListener__!==t||delete n[e];return this},s=function(e){var t,n,i,o,r;if(v.call(this,"__ee__")&&(o=this.__ee__[e]))if("object"==typeof o){for(n=arguments.length,r=new Array(n-1),t=1;t0&&this._events[e].length>n&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())),this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!o(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},i.prototype.removeListener=function(e,t){var n,i,r,a;if(!o(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],r=n.length,i=-1,n===t||o(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(s(n)){for(a=r;a-- >0;)if(n[a]===t||n[a].listener&&n[a].listener===t){i=a;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},i.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],o(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},i.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?o(this._events[e])?[this._events[e]]:this._events[e].slice():[]},i.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(o(t))return 1;if(t)return t.length}return 0},i.listenerCount=function(e,t){return e.listenerCount(t)}},{}],67:[function(e,t,n){var i=e("http"),o=t.exports;for(var r in i)i.hasOwnProperty(r)&&(o[r]=i[r]);o.request=function(e,t){return e||(e={}),e.scheme="https",e.protocol="https:",i.request.call(this,e,t)}},{http:114}],68:[function(e,t,n){n.read=function(e,t,n,i,o){var r,s,a=8*o-i-1,p=(1<>1,l=-7,u=n?o-1:0,d=n?-1:1,f=e[t+u];for(u+=d,r=f&(1<<-l)-1,f>>=-l,l+=a;l>0;r=256*r+e[t+u],u+=d,l-=8);for(s=r&(1<<-l)-1,r>>=-l,l+=i;l>0;s=256*s+e[t+u],u+=d,l-=8);if(0===r)r=1-c;else{if(r===p)return s?NaN:(f?-1:1)*(1/0);s+=Math.pow(2,i),r-=c}return(f?-1:1)*s*Math.pow(2,r-i)},n.write=function(e,t,n,i,o,r){var s,a,p,c=8*r-o-1,l=(1<>1,d=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:r-1,y=i?1:-1,h=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(p=Math.pow(2,-s))<1&&(s--,p*=2),t+=s+u>=1?d/p:d*Math.pow(2,1-u),t*p>=2&&(s++,p/=2),s+u>=l?(a=0,s=l):s+u>=1?(a=(t*p-1)*Math.pow(2,o),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,o),s=0));o>=8;e[n+f]=255&a,f+=y,a/=256,o-=8);for(s=s<0;e[n+f]=255&s,f+=y,s/=256,c-=8);e[n+f-y]|=128*h}},{}],69:[function(e,t,n){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],70:[function(e,t,n){function i(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function o(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&i(e.slice(0,0))}t.exports=function(e){return null!=e&&(i(e)||o(e)||!!e._isBuffer)}},{}],71:[function(e,t,n){function i(e,t,n,i){return JSON.stringify(e,o(t,i),n)}function o(e,t){var n=[],i=[];return null==t&&(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+i.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,r){if(n.length>0){var s=n.indexOf(this);~s?n.splice(s+1):n.push(this),~s?i.splice(s,1/0,o):i.push(o),~n.indexOf(r)&&(r=t.call(this,o,r))}else n.push(r);return null==e?r:e.call(this,o,r)}}n=t.exports=i,n.getSerialize=o},{}],72:[function(t,n,i){(function(t){(function(){function o(e,t){return e.set(t[0],t[1]),e}function r(e,t){return e.add(t),e}function s(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function a(e,t,n,i){for(var o=-1,r=e?e.length:0;++o-1}function f(e,t,n){for(var i=-1,o=e?e.length:0;++i-1;);return n}function L(e,t){for(var n=e.length;n--&&R(t,e[n],0)>-1;);return n}function q(e,t){for(var n=e.length,i=0;n--;)e[n]===t&&i++;return i}function B(e){return"\\"+Gn[e]}function U(e,t){return null==e?ie:e[t]}function G(e){return _n.test(e)}function V(e){return Mn.test(e)}function z(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function H(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function K(e){var t=-1,n=Array(e.size);return e.forEach(function(e,i){n[++t]=[i,e]}),n}function W(e,t){return function(n){return e(t(n))}}function Y(e,t){for(var n=-1,i=e.length,o=0,r=[];++n-1}function tn(e,t){var n=this.__data__,i=wn(n,e);return i<0?n.push([e,t]):n[i][1]=t,this}function nn(e){var t=-1,n=e?e.length:0;for(this.clear();++t=t?e:t)),e}function In(e,t,n,i,o,r,s){var a;if(i&&(a=r?i(e,o,r,s):i(e)),a!==ie)return a;if(!Na(e))return e;var c=Gu(e);if(c){if(a=ur(e),!t)return To(e,a)}else{var l=Zl(e),u=l==Ue||l==Ge;if(zu(e))return fo(e,t);if(l==He||l==Ne||u&&!r){if(z(e))return r?e:{};if(a=dr(u?{}:e),!t)return Io(e,Pn(a,e))}else{if(!Ln[l])return r?e:{};a=fr(e,l,In,t)}}s||(s=new dn);var d=s.get(e);if(d)return d;if(s.set(e,a),!c)var f=n?er(e):gp(e);return p(f||e,function(o,r){f&&(r=o,o=e[r]),Cn(a,r,In(o,t,n,i,r,e,s))}),a}function On(e){var t=gp(e);return function(n){return kn(n,e,t)}}function kn(e,t,n){var i=n.length;if(null==e)return!i;for(e=qc(e);i--;){var o=n[i],r=t[o],s=e[o];if(s===ie&&!(o in e)||!r(s))return!1}return!0}function xn(e){return Na(e)?sl(e):{}}function _n(e,t,n){if("function"!=typeof e)throw new Gc(se);return nu(function(){e.apply(ie,n)},t)}function Mn(e,t,n,i){var o=-1,r=d,s=!0,a=e.length,p=[],c=t.length;if(!a)return p;n&&(t=y(t,M(n))),i?(r=f,s=!1):t.length>=re&&(r=N,s=!1,t=new cn(t));e:for(;++oo?0:o+n),i=i===ie||i>o?o:ep(i),i<0&&(i+=o),i=n>i?0:tp(i);n0&&n(a)?t>1?Hn(a,t-1,n,i,o):h(o,a):i||(o[o.length]=a)}return o}function Kn(e,t){return e&&Hl(e,t,gp)}function Yn(e,t){return e&&Kl(e,t,gp)}function Jn(e,t){return u(t,function(t){return _a(e[t])})}function $n(e,t){t=gr(t,e)?[t]:lo(t);for(var n=0,i=t.length;null!=e&&nt}function ui(e,t){return null!=e&&Jc.call(e,t)}function di(e,t){return null!=e&&t in qc(e)}function fi(e,t,n){return e>=Cl(t,n)&&e=120&&l.length>=120)?new cn(s&&l):ie}l=e[0];var u=-1,h=a[0];e:for(;++u-1;)a!==e&&pl.call(a,p,1),pl.call(e,p,1);return e}function Gi(e,t){for(var n=e?t.length:0,i=n-1;n--;){var o=t[n];if(n==i||o!==r){var r=o;if(mr(o))pl.call(e,o,1);else if(gr(o,e))delete e[Er(o)];else{var s=lo(o),a=Or(e,s);null!=a&&delete a[Er(Xr(s))]}}}return e}function Vi(e,t){ +return e+yl(Rl()*(t-e+1))}function zi(e,t,n,i){for(var o=-1,r=bl(fl((t-e)/(n||1)),0),s=Mc(r);r--;)s[i?r:++o]=e,e+=n;return s}function Hi(e,t){var n="";if(!e||t<1||t>je)return n;do t%2&&(n+=e),t=yl(t/2),t&&(e+=e);while(t);return n}function Ki(e,t){return t=bl(t===ie?e.length-1:t,0),function(){for(var n=arguments,i=-1,o=bl(n.length-t,0),r=Mc(o);++io?0:o+t),n=n>o?o:n,n<0&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var r=Mc(o);++i>>1,s=e[r];null!==s&&!Ya(s)&&(n?s<=t:s=re){var c=t?null:Jl(e);if(c)return J(c);s=!1,o=N,p=new cn}else p=t?[]:a;e:for(;++i=i?e:Yi(e,t,n)}function fo(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function yo(e){var t=new e.constructor(e.byteLength);return new il(t).set(new il(e)),t}function ho(e,t){var n=t?yo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function mo(e,t,n){var i=t?n(K(e),!0):K(e);return m(i,o,new e.constructor)}function vo(e){var t=new e.constructor(e.source,Ft.exec(e));return t.lastIndex=e.lastIndex,t}function go(e,t,n){var i=t?n(J(e),!0):J(e);return m(i,r,new e.constructor)}function Ao(e){return Ul?qc(Ul.call(e)):{}}function bo(e,t){var n=t?yo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Co(e,t){if(e!==t){var n=e!==ie,i=null===e,o=e===e,r=Ya(e),s=t!==ie,a=null===t,p=t===t,c=Ya(t);if(!a&&!c&&!r&&e>t||r&&s&&p&&!a&&!c||i&&s&&p||!n&&p||!o)return 1;if(!i&&!r&&!c&&e=a)return p;var c=n[i];return p*("desc"==c?-1:1)}}return e.index-t.index}function Ro(e,t,n,i){for(var o=-1,r=e.length,s=n.length,a=-1,p=t.length,c=bl(r-s,0),l=Mc(p+c),u=!i;++a1?n[o-1]:ie,s=o>2?n[2]:ie;for(r=e.length>3&&"function"==typeof r?(o--,r):ie,s&&vr(n[0],n[1],s)&&(r=o<3?ie:r,o=1),t=qc(t);++i-1?o[r?t[s]:s]:ie}}function Lo(e){return Ki(function(t){t=Hn(t,1);var n=t.length,o=n,r=i.prototype.thru;for(e&&t.reverse();o--;){var s=t[o];if("function"!=typeof s)throw new Gc(se);if(r&&!a&&"wrapper"==nr(s))var a=new i([],!0)}for(o=a?o:n;++o=re)return a.plant(i).value();for(var o=0,r=n?t[o].apply(this,e):i;++o1&&g.reverse(),u&&pa))return!1;var c=r.get(e);if(c&&r.get(t))return c==t;var l=-1,u=!0,d=o&Ae?new cn:ie;for(r.set(e,t),r.set(t,e);++l1?"& ":"")+t[i],t=t.join(n>2?", ":" "),e.replace(jt,"{\n/* [wrapped with "+t+"] */\n")}function hr(e){return Gu(e)||Ra(e)||!!(cl&&e&&e[cl])}function mr(e,t){return t=null==t?je:t,!!t&&("number"==typeof e||Ut.test(e))&&e>-1&&e%1==0&&e=this.__values__.length,t=e?ie:this.__values__[this.__index__++];return{done:e,value:t}}function _s(){return this}function Ms(e){for(var t,i=this;i instanceof n;){var o=_r(i);o.__index__=0,o.__values__=ie,t?r.__wrapped__=o:t=o;var r=o;i=i.__wrapped__}return r.__wrapped__=e,t}function Fs(){var e=this.__wrapped__;if(e instanceof A){var t=e;return this.__actions__.length&&(t=new A(this)),t=t.reverse(),t.__actions__.push({func:js,args:[rs],thisArg:ie}),new i(t,this.__chain__)}return this.thru(rs)}function Ns(){return ro(this.__wrapped__,this.__actions__)}function Ds(e,t,n){var i=Gu(e)?l:qn;return n&&vr(e,t,n)&&(t=ie),i(e,or(t,3))}function Ls(e,t){var n=Gu(e)?u:Gn;return n(e,or(t,3))}function qs(e,t){return Hn(Hs(e,t),1)}function Bs(e,t){return Hn(Hs(e,t),Oe)}function Us(e,t,n){return n=n===ie?1:ep(n),Hn(Hs(e,t),n)}function Gs(e,t){var n=Gu(e)?p:Vl;return n(e,or(t,3))}function Vs(e,t){var n=Gu(e)?c:zl;return n(e,or(t,3))}function zs(e,t,n,i){e=Pa(e)?e:kp(e),n=n&&!i?ep(n):0;var o=e.length;return n<0&&(n=bl(o+n,0)),Wa(e)?n<=o&&e.indexOf(t,n)>-1:!!o&&R(e,t,n)>-1}function Hs(e,t){var n=Gu(e)?y:ki;return n(e,or(t,3))}function Ks(e,t,n,i){return null==e?[]:(Gu(t)||(t=null==t?[]:[t]),n=i?ie:n,Gu(n)||(n=null==n?[]:[n]),Di(e,t,n))}function Ws(e,t,n){var i=Gu(e)?m:j,o=arguments.length<3;return i(e,or(t,4),n,o,Vl)}function Ys(e,t,n){var i=Gu(e)?v:j,o=arguments.length<3;return i(e,or(t,4),n,o,zl)}function Js(e,t){var n=Gu(e)?u:Gn;return n(e,ca(or(t,3)))}function Qs(e){var t=Pa(e)?e:kp(e),n=t.length;return n>0?t[Vi(0,n-1)]:ie}function $s(e,t,n){var i=-1,o=Xa(e),r=o.length,s=r-1;for(t=(n?vr(e,t,n):t===ie)?1:Sn(ep(t),0,r);++i0&&(n=t.apply(this,arguments)),e<=1&&(t=ie),n}}function oa(e,t,n){t=n?ie:t;var i=Qo(e,de,ie,ie,ie,ie,ie,t);return i.placeholder=oa.placeholder,i}function ra(e,t,n){t=n?ie:t;var i=Qo(e,fe,ie,ie,ie,ie,ie,t);return i.placeholder=ra.placeholder,i}function sa(e,t,n){function i(t){var n=d,i=f;return d=f=ie,g=t,h=e.apply(i,n)}function o(e){return g=e,m=nu(a,t),A?i(e):h}function r(e){var n=e-v,i=e-g,o=t-n;return b?Cl(o,y-i):o}function s(e){var n=e-v,i=e-g;return v===ie||n>=t||n<0||b&&i>=y}function a(){var e=ku();return s(e)?p(e):void(m=nu(a,r(e)))}function p(e){return m=ie,C&&d?i(e):(d=f=ie,h)}function c(){m!==ie&&Yl(m),g=0,d=v=f=m=ie}function l(){return m===ie?h:p(ku())}function u(){var e=ku(),n=s(e);if(d=arguments,f=this,v=e,n){if(m===ie)return o(v);if(b)return m=nu(a,t),i(v)}return m===ie&&(m=nu(a,t)),h}var d,f,y,h,m,v,g=0,A=!1,b=!1,C=!0;if("function"!=typeof e)throw new Gc(se);return t=np(t)||0,Na(n)&&(A=!!n.leading,b="maxWait"in n,y=b?bl(np(n.maxWait)||0,t):y,C="trailing"in n?!!n.trailing:C),u.cancel=c,u.flush=l,u}function aa(e){return Qo(e,ge)}function pa(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new Gc(se);var n=function(){var i=arguments,o=t?t.apply(this,i):i[0],r=n.cache;if(r.has(o))return r.get(o);var s=e.apply(this,i);return n.cache=r.set(o,s),s};return n.cache=new(pa.Cache||nn),n}function ca(e){if("function"!=typeof e)throw new Gc(se);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}function la(e){return ia(2,e)}function ua(e,t){if("function"!=typeof e)throw new Gc(se);return t=t===ie?t:ep(t),Ki(e,t)}function da(e,t){if("function"!=typeof e)throw new Gc(se);return t=t===ie?0:bl(ep(t),0),Ki(function(n){var i=n[t],o=uo(n,0,t);return i&&h(o,i),s(e,this,o)})}function fa(e,t,n){var i=!0,o=!0;if("function"!=typeof e)throw new Gc(se);return Na(n)&&(i="leading"in n?!!n.leading:i,o="trailing"in n?!!n.trailing:o),sa(e,t,{leading:i,maxWait:t,trailing:o})}function ya(e){return na(e,1)}function ha(e,t){return t=null==t?pc:t,Du(t,e)}function ma(){if(!arguments.length)return[];var e=arguments[0];return Gu(e)?e:[e]}function va(e){return In(e,!1,!0)}function ga(e,t){return In(e,!1,!0,t)}function Aa(e){return In(e,!0,!0)}function ba(e,t){return In(e,!0,!0,t)}function Ca(e,t){return null==t||kn(e,t,gp(t))}function wa(e,t){return e===t||e!==e&&t!==t}function Ra(e){return Ta(e)&&Jc.call(e,"callee")&&(!al.call(e,"callee")||Xc.call(e)==Ne)}function Pa(e){return null!=e&&Fa(e.length)&&!_a(e)}function Ta(e){return Da(e)&&Pa(e)}function Sa(e){return e===!0||e===!1||Da(e)&&Xc.call(e)==Le}function Ia(e){return!!e&&1===e.nodeType&&Da(e)&&!Ha(e)}function Oa(e){if(Pa(e)&&(Gu(e)||"string"==typeof e||"function"==typeof e.splice||zu(e)||Ra(e)))return!e.length;var t=Zl(e);if(t==Ve||t==Ye)return!e.size;if(_l||wr(e))return!Al(e).length;for(var n in e)if(Jc.call(e,n))return!1;return!0}function ja(e,t){return Ai(e,t)}function Ea(e,t,n){n="function"==typeof n?n:ie;var i=n?n(e,t):ie;return i===ie?Ai(e,t,n):!!i}function ka(e){return!!Da(e)&&(Xc.call(e)==Be||"string"==typeof e.message&&"string"==typeof e.name)}function xa(e){return"number"==typeof e&&vl(e)}function _a(e){var t=Na(e)?Xc.call(e):"";return t==Ue||t==Ge}function Ma(e){return"number"==typeof e&&e==ep(e)}function Fa(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=je}function Na(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Da(e){return!!e&&"object"==typeof e}function La(e,t){return e===t||wi(e,t,sr(t))}function qa(e,t,n){return n="function"==typeof n?n:ie,wi(e,t,sr(t),n)}function Ba(e){return za(e)&&e!=+e}function Ua(e){if(eu(e))throw new Nc("This method is not supported with core-js. Try https://github.com/es-shims.");return Ri(e)}function Ga(e){return null===e}function Va(e){return null==e}function za(e){return"number"==typeof e||Da(e)&&Xc.call(e)==ze}function Ha(e){if(!Da(e)||Xc.call(e)!=He||z(e))return!1;var t=ol(e);if(null===t)return!0;var n=Jc.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&Yc.call(n)==$c}function Ka(e){return Ma(e)&&e>=-je&&e<=je}function Wa(e){return"string"==typeof e||!Gu(e)&&Da(e)&&Xc.call(e)==Je}function Ya(e){return"symbol"==typeof e||Da(e)&&Xc.call(e)==Qe}function Ja(e){return e===ie}function Qa(e){return Da(e)&&Zl(e)==$e}function $a(e){return Da(e)&&Xc.call(e)==Xe}function Xa(e){if(!e)return[];if(Pa(e))return Wa(e)?X(e):To(e);if(rl&&e[rl])return H(e[rl]());var t=Zl(e),n=t==Ve?K:t==Ye?J:kp;return n(e)}function Za(e){if(!e)return 0===e?e:0;if(e=np(e),e===Oe||e===-Oe){var t=e<0?-1:1;return t*Ee}return e===e?e:0}function ep(e){var t=Za(e),n=t%1;return t===t?n?t-n:t:0}function tp(e){return e?Sn(ep(e),0,xe):0}function np(e){if("number"==typeof e)return e;if(Ya(e))return ke;if(Na(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Na(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(St,"");var n=Lt.test(e);return n||Bt.test(e)?zn(e.slice(2),n?2:8):Dt.test(e)?ke:+e}function ip(e){return So(e,Ap(e))}function op(e){return Sn(ep(e),-je,je)}function rp(e){return null==e?"":eo(e)}function sp(e,t){var n=xn(e);return t?Pn(n,t):n}function ap(e,t){return C(e,or(t,3),Kn)}function pp(e,t){return C(e,or(t,3),Yn)}function cp(e,t){return null==e?e:Hl(e,or(t,3),Ap)}function lp(e,t){return null==e?e:Kl(e,or(t,3),Ap)}function up(e,t){return e&&Kn(e,or(t,3))}function dp(e,t){return e&&Yn(e,or(t,3))}function fp(e){return null==e?[]:Jn(e,gp(e))}function yp(e){return null==e?[]:Jn(e,Ap(e))}function hp(e,t,n){var i=null==e?ie:$n(e,t);return i===ie?n:i}function mp(e,t){return null!=e&&lr(e,t,ui)}function vp(e,t){return null!=e&&lr(e,t,di)}function gp(e){return Pa(e)?gn(e):Oi(e)}function Ap(e){return Pa(e)?gn(e,!0):ji(e)}function bp(e,t){var n={};return t=or(t,3),Kn(e,function(e,i,o){n[t(e,i,o)]=e}),n}function Cp(e,t){var n={};return t=or(t,3),Kn(e,function(e,i,o){n[i]=t(e,i,o)}),n}function wp(e,t){return Rp(e,ca(or(t)))}function Rp(e,t){return null==e?{}:qi(e,tr(e),or(t))}function Pp(e,t,n){t=gr(t,e)?[t]:lo(t);var i=-1,o=t.length;for(o||(e=ie,o=1);++it){var i=e;e=t,t=i}if(n||e%1||t%1){var o=Rl();return Cl(e+o*(t-e+Vn("1e-"+((o+"").length-1))),t)}return Vi(e,t)}function Np(e){return Cd(rp(e).toLowerCase())}function Dp(e){return e=rp(e),e&&e.replace(Gt,si).replace(En,"")}function Lp(e,t,n){e=rp(e),t=eo(t);var i=e.length;n=n===ie?i:Sn(ep(n),0,i);var o=n;return n-=t.length,n>=0&&e.slice(n,o)==t}function qp(e){return e=rp(e),e&&mt.test(e)?e.replace(yt,ai):e}function Bp(e){return e=rp(e),e&&Tt.test(e)?e.replace(Pt,"\\$&"):e}function Up(e,t,n){e=rp(e),t=ep(t);var i=t?$(e):0;if(!t||i>=t)return e;var o=(t-i)/2;return Vo(yl(o),n)+e+Vo(fl(o),n)}function Gp(e,t,n){e=rp(e),t=ep(t);var i=t?$(e):0;return t&&i>>0)?(e=rp(e),e&&("string"==typeof t||null!=t&&!Wu(t))&&(t=eo(t),!t&&G(e))?uo(X(e),0,n):e.split(t,n)):[]}function Yp(e,t,n){return e=rp(e),n=Sn(ep(n),0,e.length),t=eo(t),e.slice(n,n+t.length)==t}function Jp(e,n,i){var o=t.templateSettings;i&&vr(e,n,i)&&(n=ie),e=rp(e),n=ed({},n,o,An);var r,s,a=ed({},n.imports,o.imports,An),p=gp(a),c=F(a,p),l=0,u=n.interpolate||Vt,d="__p += '",f=Bc((n.escape||Vt).source+"|"+u.source+"|"+(u===At?Mt:Vt).source+"|"+(n.evaluate||Vt).source+"|$","g"),y="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Nn+"]")+"\n";e.replace(f,function(t,n,i,o,a,p){return i||(i=o),d+=e.slice(l,p).replace(zt,B),n&&(r=!0,d+="' +\n__e("+n+") +\n'"),a&&(s=!0,d+="';\n"+a+";\n__p += '"),i&&(d+="' +\n((__t = ("+i+")) == null ? '' : __t) +\n'"),l=p+t.length,t}),d+="';\n";var h=n.variable;h||(d="with (obj) {\n"+d+"\n}\n"),d=(s?d.replace(lt,""):d).replace(ut,"$1").replace(dt,"$1;"),d="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var m=wd(function(){return Dc(p,y+"return "+d).apply(ie,c)});if(m.source=d,ka(m))throw m;return m}function Qp(e){return rp(e).toLowerCase()}function $p(e){return rp(e).toUpperCase()}function Xp(e,t,n){if(e=rp(e),e&&(n||t===ie))return e.replace(St,"");if(!e||!(t=eo(t)))return e;var i=X(e),o=X(t),r=D(i,o),s=L(i,o)+1;return uo(i,r,s).join("")}function Zp(e,t,n){if(e=rp(e),e&&(n||t===ie))return e.replace(Ot,"");if(!e||!(t=eo(t)))return e;var i=X(e),o=L(i,X(t))+1;return uo(i,0,o).join("")}function ec(e,t,n){if(e=rp(e),e&&(n||t===ie))return e.replace(It,"");if(!e||!(t=eo(t)))return e;var i=X(e),o=D(i,X(t));return uo(i,o).join("")}function tc(e,t){var n=Ce,i=we;if(Na(t)){var o="separator"in t?t.separator:o;n="length"in t?ep(t.length):n,i="omission"in t?eo(t.omission):i}e=rp(e);var r=e.length;if(G(e)){var s=X(e);r=s.length}if(n>=r)return e;var a=n-$(i);if(a<1)return i;var p=s?uo(s,0,a).join(""):e.slice(0,a);if(o===ie)return p+i;if(s&&(a+=p.length-a),Wu(o)){if(e.slice(a).search(o)){var c,l=p;for(o.global||(o=Bc(o.source,rp(Ft.exec(o))+"g")),o.lastIndex=0;c=o.exec(l);)var u=c.index;p=p.slice(0,u===ie?a:u)}}else if(e.indexOf(eo(o),a)!=a){var d=p.lastIndexOf(o);d>-1&&(p=p.slice(0,d))}return p+i}function nc(e){return e=rp(e),e&&ht.test(e)?e.replace(ft,pi):e}function ic(e,t,n){ +return e=rp(e),t=n?ie:t,t===ie?V(e)?te(e):b(e):e.match(t)||[]}function oc(e){var t=e?e.length:0,n=or();return e=t?y(e,function(e){if("function"!=typeof e[1])throw new Gc(se);return[n(e[0]),e[1]]}):[],Ki(function(n){for(var i=-1;++ije)return[];var n=xe,i=Cl(e,xe);t=or(t),e-=xe;for(var o=x(i,t);++n2?e:ie}(),xl=jl&&new jl,_l=!al.call({valueOf:1},"valueOf"),Ml={},Fl=kr(Tl),Nl=kr(Sl),Dl=kr(Il),Ll=kr(Ol),ql=kr(jl),Bl=nl?nl.prototype:ie,Ul=Bl?Bl.valueOf:ie,Gl=Bl?Bl.toString:ie;t.templateSettings={escape:vt,evaluate:gt,interpolate:At,variable:"",imports:{_:t}},t.prototype=n.prototype,t.prototype.constructor=t,i.prototype=xn(n.prototype),i.prototype.constructor=i,A.prototype=xn(n.prototype),A.prototype.constructor=A,xt.prototype.clear=Ht,xt.prototype.delete=Kt,xt.prototype.get=Wt,xt.prototype.has=Yt,xt.prototype.set=Jt,Qt.prototype.clear=$t,Qt.prototype.delete=Xt,Qt.prototype.get=Zt,Qt.prototype.has=en,Qt.prototype.set=tn,nn.prototype.clear=on,nn.prototype.delete=rn,nn.prototype.get=sn,nn.prototype.has=an,nn.prototype.set=pn,cn.prototype.add=cn.prototype.push=ln,cn.prototype.has=un,dn.prototype.clear=fn,dn.prototype.delete=yn,dn.prototype.get=hn,dn.prototype.has=mn,dn.prototype.set=vn;var Vl=Eo(Kn),zl=Eo(Yn,!0),Hl=ko(),Kl=ko(!0),Wl=xl?function(e,t){return xl.set(e,t),e}:pc,Yl=ll||function(e){return Wn.clearTimeout(e)},Jl=Ol&&1/J(new Ol([,-0]))[1]==Oe?function(e){return new Ol(e)}:yc,Ql=xl?function(e){return xl.get(e)}:yc,$l=hl?W(hl,qc):gc,Xl=hl?function(e){for(var t=[];e;)h(t,$l(e)),e=ol(e);return t}:gc,Zl=ri;(Tl&&Zl(new Tl(new ArrayBuffer(1)))!=et||Sl&&Zl(new Sl)!=Ve||Il&&Zl(Il.resolve())!=Ke||Ol&&Zl(new Ol)!=Ye||jl&&Zl(new jl)!=$e)&&(Zl=function(e){var t=Xc.call(e),n=t==He?e.constructor:ie,i=n?kr(n):ie;if(i)switch(i){case Fl:return et;case Nl:return Ve;case Dl:return Ke;case Ll:return Ye;case ql:return $e}return t});var eu=Kc?_a:Ac,tu=function(){var e=0,t=0;return function(n,i){var o=ku(),r=Pe-(o-t);if(t=o,r>0){if(++e>=Re)return n}else e=0;return Wl(n,i)}}(),nu=dl||function(e,t){return Wn.setTimeout(e,t)},iu=kl?function(e,t,n){var i=t+"";return kl(e,"toString",{configurable:!0,enumerable:!1,value:sc(yr(i,xr(cr(i),n)))})}:pc,ou=pa(function(e){e=rp(e);var t=[];return wt.test(e)&&t.push(""),e.replace(Rt,function(e,n,i,o){t.push(i?o.replace(_t,"$1"):n||e)}),t}),ru=Ki(function(e,t){return Ta(e)?Mn(e,Hn(t,1,Ta,!0)):[]}),su=Ki(function(e,t){var n=Xr(t);return Ta(n)&&(n=ie),Ta(e)?Mn(e,Hn(t,1,Ta,!0),or(n,2)):[]}),au=Ki(function(e,t){var n=Xr(t);return Ta(n)&&(n=ie),Ta(e)?Mn(e,Hn(t,1,Ta,!0),ie,n):[]}),pu=Ki(function(e){var t=y(e,po);return t.length&&t[0]===e[0]?yi(t):[]}),cu=Ki(function(e){var t=Xr(e),n=y(e,po);return t===Xr(n)?t=ie:n.pop(),n.length&&n[0]===e[0]?yi(n,or(t,2)):[]}),lu=Ki(function(e){var t=Xr(e),n=y(e,po);return t===Xr(n)?t=ie:n.pop(),n.length&&n[0]===e[0]?yi(n,ie,t):[]}),uu=Ki(ts),du=Ki(function(e,t){t=Hn(t,1);var n=e?e.length:0,i=Tn(e,t);return Gi(e,y(t,function(e){return mr(e,n)?+e:e}).sort(Co)),i}),fu=Ki(function(e){return to(Hn(e,1,Ta,!0))}),yu=Ki(function(e){var t=Xr(e);return Ta(t)&&(t=ie),to(Hn(e,1,Ta,!0),or(t,2))}),hu=Ki(function(e){var t=Xr(e);return Ta(t)&&(t=ie),to(Hn(e,1,Ta,!0),ie,t)}),mu=Ki(function(e,t){return Ta(e)?Mn(e,t):[]}),vu=Ki(function(e){return so(u(e,Ta))}),gu=Ki(function(e){var t=Xr(e);return Ta(t)&&(t=ie),so(u(e,Ta),or(t,2))}),Au=Ki(function(e){var t=Xr(e);return Ta(t)&&(t=ie),so(u(e,Ta),ie,t)}),bu=Ki(Rs),Cu=Ki(function(e){var t=e.length,n=t>1?e[t-1]:ie;return n="function"==typeof n?(e.pop(),n):ie,Ps(e,n)}),wu=Ki(function(e){e=Hn(e,1);var t=e.length,n=t?e[0]:0,o=this.__wrapped__,r=function(t){return Tn(t,e)};return!(t>1||this.__actions__.length)&&o instanceof A&&mr(n)?(o=o.slice(n,+n+(t?1:0)),o.__actions__.push({func:js,args:[r],thisArg:ie}),new i(o,this.__chain__).thru(function(e){return t&&!e.length&&e.push(ie),e})):this.thru(r)}),Ru=Oo(function(e,t,n){Jc.call(e,n)?++e[n]:e[n]=1}),Pu=Do(Gr),Tu=Do(Vr),Su=Oo(function(e,t,n){Jc.call(e,n)?e[n].push(t):e[n]=[t]}),Iu=Ki(function(e,t,n){var i=-1,o="function"==typeof t,r=gr(t),a=Pa(e)?Mc(e.length):[];return Vl(e,function(e){var p=o?t:r&&null!=e?e[t]:ie;a[++i]=p?s(p,e,n):mi(e,t,n)}),a}),Ou=Oo(function(e,t,n){e[n]=t}),ju=Oo(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),Eu=Ki(function(e,t){if(null==e)return[];var n=t.length;return n>1&&vr(e,t[0],t[1])?t=[]:n>2&&vr(t[0],t[1],t[2])&&(t=[t[0]]),Di(e,Hn(t,1),[])}),ku=ul||function(){return Wn.Date.now()},xu=Ki(function(e,t,n){var i=ce;if(n.length){var o=Y(n,ir(xu));i|=ye}return Qo(e,i,t,n,o)}),_u=Ki(function(e,t,n){var i=ce|le;if(n.length){var o=Y(n,ir(_u));i|=ye}return Qo(t,i,e,n,o)}),Mu=Ki(function(e,t){return _n(e,1,t)}),Fu=Ki(function(e,t,n){return _n(e,np(t)||0,n)});pa.Cache=nn;var Nu=Ki(function(e,t){t=1==t.length&&Gu(t[0])?y(t[0],M(or())):y(Hn(t,1),M(or()));var n=t.length;return Ki(function(i){for(var o=-1,r=Cl(i.length,n);++o=t}),Gu=Mc.isArray,Vu=Zn?M(Zn):vi,zu=ml||Ac,Hu=ei?M(ei):gi,Ku=ti?M(ti):Ci,Wu=ni?M(ni):Pi,Yu=ii?M(ii):Ti,Ju=oi?M(oi):Si,Qu=Ko(Ei),$u=Ko(function(e,t){return e<=t}),Xu=jo(function(e,t){if(_l||wr(t)||Pa(t))return void So(t,gp(t),e);for(var n in t)Jc.call(t,n)&&Cn(e,n,t[n])}),Zu=jo(function(e,t){So(t,Ap(t),e)}),ed=jo(function(e,t,n,i){So(t,Ap(t),e,i)}),td=jo(function(e,t,n,i){So(t,gp(t),e,i)}),nd=Ki(function(e,t){return Tn(e,Hn(t,1))}),id=Ki(function(e){return e.push(ie,An),s(ed,ie,e)}),od=Ki(function(e){return e.push(ie,Sr),s(cd,ie,e)}),rd=Bo(function(e,t,n){e[t]=n},sc(pc)),sd=Bo(function(e,t,n){Jc.call(e,t)?e[t].push(n):e[t]=[n]},or),ad=Ki(mi),pd=jo(function(e,t,n){Mi(e,t,n)}),cd=jo(function(e,t,n,i){Mi(e,t,n,i)}),ld=Ki(function(e,t){return null==e?{}:(t=y(Hn(t,1),Er),Li(e,Mn(tr(e),t)))}),ud=Ki(function(e,t){return null==e?{}:Li(e,y(Hn(t,1),Er))}),dd=Jo(gp),fd=Jo(Ap),yd=Mo(function(e,t,n){return t=t.toLowerCase(),e+(n?Np(t):t)}),hd=Mo(function(e,t,n){return e+(n?"-":"")+t.toLowerCase()}),md=Mo(function(e,t,n){return e+(n?" ":"")+t.toLowerCase()}),vd=_o("toLowerCase"),gd=Mo(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),Ad=Mo(function(e,t,n){return e+(n?" ":"")+Cd(t)}),bd=Mo(function(e,t,n){return e+(n?" ":"")+t.toUpperCase()}),Cd=_o("toUpperCase"),wd=Ki(function(e,t){try{return s(e,ie,t)}catch(e){return ka(e)?e:new Nc(e)}}),Rd=Ki(function(e,t){return p(Hn(t,1),function(t){t=Er(t),e[t]=xu(e[t],e)}),e}),Pd=Lo(),Td=Lo(!0),Sd=Ki(function(e,t){return function(n){return mi(n,e,t)}}),Id=Ki(function(e,t){return function(n){return mi(e,n,t)}}),Od=Go(y),jd=Go(l),Ed=Go(g),kd=Ho(),xd=Ho(!0),_d=Uo(function(e,t){return e+t},0),Md=Yo("ceil"),Fd=Uo(function(e,t){return e/t},1),Nd=Yo("floor"),Dd=Uo(function(e,t){return e*t},1),Ld=Yo("round"),qd=Uo(function(e,t){return e-t},0);return t.after=ta,t.ary=na,t.assign=Xu,t.assignIn=Zu,t.assignInWith=ed,t.assignWith=td,t.at=nd,t.before=ia,t.bind=xu,t.bindAll=Rd,t.bindKey=_u,t.castArray=ma,t.chain=Is,t.chunk=Mr,t.compact=Fr,t.concat=Nr,t.cond=oc,t.conforms=rc,t.constant=sc,t.countBy=Ru,t.create=sp,t.curry=oa,t.curryRight=ra,t.debounce=sa,t.defaults=id,t.defaultsDeep=od,t.defer=Mu,t.delay=Fu,t.difference=ru,t.differenceBy=su,t.differenceWith=au,t.drop=Dr,t.dropRight=Lr,t.dropRightWhile=qr,t.dropWhile=Br,t.fill=Ur,t.filter=Ls,t.flatMap=qs,t.flatMapDeep=Bs,t.flatMapDepth=Us,t.flatten=zr,t.flattenDeep=Hr,t.flattenDepth=Kr,t.flip=aa,t.flow=Pd,t.flowRight=Td,t.fromPairs=Wr,t.functions=fp,t.functionsIn=yp,t.groupBy=Su,t.initial=Qr,t.intersection=pu,t.intersectionBy=cu,t.intersectionWith=lu,t.invert=rd,t.invertBy=sd,t.invokeMap=Iu,t.iteratee=cc,t.keyBy=Ou,t.keys=gp,t.keysIn=Ap,t.map=Hs,t.mapKeys=bp,t.mapValues=Cp,t.matches=lc,t.matchesProperty=uc,t.memoize=pa,t.merge=pd,t.mergeWith=cd,t.method=Sd,t.methodOf=Id,t.mixin=dc,t.negate=ca,t.nthArg=hc,t.omit=ld,t.omitBy=wp,t.once=la,t.orderBy=Ks,t.over=Od,t.overArgs=Nu,t.overEvery=jd,t.overSome=Ed,t.partial=Du,t.partialRight=Lu,t.partition=ju,t.pick=ud,t.pickBy=Rp,t.property=mc,t.propertyOf=vc,t.pull=uu,t.pullAll=ts,t.pullAllBy=ns,t.pullAllWith=is,t.pullAt=du,t.range=kd,t.rangeRight=xd,t.rearg=qu,t.reject=Js,t.remove=os,t.rest=ua,t.reverse=rs,t.sampleSize=$s,t.set=Tp,t.setWith=Sp,t.shuffle=Xs,t.slice=ss,t.sortBy=Eu,t.sortedUniq=fs,t.sortedUniqBy=ys,t.split=Wp,t.spread=da,t.tail=hs,t.take=ms,t.takeRight=vs,t.takeRightWhile=gs,t.takeWhile=As,t.tap=Os,t.throttle=fa,t.thru=js,t.toArray=Xa,t.toPairs=dd,t.toPairsIn=fd,t.toPath=Pc,t.toPlainObject=ip,t.transform=Ip,t.unary=ya,t.union=fu,t.unionBy=yu,t.unionWith=hu,t.uniq=bs,t.uniqBy=Cs,t.uniqWith=ws,t.unset=Op,t.unzip=Rs,t.unzipWith=Ps,t.update=jp,t.updateWith=Ep,t.values=kp,t.valuesIn=xp,t.without=mu,t.words=ic,t.wrap=ha,t.xor=vu,t.xorBy=gu,t.xorWith=Au,t.zip=bu,t.zipObject=Ts,t.zipObjectDeep=Ss,t.zipWith=Cu,t.entries=dd,t.entriesIn=fd,t.extend=Zu,t.extendWith=ed,dc(t,t),t.add=_d,t.attempt=wd,t.camelCase=yd,t.capitalize=Np,t.ceil=Md,t.clamp=_p,t.clone=va,t.cloneDeep=Aa,t.cloneDeepWith=ba,t.cloneWith=ga,t.conformsTo=Ca,t.deburr=Dp,t.defaultTo=ac,t.divide=Fd,t.endsWith=Lp,t.eq=wa,t.escape=qp,t.escapeRegExp=Bp,t.every=Ds,t.find=Pu,t.findIndex=Gr,t.findKey=ap,t.findLast=Tu,t.findLastIndex=Vr,t.findLastKey=pp,t.floor=Nd,t.forEach=Gs,t.forEachRight=Vs,t.forIn=cp,t.forInRight=lp,t.forOwn=up,t.forOwnRight=dp,t.get=hp,t.gt=Bu,t.gte=Uu,t.has=mp,t.hasIn=vp,t.head=Yr,t.identity=pc,t.includes=zs,t.indexOf=Jr,t.inRange=Mp,t.invoke=ad,t.isArguments=Ra,t.isArray=Gu,t.isArrayBuffer=Vu,t.isArrayLike=Pa,t.isArrayLikeObject=Ta,t.isBoolean=Sa,t.isBuffer=zu,t.isDate=Hu,t.isElement=Ia,t.isEmpty=Oa,t.isEqual=ja,t.isEqualWith=Ea,t.isError=ka,t.isFinite=xa,t.isFunction=_a,t.isInteger=Ma,t.isLength=Fa,t.isMap=Ku,t.isMatch=La,t.isMatchWith=qa,t.isNaN=Ba,t.isNative=Ua,t.isNil=Va,t.isNull=Ga,t.isNumber=za,t.isObject=Na,t.isObjectLike=Da,t.isPlainObject=Ha,t.isRegExp=Wu,t.isSafeInteger=Ka,t.isSet=Yu,t.isString=Wa,t.isSymbol=Ya,t.isTypedArray=Ju,t.isUndefined=Ja,t.isWeakMap=Qa,t.isWeakSet=$a,t.join=$r,t.kebabCase=hd,t.last=Xr,t.lastIndexOf=Zr,t.lowerCase=md,t.lowerFirst=vd,t.lt=Qu,t.lte=$u,t.max=Sc,t.maxBy=Ic,t.mean=Oc,t.meanBy=jc,t.min=Ec,t.minBy=kc,t.stubArray=gc,t.stubFalse=Ac,t.stubObject=bc,t.stubString=Cc,t.stubTrue=wc,t.multiply=Dd,t.nth=es,t.noConflict=fc,t.noop=yc,t.now=ku,t.pad=Up,t.padEnd=Gp,t.padStart=Vp,t.parseInt=zp,t.random=Fp,t.reduce=Ws,t.reduceRight=Ys,t.repeat=Hp,t.replace=Kp,t.result=Pp,t.round=Ld,t.runInContext=ne,t.sample=Qs,t.size=Zs,t.snakeCase=gd,t.some=ea,t.sortedIndex=as,t.sortedIndexBy=ps,t.sortedIndexOf=cs,t.sortedLastIndex=ls,t.sortedLastIndexBy=us,t.sortedLastIndexOf=ds,t.startCase=Ad,t.startsWith=Yp,t.subtract=qd,t.sum=xc,t.sumBy=_c,t.template=Jp,t.times=Rc,t.toFinite=Za,t.toInteger=ep,t.toLength=tp,t.toLower=Qp,t.toNumber=np,t.toSafeInteger=op,t.toString=rp,t.toUpper=$p,t.trim=Xp,t.trimEnd=Zp,t.trimStart=ec,t.truncate=tc,t.unescape=nc,t.uniqueId=Tc,t.upperCase=bd,t.upperFirst=Cd,t.each=Gs,t.eachRight=Vs,t.first=Yr,dc(t,function(){var e={};return Kn(t,function(n,i){Jc.call(t.prototype,i)||(e[i]=n)}),e}(),{chain:!1}),t.VERSION=oe,p(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){t[e].placeholder=t}),p(["drop","take"],function(e,t){A.prototype[e]=function(n){var i=this.__filtered__;if(i&&!t)return new A(this);n=n===ie?1:bl(ep(n),0);var o=this.clone();return i?o.__takeCount__=Cl(n,o.__takeCount__):o.__views__.push({size:Cl(n,xe),type:e+(o.__dir__<0?"Right":"")}),o},A.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),p(["filter","map","takeWhile"],function(e,t){var n=t+1,i=n==Te||n==Ie;A.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:or(e,3),type:n}),t.__filtered__=t.__filtered__||i,t}}),p(["head","last"],function(e,t){var n="take"+(t?"Right":"");A.prototype[e]=function(){return this[n](1).value()[0]}}),p(["initial","tail"],function(e,t){var n="drop"+(t?"":"Right");A.prototype[e]=function(){return this.__filtered__?new A(this):this[n](1)}}),A.prototype.compact=function(){return this.filter(pc)},A.prototype.find=function(e){return this.filter(e).head()},A.prototype.findLast=function(e){return this.reverse().find(e)},A.prototype.invokeMap=Ki(function(e,t){return"function"==typeof e?new A(this):this.map(function(n){return mi(n,e,t)})}),A.prototype.reject=function(e){return this.filter(ca(or(e)))},A.prototype.slice=function(e,t){e=ep(e);var n=this;return n.__filtered__&&(e>0||t<0)?new A(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==ie&&(t=ep(t),n=t<0?n.dropRight(-t):n.take(t-e)),n)},A.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},A.prototype.toArray=function(){return this.take(xe)},Kn(A.prototype,function(e,n){var o=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),s=t[r?"take"+("last"==n?"Right":""):n],a=r||/^find/.test(n);s&&(t.prototype[n]=function(){var n=this.__wrapped__,p=r?[1]:arguments,c=n instanceof A,l=p[0],u=c||Gu(n),d=function(e){var n=s.apply(t,h([e],p));return r&&f?n[0]:n};u&&o&&"function"==typeof l&&1!=l.length&&(c=u=!1);var f=this.__chain__,y=!!this.__actions__.length,m=a&&!f,v=c&&!y;if(!a&&u){n=v?n:new A(this);var g=e.apply(n,p);return g.__actions__.push({func:js,args:[d],thisArg:ie}),new i(g,f)}return m&&v?e.apply(this,p):(g=this.thru(d),m?r?g.value()[0]:g.value():g)})}),p(["pop","push","shift","sort","splice","unshift"],function(e){var n=Vc[e],i=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);t.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var t=this.value();return n.apply(Gu(t)?t:[],e)}return this[i](function(t){return n.apply(Gu(t)?t:[],e)})}}),Kn(A.prototype,function(e,n){var i=t[n];if(i){var o=i.name+"",r=Ml[o]||(Ml[o]=[]);r.push({name:n,func:i})}}),Ml[qo(ie,le).name]=[{name:"wrapper",func:ie}],A.prototype.clone=O,A.prototype.reverse=Z,A.prototype.value=ee,t.prototype.at=wu,t.prototype.chain=Es,t.prototype.commit=ks,t.prototype.next=xs,t.prototype.plant=Ms,t.prototype.reverse=Fs,t.prototype.toJSON=t.prototype.valueOf=t.prototype.value=Ns,t.prototype.first=t.prototype.head,rl&&(t.prototype[rl]=_s),t}var ie,oe="4.15.0",re=200,se="Expected a function",ae="__lodash_hash_undefined__",pe="__lodash_placeholder__",ce=1,le=2,ue=4,de=8,fe=16,ye=32,he=64,me=128,ve=256,ge=512,Ae=1,be=2,Ce=30,we="...",Re=150,Pe=16,Te=1,Se=2,Ie=3,Oe=1/0,je=9007199254740991,Ee=1.7976931348623157e308,ke=NaN,xe=4294967295,_e=xe-1,Me=xe>>>1,Fe=[["ary",me],["bind",ce],["bindKey",le],["curry",de],["curryRight",fe],["flip",ge],["partial",ye],["partialRight",he],["rearg",ve]],Ne="[object Arguments]",De="[object Array]",Le="[object Boolean]",qe="[object Date]",Be="[object Error]",Ue="[object Function]",Ge="[object GeneratorFunction]",Ve="[object Map]",ze="[object Number]",He="[object Object]",Ke="[object Promise]",We="[object RegExp]",Ye="[object Set]",Je="[object String]",Qe="[object Symbol]",$e="[object WeakMap]",Xe="[object WeakSet]",Ze="[object ArrayBuffer]",et="[object DataView]",tt="[object Float32Array]",nt="[object Float64Array]",it="[object Int8Array]",ot="[object Int16Array]",rt="[object Int32Array]",st="[object Uint8Array]",at="[object Uint8ClampedArray]",pt="[object Uint16Array]",ct="[object Uint32Array]",lt=/\b__p \+= '';/g,ut=/\b(__p \+=) '' \+/g,dt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ft=/&(?:amp|lt|gt|quot|#39|#96);/g,yt=/[&<>"'`]/g,ht=RegExp(ft.source),mt=RegExp(yt.source),vt=/<%-([\s\S]+?)%>/g,gt=/<%([\s\S]+?)%>/g,At=/<%=([\s\S]+?)%>/g,bt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ct=/^\w*$/,wt=/^\./,Rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pt=/[\\^$.*+?()[\]{}|]/g,Tt=RegExp(Pt.source),St=/^\s+|\s+$/g,It=/^\s+/,Ot=/\s+$/,jt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Et=/\{\n\/\* \[wrapped with (.+)\] \*/,kt=/,? & /,xt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,_t=/\\(\\)?/g,Mt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ft=/\w*$/,Nt=/^0x/i,Dt=/^[-+]0x[0-9a-f]+$/i,Lt=/^0b[01]+$/i,qt=/^\[object .+?Constructor\]$/,Bt=/^0o[0-7]+$/i,Ut=/^(?:0|[1-9]\d*)$/,Gt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vt=/($^)/,zt=/['\n\r\u2028\u2029\\]/g,Ht="\\ud800-\\udfff",Kt="\\u0300-\\u036f\\ufe20-\\ufe23",Wt="\\u20d0-\\u20f0",Yt="\\u2700-\\u27bf",Jt="a-z\\xdf-\\xf6\\xf8-\\xff",Qt="\\xac\\xb1\\xd7\\xf7",$t="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Xt="\\u2000-\\u206f",Zt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",en="A-Z\\xc0-\\xd6\\xd8-\\xde",tn="\\ufe0e\\ufe0f",nn=Qt+$t+Xt+Zt,on="['’]",rn="["+Ht+"]",sn="["+nn+"]",an="["+Kt+Wt+"]",pn="\\d+",cn="["+Yt+"]",ln="["+Jt+"]",un="[^"+Ht+nn+pn+Yt+Jt+en+"]",dn="\\ud83c[\\udffb-\\udfff]",fn="(?:"+an+"|"+dn+")",yn="[^"+Ht+"]",hn="(?:\\ud83c[\\udde6-\\uddff]){2}",mn="[\\ud800-\\udbff][\\udc00-\\udfff]",vn="["+en+"]",gn="\\u200d",An="(?:"+ln+"|"+un+")",bn="(?:"+vn+"|"+un+")",Cn="(?:"+on+"(?:d|ll|m|re|s|t|ve))?",wn="(?:"+on+"(?:D|LL|M|RE|S|T|VE))?",Rn=fn+"?",Pn="["+tn+"]?",Tn="(?:"+gn+"(?:"+[yn,hn,mn].join("|")+")"+Pn+Rn+")*",Sn=Pn+Rn+Tn,In="(?:"+[cn,hn,mn].join("|")+")"+Sn,On="(?:"+[yn+an+"?",an,hn,mn,rn].join("|")+")",jn=RegExp(on,"g"),En=RegExp(an,"g"),kn=RegExp(dn+"(?="+dn+")|"+On+Sn,"g"),xn=RegExp([vn+"?"+ln+"+"+Cn+"(?="+[sn,vn,"$"].join("|")+")",bn+"+"+wn+"(?="+[sn,vn+An,"$"].join("|")+")",vn+"?"+An+"+"+Cn,vn+"+"+wn,pn,In].join("|"),"g"),_n=RegExp("["+gn+Ht+Kt+Wt+tn+"]"),Mn=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Fn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Nn=-1,Dn={};Dn[tt]=Dn[nt]=Dn[it]=Dn[ot]=Dn[rt]=Dn[st]=Dn[at]=Dn[pt]=Dn[ct]=!0,Dn[Ne]=Dn[De]=Dn[Ze]=Dn[Le]=Dn[et]=Dn[qe]=Dn[Be]=Dn[Ue]=Dn[Ve]=Dn[ze]=Dn[He]=Dn[We]=Dn[Ye]=Dn[Je]=Dn[$e]=!1;var Ln={};Ln[Ne]=Ln[De]=Ln[Ze]=Ln[et]=Ln[Le]=Ln[qe]=Ln[tt]=Ln[nt]=Ln[it]=Ln[ot]=Ln[rt]=Ln[Ve]=Ln[ze]=Ln[He]=Ln[We]=Ln[Ye]=Ln[Je]=Ln[Qe]=Ln[st]=Ln[at]=Ln[pt]=Ln[ct]=!0,Ln[Be]=Ln[Ue]=Ln[$e]=!1;var qn={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"ss"},Bn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Un={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Gn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Vn=parseFloat,zn=parseInt,Hn="object"==typeof t&&t&&t.Object===Object&&t,Kn="object"==typeof self&&self&&self.Object===Object&&self,Wn=Hn||Kn||Function("return this")(),Yn="object"==typeof i&&i&&!i.nodeType&&i,Jn=Yn&&"object"==typeof n&&n&&!n.nodeType&&n,Qn=Jn&&Jn.exports===Yn,$n=Qn&&Hn.process,Xn=function(){try{return $n&&$n.binding("util")}catch(e){}}(),Zn=Xn&&Xn.isArrayBuffer,ei=Xn&&Xn.isDate,ti=Xn&&Xn.isMap,ni=Xn&&Xn.isRegExp,ii=Xn&&Xn.isSet,oi=Xn&&Xn.isTypedArray,ri=I("length"),si=O(qn),ai=O(Bn),pi=O(Un),ci=ne();"function"==typeof e&&"object"==typeof e.amd&&e.amd?(Wn._=ci,e(function(){return ci})):Jn?((Jn.exports=ci)._=ci,Yn._=ci):Wn._=ci}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],73:[function(e,t,n){(function(n){function i(e,t,a,p){"function"==typeof t?(a=t,t={}):t&&"object"==typeof t||(t={mode:t});var c=t.mode,l=t.fs||r;void 0===c&&(c=s&~n.umask()),p||(p=null);var u=a||function(){};e=o.resolve(e),l.mkdir(e,c,function(n){if(!n)return p=p||e,u(null,p);switch(n.code){case"ENOENT":i(o.dirname(e),t,function(n,o){n?u(n,o):i(e,t,u,o)});break;default:l.stat(e,function(e,t){e||!t.isDirectory()?u(n,p):u(null,p)})}})}var o=e("path"),r=e("fs"),s=parseInt("0777",8);t.exports=i.mkdirp=i.mkdirP=i,i.sync=function e(t,i,a){i&&"object"==typeof i||(i={mode:i});var p=i.mode,c=i.fs||r;void 0===p&&(p=s&~n.umask()),a||(a=null),t=o.resolve(t);try{c.mkdirSync(t,p),a=a||t}catch(n){switch(n.code){case"ENOENT":a=e(o.dirname(t),i,a),e(t,i,a);break;default:var l;try{l=c.statSync(t)}catch(e){throw n}if(!l.isDirectory())throw n}}return a}}).call(this,e("_process"))},{_process:94,fs:6,path:92}],74:[function(e,t,n){function i(e){if(e=""+e,!(e.length>1e4)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return n*u;case"days":case"day":case"d":return n*l;case"hours":case"hour":case"hrs":case"hr":case"h":return n*c;case"minutes":case"minute":case"mins":case"min":case"m":return n*p;case"seconds":case"second":case"secs":case"sec":case"s":return n*a;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n}}}}function o(e){return e>=l?Math.round(e/l)+"d":e>=c?Math.round(e/c)+"h":e>=p?Math.round(e/p)+"m":e>=a?Math.round(e/a)+"s":e+"ms"}function r(e){return s(e,l,"day")||s(e,c,"hour")||s(e,p,"minute")||s(e,a,"second")||e+" ms"}function s(e,t,n){if(!(e0)){var t=e.basePath,n=M[t]&&M[t].scopes||[];n.some(function(t,i){return t===e&&n.splice(i,1)})}}function u(){M={}}function d(e){var t,n;return w.normalizeRequestOptions(e),O("interceptors for %j",e.host),t=e.proto+"://"+e.host,O("filtering interceptors for basepath",t),I.each(M,function(e,i){return I.each(e.scopes,function(i){var o=i.__nock_scopeOptions.filteringScope;if(o&&o(t))return O("found matching scope interceptor"),i.__nock_filteredScope=i.__nock_scopeKey,n=e.scopes,!1}),!n&&w.matchStringOrRegexp(t,e.key)?(n=e.scopes,!1):!n}),n}function f(e){var t,n,i,o;if(e instanceof P?(t=e.basePath,n=e._key):(o=e.proto?e.proto:"http",w.normalizeRequestOptions(e),t=o+"://"+e.host,i=e.method&&e.method.toUpperCase()||"GET",n=i+" "+t+(e.path||"/")),M[t]&&M[t].scopes.length>0){if(n){for(var r=0;r0)&&this.filePath&&(this.body=o.createReadStream(this.filePath),this.body.pause()),!this.scope.shouldPersist()&&this.counter<1&&this.scope.remove(this._key,this)},i.prototype.matchHeader=function(e,t){return this.interceptorMatchHeaders.push({name:e,value:t}),this},i.prototype.basicAuth=function(e){var t=e.user,i=e.pass||"",o="authorization",r="Basic "+new n(t+":"+i).toString("base64");return this.interceptorMatchHeaders.push({name:o,value:r}),this},i.prototype.query=function(e){if(this.queries=this.queries||{},e===!0&&(this.queries=e),p.isFunction(e))return this.queries=e,this;for(var t in e)if(p.isUndefined(this.queries[t])){var n=e[t],i=a.formatQueryValue(t,n,this.scope.scopeOptions);this.queries[i[0]]=i[1]}return this},i.prototype.times=function(e){return e<1?this:(this.counter=e,this)},i.prototype.once=function(){return this.times(1)},i.prototype.twice=function(){return this.times(2)},i.prototype.thrice=function(){return this.times(3)},i.prototype.delay=function(e){var t=0,n=0;if(p.isNumber(e))t=e;else{if(!p.isObject(e))throw new Error("Unexpected input opts"+e);t=e.head||0,n=e.body||0}return this.delayConnection(t).delayBody(n)},i.prototype.delayBody=function(e){return this.delayInMs+=e,this},i.prototype.delayConnection=function(e){return this.delayConnectionInMs+=e,this},i.prototype.getTotalDelay=function(){return this.delayInMs+this.delayConnectionInMs},i.prototype.socketDelay=function(e){return this.socketDelayInMs=e,this}}).call(this,e("buffer").Buffer)},{"./common":77,"./match_body":82,"./mixin":83,buffer:8,debug:43,fs:6,"json-stringify-safe":71,lodash:72,qs:88,util:136}],82:[function(e,t,n){(function(n){"use strict";function i(e,t){if(e&&e.constructor===RegExp)return e.test(t);if(e&&e.constructor===Object&&t){for(var n=Object.keys(e),r=0;r>>>>>\n",g=!1,A=[],b=function(e,n){if(d.isContentEncoded(n))return h.map(e,function(e){if(!t.isBuffer(e)){if("string"!=typeof e)throw new Error("content-encoded responses must all be binary buffers");e=new t(e)}return e.toString("hex")});var i=d.mergeChunks(e);if(d.isBinaryBuffer(i))return i.toString("hex");var o=i.toString("utf8");try{return JSON.parse(o)}catch(e){return o}},C=0;n.record=a,n.outputs=function(){return A},n.restore=p,n.clear=c}).call(this,e("buffer").Buffer)},{"./common":77,"./intercept":80,buffer:8,debug:43,lodash:72,stream:101,url:132,util:136}],85:[function(e,t,n){(function(n,i){"use strict";function o(e,t){if(e._headers){var n=t.toLowerCase();return e._headers[n]}}function r(e,t,n){v("setHeader",t,n);var i=t.toLowerCase();e._headers=e._headers||{},e._headerNames=e._headerNames||{},e._removedHeader=e._removedHeader||{},e._headers[i]=n,e._headerNames[i]=t,"expect"==t&&"100-continue"==n&&g.setImmediate(function(){v("continue"),e.emit("continue")})}function s(e,t,n){n.reqheaders&&m.forOwn(n.reqheaders,function(t,n){r(e,n,t)});var i="host";if(n.__nock_filteredScope&&n.__nock_scopeHost)t&&t.headers&&(t.headers[i]=n.__nock_scopeHost),r(e,i,n.__nock_scopeHost);else if(t.host&&!o(e,i)){var s=t.host;80!==t.port&&443!==t.port||(s=s.split(":")[0]),r(e,i,s)}}function a(e,t,a,c,C){var w;d?w=new d(new p):(w=new A,w._read=function(){});var R,P,T,S,I,O=[];return t=m.clone(t)||{},w.req=e,t.headers&&(t.headers=y.headersFieldNamesToLowerCase(t.headers),I=t.headers,m.forOwn(I,function(t,n){r(e,n,t)})),!t.auth||t.headers&&t.headers.authorization||r(e,"Authorization","Basic "+new i(t.auth).toString("base64")),e.connection||(e.connection=new p),e.path=t.path,t.getHeader=function(t){return o(e,t)},e.socket=w.socket=h({proto:t.proto}),e.write=function(t,n){return v("write",arguments),t&&!R&&(i.isBuffer(t)||(t=new i(t,n)),O.push(t)),R&&P(new Error("Request aborted")),g.setImmediate(function(){e.emit("drain")}),!1},e.end=function(t,n){v("req.end"),R||S||(e.write(t,n),T(C),e.emit("finish"),e.emit("end")),R&&P(new Error("Request aborted"))},e.abort=function(){v("req.abort"),R=!0,S||T();var t=new Error;t.code="aborted",w.emit("close",t),e.socket.destroy(),e.emit("abort");var n=new Error("socket hang up");n.code="ECONNRESET",P(n)},e.once=e.on=function(t,n){return"socket"==t&&(n(e.socket),e.socket.emit("connect",e.socket),e.socket.emit("secureConnect",e.socket)),p.prototype.on.call(this,t,n),this},P=function(t){n.nextTick(function(){e.emit("error",t)})},T=function(o){function r(t,r){function s(){function t(){R||(v("emitting response"),"function"==typeof o&&(v("callback with response"),o(w)),R?P(new Error("Request aborted")):e.emit("response",w),y.isStream(r)?(v("resuming response stream"),r.resume()):(h=h||[],"undefined"!=typeof r&&(v("adding body to buffer list"),h.push(r)),g.setImmediate(function t(){var n=h.shift();n?(v("emitting response chunk"),w.push(n),g.setImmediate(t)):(v("ending response stream"),w.push(null),A.scope.emit("replied",e,A))})))}R||(A.socketDelayInMs&&A.socketDelayInMs>0&&e.socket.applyDelay(A.socketDelayInMs),A.delayConnectionInMs&&A.delayConnectionInMs>0?setTimeout(t,A.delayConnectionInMs):t())}if(!C&&(C=!0,t&&(w.statusCode=500,r=t.stack),r&&(v("transform the response body"),Array.isArray(r)&&r.length>=2&&r.length<=3&&"number"==typeof r[0]&&(v("response body is array: %j",r),w.statusCode=Number(r[0]),v("new headers: %j",r[2]),w.headers||(w.headers={}),m.assign(w.headers,r[2]||{}),v("response.headers after: %j",w.headers),r=r[1],w.rawHeaders=w.rawHeaders||[],Object.keys(w.headers).forEach(function(e){w.rawHeaders.push(e,w.headers[e])})),A.delayInMs&&(v("delaying the response for",A.delayInMs,"milliseconds"),r=new u(A.getTotalDelay(),r)),y.isStream(r)?(v("response body is a stream"),r.pause(),r.on("data",function(e){w.push(e)}),r.on("end",function(){w.push(null)}),r.on("error",function(e){w.emit("error",e)})):r&&!i.isBuffer(r)&&("string"==typeof r?r=new i(r):(r=JSON.stringify(r),w.headers["content-type"]="application/json"))),A.interceptionCounter++,c(A),A.discard(),!R)){w.client=m.extend(w.client||{},{authorized:!0}),w.socket=m.extend(w.socket||{},{authorized:!0});var a={};Object.keys(w.headers).forEach(function(t){var n=w.headers[t];"function"==typeof n&&(w.headers[t]=a[t]=n(e,w,r))});for(var p=0;p0&&0===d.length)&&(d=new i(A.body,"utf8"))}return r(null,d)},e}var p=e("events").EventEmitter,c=e("http"),l=e("propagate"),u=e("./delayed_body"),d=c.IncomingMessage,f=c.ClientRequest,y=e("./common"),h=e("./socket"),m=e("lodash"),v=e("debug")("nock.request_overrider"),g=e("timers"),A=e("stream").Readable,b=e("./global_emitter");t.exports=a}).call(this,e("_process"),e("buffer").Buffer)},{"./common":77,"./delayed_body":78,"./global_emitter":79,"./socket":87,_process:94,buffer:8,debug:43,events:66,http:114,lodash:72,propagate:95,stream:101,timers:128}],86:[function(e,t,n){function i(e,t){return new o(e,t)}function o(e,t){return this instanceof o?(A.apply(this),this.keyedInterceptors={},this.interceptors=[],this.transformPathFunction=null,this.transformRequestBodyFunction=null,this.matchHeaders=[],this.logger=g,this.scopeOptions=t||{},this.urlParts={},this._persist=!1,this.contentLen=!1,this.date=null,this.basePath=e,this.basePathname="",this.port=null,void(e instanceof RegExp||(this.urlParts=m.parse(e),this.port=this.urlParts.port||("http:"===this.urlParts.protocol?80:443),this.basePathname=this.urlParts.pathname.replace(/\/$/,""),this.basePath=this.urlParts.protocol+"//"+this.urlParts.hostname+":"+this.port))):new o(e,t)}function r(){return f.removeAll(),t.exports}function s(e){if(!d)throw new Error("No fs");var t=d.readFileSync(e);return JSON.parse(t)}function a(e){return u(s(e))}function p(e){if(!v.isUndefined(e.reply)){var t=parseInt(e.reply,10);if(v.isNumber(t))return t}var n=200;return e.status||n}function c(e){if(!v.isUndefined(e.port)){var t=m.parse(e.scope);if(v.isNull(t.port))return e.scope+":"+e.port;if(parseInt(t.port)!==parseInt(e.port))throw new Error("Mismatched port numbers in scope and port properties of nock definition.")}return e.scope}function l(e){try{return JSON.parse(e)}catch(t){return e}}function u(e){var t=[];return e.forEach(function(e){var n=c(e),o=e.path,r=e.method.toLowerCase()||"get",s=p(e),a=e.headers||{},u=e.reqheaders||{},d=e.body||"",f=e.options||{};f=v.clone(f)||{},f.reqheaders=u;var y;y=e.response?v.isString(e.response)?l(e.response):e.response:"";var h;if("*"===d)h=i(n,f).filteringRequestBody(function(){return"*"})[r](o,"*").reply(s,y,a);else{if(h=i(n,f),v.size(u)>0)for(var m in u)h.matchHeader(m,u[m]);e.filteringRequestBody&&h.filteringRequestBody(e.filteringRequestBody),h.intercept(o,r,d).reply(s,y,a)}t.push(h)}),t}var d,f=e("./intercept"),y=e("./common"),h=e("assert"),m=e("url"),v=e("lodash"),g=e("debug")("nock.scope"),A=(e("json-stringify-safe"),e("events").EventEmitter),b=e("util")._extend,C=e("./global_emitter"),w=e("util"),R=e("./interceptor");try{d=e("fs")}catch(e){}w.inherits(o,A),o.prototype.add=function(e,t,n){this.keyedInterceptors.hasOwnProperty(e)||(this.keyedInterceptors[e]=[]),this.keyedInterceptors[e].push(t),f(this.basePath,t,this,this.scopeOptions,this.urlParts.hostname)},o.prototype.remove=function(e,t){if(!this._persist){var n=this.keyedInterceptors[e];n&&(n.splice(n.indexOf(t),1),0===n.length&&delete this.keyedInterceptors[e])}},o.prototype.intercept=function(e,t,n,i){var o=new R(this,e,t,n,i);return this.interceptors.push(o),o},o.prototype.get=function(e,t,n){return this.intercept(e,"GET",t,n)},o.prototype.post=function(e,t,n){return this.intercept(e,"POST",t,n)},o.prototype.put=function(e,t,n){return this.intercept(e,"PUT",t,n)},o.prototype.head=function(e,t,n){return this.intercept(e,"HEAD",t,n)},o.prototype.patch=function(e,t,n){return this.intercept(e,"PATCH",t,n)},o.prototype.merge=function(e,t,n){return this.intercept(e,"MERGE",t,n)},o.prototype.delete=function(e,t,n){return this.intercept(e,"DELETE",t,n)},o.prototype.pendingMocks=function(){return Object.keys(this.keyedInterceptors)},o.prototype.isDone=function(){var e=this;if(!f.isOn())return!0;var t=Object.keys(this.keyedInterceptors);if(0===t.length)return!0;var n=0;return t.forEach(function(t){var i=0;e.keyedInterceptors[t].forEach(function(t){var n=!v.isUndefined(t.options.requireDone);n&&t.options.requireDone===!1?i+=1:e._persist&&t.interceptionCounter>0&&(i+=1)}),i===e.keyedInterceptors[t].length&&(n+=1)}),n===t.length},o.prototype.done=function(){h.ok(this.isDone(),"Mocks not yet satisfied:\n"+this.pendingMocks().join("\n"))},o.prototype.buildFilter=function(){var e=arguments;return arguments[0]instanceof RegExp?function(t){return t&&(t=t.replace(e[0],e[1])),t}:v.isFunction(arguments[0])?arguments[0]:void 0},o.prototype.filteringPath=function(){if(this.transformPathFunction=this.buildFilter.apply(this,arguments),!this.transformPathFunction)throw new Error("Invalid arguments: filtering path should be a function or a regular expression");return this},o.prototype.filteringRequestBody=function(){if(this.transformRequestBodyFunction=this.buildFilter.apply(this,arguments),!this.transformRequestBodyFunction)throw new Error("Invalid arguments: filtering request body should be a function or a regular expression");return this},o.prototype.matchHeader=function(e,t){return this.matchHeaders.push({name:e.toLowerCase(),value:t}),this},o.prototype.defaultReplyHeaders=function(e){return this._defaultReplyHeaders=y.headersFieldNamesToLowerCase(e),this},o.prototype.log=function(e){return this.logger=e,this},o.prototype.persist=function(){return this._persist=!0,this},o.prototype.shouldPersist=function(){return this._persist},o.prototype.replyContentLength=function(){return this.contentLen=!0,this},o.prototype.replyDate=function(e){return this.date=e||new Date,this},t.exports=b(i,{cleanAll:r,activate:f.activate,isActive:f.isActive,isDone:f.isDone,pendingMocks:f.pendingMocks,removeInterceptor:f.removeInterceptor,disableNetConnect:f.disableNetConnect,enableNetConnect:f.enableNetConnect,load:a,loadDefs:s,define:u,emitter:C})},{"./common":77,"./global_emitter":79,"./intercept":80,"./interceptor":81,assert:2,debug:43,events:66,fs:6,"json-stringify-safe":71,lodash:72,url:132,util:136}],87:[function(e,t,n){(function(n){"use strict";function i(e){return this instanceof i?(r.apply(this),e=e||{},"https"===e.proto&&(this.authorized=!0),this.writable=!0,this.readable=!0,this.destroyed=!1,this.setNoDelay=o,this.setKeepAlive=o,this.resume=o,this.totalDelayMs=0,void(this.timeoutMs=null)):new i(e)}function o(){}var r=e("events").EventEmitter,s=e("debug")("nock.socket"),a=e("util");t.exports=i,a.inherits(i,r),i.prototype.setTimeout=function(e,t){this.timeoutMs=e,this.timeoutFunction=t},i.prototype.applyDelay=function(e){this.totalDelayMs+=e,this.timeoutMs&&this.totalDelayMs>this.timeoutMs&&(s("socket timeout"),this.timeoutFunction?this.timeoutFunction():this.emit("timeout"))},i.prototype.getPeerCertificate=function(){return new n((1e4*Math.random()+Date.now()).toString()).toString("base64")},i.prototype.destroy=function(){this.destroyed=!0,this.readable=this.writable=!1}}).call(this,e("buffer").Buffer)},{buffer:8,debug:43,events:66,util:136}],88:[function(e,t,n){"use strict";var i=e("./stringify"),o=e("./parse");t.exports={stringify:i,parse:o}},{"./parse":89,"./stringify":90}],89:[function(e,t,n){"use strict";var i=e("./utils"),o=Object.prototype.hasOwnProperty,r={delimiter:"&",depth:5,arrayLimit:20,parameterLimit:1e3,strictNullHandling:!1,plainObjects:!1,allowPrototypes:!1,allowDots:!1,decoder:i.decode},s=function(e,t){for(var n={},i=e.split(t.delimiter,t.parameterLimit===1/0?void 0:t.parameterLimit),r=0;r=0&&i.parseArrays&&a<=i.arrayLimit?(o=[],o[a]=e(t,n,i)):o[s]=e(t,n,i)}return o},p=function(e,t,n){if(e){var i=n.allowDots?e.replace(/\.([^\.\[]+)/g,"[$1]"):e,r=/^([^\[\]]*)/,s=/(\[[^\[\]]*\])/g,p=r.exec(i),c=[];if(p[1]){if(!n.plainObjects&&o.call(Object.prototype,p[1])&&!n.allowPrototypes)return;c.push(p[1])}for(var l=0;null!==(p=s.exec(i))&&l=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122?n+=t.charAt(o):r<128?n+=i[r]:r<2048?n+=i[192|r>>6]+i[128|63&r]:r<55296||r>=57344?n+=i[224|r>>12]+i[128|r>>6&63]+i[128|63&r]:(o+=1,r=65536+((1023&r)<<10|1023&t.charCodeAt(o)),n+=i[240|r>>18]+i[128|r>>12&63]+i[128|r>>6&63]+i[128|63&r])}return n},n.compact=function(e,t){if("object"!=typeof e||null===e)return e;var i=t||[],o=i.indexOf(e);if(o!==-1)return i[o];if(i.push(e),Array.isArray(e)){for(var r=[],s=0;s=0;i--){var o=e[i];"."===o?e.splice(i,1):".."===o?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function i(e,t){if(e.filter)return e.filter(t);for(var n=[],i=0;i=-1&&!o;r--){var s=r>=0?arguments[r]:e.cwd();if("string"!=typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(n=s+"/"+n,o="/"===s.charAt(0))}return n=t(i(n.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+n||"."},n.normalize=function(e){var o=n.isAbsolute(e),r="/"===s(e,-1);return e=t(i(e.split("/"),function(e){return!!e}),!o).join("/"),e||o||(e="."),e&&r&&(e+="/"),(o?"/":"")+e},n.isAbsolute=function(e){return"/"===e.charAt(0)},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(i(e,function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e}).join("/"))},n.relative=function(e,t){function i(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var o=i(e.split("/")),r=i(t.split("/")),s=Math.min(o.length,r.length),a=s,p=0;p1)for(var n=1;n1&&(i=n[0]+"@",e=n[1]),e=e.replace(_,".");var o=e.split("."),r=s(o,t).join(".");return i+r}function p(e){for(var t,n,i=[],o=0,r=e.length;o=55296&&t<=56319&&o65535&&(e-=65536,t+=D(e>>>10&1023|55296),e=56320|1023&e),t+=D(e)}).join("")}function l(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:R}function u(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function d(e,t,n){var i=0;for(e=n?N(e/I):e>>1,e+=N(e/t);e>F*T>>1;i+=R)e=N(e/F);return N(i+(F+1)*e/(e+S))}function f(e){var t,n,i,o,s,a,p,u,f,y,h=[],m=e.length,v=0,g=j,A=O;for(n=e.lastIndexOf(E),n<0&&(n=0),i=0;i=128&&r("not-basic"),h.push(e.charCodeAt(i));for(o=n>0?n+1:0;o=m&&r("invalid-input"),u=l(e.charCodeAt(o++)),(u>=R||u>N((w-v)/a))&&r("overflow"),v+=u*a,f=p<=A?P:p>=A+T?T:p-A,!(uN(w/y)&&r("overflow"),a*=y;t=h.length+1,A=d(v-s,t,0==s),N(v/t)>w-g&&r("overflow"),g+=N(v/t),v%=t,h.splice(v++,0,g)}return c(h)}function y(e){var t,n,i,o,s,a,c,l,f,y,h,m,v,g,A,b=[];for(e=p(e),m=e.length,t=j,n=0,s=O,a=0;a=t&&hN((w-n)/v)&&r("overflow"),n+=(c-t)*v,t=c,a=0;aw&&r("overflow"),h==t){for(l=n,f=R;y=f<=s?P:f>=s+T?T:f-s,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},F=R-P,N=Math.floor,D=String.fromCharCode;if(b={version:"1.4.1",ucs2:{decode:p,encode:c},decode:f,encode:y,toASCII:m,toUnicode:h},"function"==typeof e&&"object"==typeof e.amd&&e.amd)e("punycode",function(){return b});else if(v&&g)if(n.exports==v)g.exports=b;else for(C in b)b.hasOwnProperty(C)&&(v[C]=b[C]);else o.punycode=b}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],97:[function(e,t,n){"use strict";function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,n,r){t=t||"&",n=n||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var p=1e3;r&&"number"==typeof r.maxKeys&&(p=r.maxKeys);var c=e.length;p>0&&c>p&&(c=p);for(var l=0;l=0?(u=h.substr(0,m),d=h.substr(m+1)):(u=h,d=""),f=decodeURIComponent(u),y=decodeURIComponent(d),i(s,f)?o(s[f])?s[f].push(y):s[f]=[s[f],y]:s[f]=y}return s};var o=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],98:[function(e,t,n){"use strict";function i(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i0)if(t.ended&&!o){var s=new Error("stream.push() after EOF");e.emit("error",s)}else if(t.endEmitted&&o){var p=new Error("stream.unshift() after end event");e.emit("error",p)}else{var c;!t.decoder||o||i||(n=t.decoder.write(n),c=!t.objectMode&&0===n.length),o||(t.reading=!1),c||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",n),e.read(0)):(t.length+=t.objectMode?1:n.length,o?t.buffer.unshift(n):t.buffer.push(n),t.needReadable&&d(e))),y(e,t)}else o||(t.reading=!1);return a(t)}function a(e){return!e.ended&&(e.needReadable||e.length=U?e=U:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function c(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=p(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function l(e,t){var n=null;return _.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function u(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,d(e)}}function d(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(D("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?j(f,e):f(e))}function f(e){D("emit readable"),e.emit("readable"),b(e)}function y(e,t){t.readingMore||(t.readingMore=!0,j(h,e,t))}function h(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=w(e,t.buffer,t.decoder),n}function w(e,t,n){var i;return er.length?r.length:e;if(o+=s===r.length?r:r.slice(0,e),e-=s,0===e){s===r.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=r.slice(s));break}++i}return t.length-=i,o}function P(e,t){var n=M.allocUnsafe(e),i=t.head,o=1;for(i.data.copy(n),e-=i.data.length;i=i.next;){var r=i.data,s=e>r.length?r.length:e;if(r.copy(n,n.length-e,0,s),e-=s,0===e){s===r.length?(++o,i.next?t.head=i.next:t.head=t.tail=null):(t.head=i,i.data=r.slice(s));break}++o}return t.length-=o,n}function T(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,j(S,t,e))}function S(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function I(e,t){for(var n=0,i=e.length;n=t.highWaterMark||t.ended))return D("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?T(this):d(this),null;if(e=c(e,t),0===e&&t.ended)return 0===t.length&&T(this),null;var i=t.needReadable;D("need readable",i),(0===t.length||t.length-e0?C(e,t):null,null===o?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&T(this)),null!==o&&this.emit("data",o),o},r.prototype._read=function(e){this.emit("error",new Error("not implemented"))},r.prototype.pipe=function(e,t){function o(e){D("onunpipe"),e===d&&s()}function r(){D("onend"),e.end()}function s(){D("cleanup"),e.removeListener("close",c),e.removeListener("finish",l),e.removeListener("drain",v),e.removeListener("error",p),e.removeListener("unpipe",o),d.removeListener("end",r),d.removeListener("end",s),d.removeListener("data",a),g=!0,!f.awaitDrain||e._writableState&&!e._writableState.needDrain||v()}function a(t){D("ondata"),A=!1;var n=e.write(t);!1!==n||A||((1===f.pipesCount&&f.pipes===e||f.pipesCount>1&&O(f.pipes,e)!==-1)&&!g&&(D("false write response, pause",d._readableState.awaitDrain),d._readableState.awaitDrain++,A=!0),d.pause())}function p(t){D("onerror",t),u(),e.removeListener("error",p),0===x(e,"error")&&e.emit("error",t)}function c(){e.removeListener("finish",l),u()}function l(){D("onfinish"),e.removeListener("close",c),u()}function u(){D("unpipe"),d.unpipe(e)}var d=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1,D("pipe count=%d opts=%j",f.pipesCount,t);var y=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,h=y?r:s;f.endEmitted?j(h):d.once("end",h),e.on("unpipe",o);var v=m(d);e.on("drain",v);var g=!1,A=!1;return d.on("data",a),i(e,"error",p),e.once("close",c),e.once("finish",l),e.emit("pipe",d),f.flowing||(D("pipe resume"),d.resume()),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o-1?setImmediate:R;s.WritableState=r;var T=e("core-util-is");T.inherits=e("inherits");var S,I={deprecate:e("util-deprecate")};!function(){try{S=e("stream")}catch(e){}finally{S||(S=e("events").EventEmitter)}}();var O=e("buffer").Buffer,j=e("buffer-shims");T.inherits(s,S);var E;r.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(r.prototype,"buffer",{get:I.deprecate(function(){ +return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.")})}catch(e){}}();var E;s.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},s.prototype.write=function(e,t,n){var o=this._writableState,r=!1;return"function"==typeof t&&(n=t,t=null),O.isBuffer(e)?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=i),o.ended?a(this,n):p(this,o,e,n)&&(o.pendingcb++,r=l(this,o,e,t,n)),r},s.prototype.cork=function(){var e=this._writableState;e.corked++},s.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.finished||e.bufferProcessing||!e.bufferedRequest||v(this,e))},s.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},s.prototype._write=function(e,t,n){n(new Error("not implemented"))},s.prototype._writev=null,s.prototype.end=function(e,t,n){var i=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!==e&&void 0!==e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||C(this,i,n)}}).call(this,e("_process"))},{"./_stream_duplex":104,_process:94,buffer:8,"buffer-shims":7,"core-util-is":41,events:66,inherits:69,"process-nextick-args":93,"util-deprecate":134}],109:[function(e,t,n){"use strict";function i(){this.head=null,this.tail=null,this.length=0}var o=(e("buffer").Buffer,e("buffer-shims"));t.exports=i,i.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},i.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},i.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},i.prototype.clear=function(){this.head=this.tail=null,this.length=0},i.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},i.prototype.concat=function(e){if(0===this.length)return o.alloc(0);if(1===this.length)return this.head.data;for(var t=o.allocUnsafe(e>>>0),n=this.head,i=0;n;)n.data.copy(t,i),i+=n.data.length,n=n.next;return t}},{buffer:8,"buffer-shims":7}],110:[function(e,t,n){t.exports=e("./lib/_stream_passthrough.js")},{"./lib/_stream_passthrough.js":105}],111:[function(e,t,n){(function(i){var o=function(){try{return e("stream")}catch(e){}}();n=t.exports=e("./lib/_stream_readable.js"),n.Stream=o||n,n.Readable=n,n.Writable=e("./lib/_stream_writable.js"),n.Duplex=e("./lib/_stream_duplex.js"),n.Transform=e("./lib/_stream_transform.js"),n.PassThrough=e("./lib/_stream_passthrough.js"),!i.browser&&"disable"===i.env.READABLE_STREAM&&o&&(t.exports=o)}).call(this,e("_process"))},{"./lib/_stream_duplex.js":104,"./lib/_stream_passthrough.js":105,"./lib/_stream_readable.js":106,"./lib/_stream_transform.js":107,"./lib/_stream_writable.js":108,_process:94}],112:[function(e,t,n){t.exports=e("./lib/_stream_transform.js")},{"./lib/_stream_transform.js":107}],113:[function(e,t,n){t.exports=e("./lib/_stream_writable.js")},{"./lib/_stream_writable.js":108}],114:[function(e,t,n){(function(t){var i=e("./lib/request"),o=e("xtend"),r=e("builtin-status-codes"),s=e("url"),a=n;a.request=function(e,n){e="string"==typeof e?s.parse(e):o(e);var r=t.location.protocol.search(/^https?:$/)===-1?"http:":"",a=e.protocol||r,p=e.hostname||e.host,c=e.port,l=e.path||"/";p&&p.indexOf(":")!==-1&&(p="["+p+"]"),e.url=(p?a+"//"+p:"")+(c?":"+c:"")+l,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var u=new i(e);return n&&u.on("response",n),u},a.get=function(e,t){var n=a.request(e,t);return n.end(),n},a.Agent=function(){},a.Agent.defaultMaxSockets=4,a.STATUS_CODES=r,a.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./lib/request":116,"builtin-status-codes":10,url:132,xtend:137}],115:[function(e,t,n){(function(e){function t(e){try{return o.responseType=e,o.responseType===e}catch(e){}return!1}function i(e){return"function"==typeof e}n.fetch=i(e.fetch)&&i(e.ReadableStream),n.blobConstructor=!1;try{new Blob([new ArrayBuffer(1)]),n.blobConstructor=!0}catch(e){}var o=new e.XMLHttpRequest;o.open("GET",e.location.host?"/":"https://example.com");var r="undefined"!=typeof e.ArrayBuffer,s=r&&i(e.ArrayBuffer.prototype.slice);n.arraybuffer=r&&t("arraybuffer"),n.msstream=!n.fetch&&s&&t("ms-stream"),n.mozchunkedarraybuffer=!n.fetch&&r&&t("moz-chunked-arraybuffer"),n.overrideMimeType=i(o.overrideMimeType),n.vbArray=i(e.VBArray),o=null}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],116:[function(e,t,n){(function(n,i,o){function r(e){return a.fetch?"fetch":a.mozchunkedarraybuffer?"moz-chunked-arraybuffer":a.msstream?"ms-stream":a.arraybuffer&&e?"arraybuffer":a.vbArray&&e?"text:vbarray":"text"}function s(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}var a=e("./capability"),p=e("inherits"),c=e("./response"),l=e("readable-stream"),u=e("to-arraybuffer"),d=c.IncomingMessage,f=c.readyStates,y=t.exports=function(e){var t=this;l.Writable.call(t),t._opts=e,t._body=[],t._headers={},e.auth&&t.setHeader("Authorization","Basic "+new o(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(n){t.setHeader(n,e.headers[n])});var n;if("prefer-streaming"===e.mode)n=!1;else if("allow-wrong-content-type"===e.mode)n=!a.overrideMimeType;else{if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw new Error("Invalid value for opts.mode");n=!0}t._mode=r(n),t.on("finish",function(){t._onFinish()})};p(y,l.Writable),y.prototype.setHeader=function(e,t){var n=this,i=e.toLowerCase();h.indexOf(i)===-1&&(n._headers[i]={name:e,value:t})},y.prototype.getHeader=function(e){var t=this;return t._headers[e.toLowerCase()].value},y.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]},y.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t,r=e._opts,s=e._headers;if("POST"!==r.method&&"PUT"!==r.method&&"PATCH"!==r.method||(t=a.blobConstructor?new i.Blob(e._body.map(function(e){return u(e)}),{type:(s["content-type"]||{}).value||""}):o.concat(e._body).toString()),"fetch"===e._mode){var p=Object.keys(s).map(function(e){return[s[e].name,s[e].value]});i.fetch(e._opts.url,{method:e._opts.method,headers:p,body:t,mode:"cors",credentials:r.withCredentials?"include":"same-origin"}).then(function(t){e._fetchResponse=t,e._connect()},function(t){e.emit("error",t)})}else{var c=e._xhr=new i.XMLHttpRequest;try{c.open(e._opts.method,e._opts.url,!0)}catch(t){return void n.nextTick(function(){e.emit("error",t)})}"responseType"in c&&(c.responseType=e._mode.split(":")[0]),"withCredentials"in c&&(c.withCredentials=!!r.withCredentials),"text"===e._mode&&"overrideMimeType"in c&&c.overrideMimeType("text/plain; charset=x-user-defined"),Object.keys(s).forEach(function(e){c.setRequestHeader(s[e].name,s[e].value)}),e._response=null,c.onreadystatechange=function(){switch(c.readyState){case f.LOADING:case f.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(c.onprogress=function(){e._onXHRProgress()}),c.onerror=function(){e._destroyed||e.emit("error",new Error("XHR error"))};try{c.send(t)}catch(t){return void n.nextTick(function(){e.emit("error",t)})}}}},y.prototype._onXHRProgress=function(){var e=this;s(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},y.prototype._connect=function(){var e=this;e._destroyed||(e._response=new d(e._xhr,e._fetchResponse,e._mode),e.emit("response",e._response))},y.prototype._write=function(e,t,n){var i=this;i._body.push(e),n()},y.prototype.abort=y.prototype.destroy=function(){var e=this;e._destroyed=!0,e._response&&(e._response._destroyed=!0),e._xhr&&e._xhr.abort()},y.prototype.end=function(e,t,n){var i=this;"function"==typeof e&&(n=e,e=void 0),l.Writable.prototype.end.call(i,e,t,n)},y.prototype.flushHeaders=function(){},y.prototype.setTimeout=function(){},y.prototype.setNoDelay=function(){},y.prototype.setSocketKeepAlive=function(){};var h=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","user-agent","via"]}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":115,"./response":117,_process:94,buffer:8,inherits:69,"readable-stream":125,"to-arraybuffer":129}],117:[function(e,t,n){(function(t,i,o){var r=e("./capability"),s=e("inherits"),a=e("readable-stream"),p=n.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},c=n.IncomingMessage=function(e,n,i){function s(){d.read().then(function(e){if(!p._destroyed){if(e.done)return void p.push(null);p.push(new o(e.value)),s()}})}var p=this;if(a.Readable.call(p),p._mode=i,p.headers={},p.rawHeaders=[],p.trailers={},p.rawTrailers=[],p.on("end",function(){t.nextTick(function(){p.emit("close")})}),"fetch"===i){p._fetchResponse=n,p.url=n.url,p.statusCode=n.status,p.statusMessage=n.statusText;for(var c,l,u=n.headers[Symbol.iterator]();c=(l=u.next()).value,!l.done;)p.headers[c[0].toLowerCase()]=c[1],p.rawHeaders.push(c[0],c[1]);var d=n.body.getReader();s()}else{p._xhr=e,p._pos=0,p.url=e.responseURL,p.statusCode=e.status,p.statusMessage=e.statusText;var f=e.getAllResponseHeaders().split(/\r?\n/);if(f.forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var n=t[1].toLowerCase();"set-cookie"===n?(void 0===p.headers[n]&&(p.headers[n]=[]),p.headers[n].push(t[2])):void 0!==p.headers[n]?p.headers[n]+=", "+t[2]:p.headers[n]=t[2],p.rawHeaders.push(t[1],t[2])}}),p._charset="x-user-defined",!r.overrideMimeType){var y=p.rawHeaders["mime-type"];if(y){var h=y.match(/;\s*charset=([^;])(;|$)/);h&&(p._charset=h[1].toLowerCase())}p._charset||(p._charset="utf-8")}}};s(c,a.Readable),c.prototype._read=function(){},c.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text:vbarray":if(t.readyState!==p.DONE)break;try{n=new i.VBArray(t.responseBody).toArray()}catch(e){}if(null!==n){e.push(new o(n));break}case"text":try{n=t.responseText}catch(t){e._mode="text:vbarray";break}if(n.length>e._pos){var r=n.substr(e._pos);if("x-user-defined"===e._charset){for(var s=new o(r.length),a=0;ae._pos&&(e.push(new o(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(n)}e._xhr.readyState===p.DONE&&"ms-stream"!==e._mode&&e.push(null)}}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer)},{"./capability":115,_process:94,buffer:8,inherits:69,"readable-stream":125}],118:[function(e,t,n){arguments[4][9][0].apply(n,arguments)},{dup:9}],119:[function(e,t,n){arguments[4][104][0].apply(n,arguments)},{"./_stream_readable":121,"./_stream_writable":123,"core-util-is":41,dup:104,inherits:69,"process-nextick-args":93}],120:[function(e,t,n){arguments[4][105][0].apply(n,arguments)},{"./_stream_transform":122,"core-util-is":41,dup:105,inherits:69}],121:[function(e,t,n){arguments[4][106][0].apply(n,arguments)},{"./_stream_duplex":119,"./internal/streams/BufferList":124,_process:94,buffer:8,"buffer-shims":7,"core-util-is":41,dup:106,events:66,inherits:69,isarray:118,"process-nextick-args":93,"string_decoder/":126,util:5}],122:[function(e,t,n){arguments[4][107][0].apply(n,arguments)},{"./_stream_duplex":119,"core-util-is":41,dup:107,inherits:69}],123:[function(e,t,n){arguments[4][108][0].apply(n,arguments)},{"./_stream_duplex":119,_process:94,buffer:8,"buffer-shims":7,"core-util-is":41,dup:108,events:66,inherits:69,"process-nextick-args":93,"util-deprecate":134}],124:[function(e,t,n){arguments[4][109][0].apply(n,arguments)},{buffer:8,"buffer-shims":7,dup:109}],125:[function(e,t,n){arguments[4][111][0].apply(n,arguments)},{"./lib/_stream_duplex.js":119,"./lib/_stream_passthrough.js":120,"./lib/_stream_readable.js":121,"./lib/_stream_transform.js":122,"./lib/_stream_writable.js":123,_process:94,dup:111}],126:[function(e,t,n){function i(e){if(e&&!p(e))throw new Error("Unknown encoding: "+e)}function o(e){return e.toString(this.encoding)}function r(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function s(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}var a=e("buffer").Buffer,p=a.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}},c=n.StringDecoder=function(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),i(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=r;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=s;break;default:return void(this.write=o)}this.charBuffer=new a(6),this.charReceived=0,this.charLength=0};c.prototype.write=function(e){for(var t="";this.charLength;){var n=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,n),this.charReceived+=n,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var o=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,o),o-=this.charReceived),t+=e.toString(this.encoding,0,o);var o=t.length-1,i=t.charCodeAt(o);if(i>=55296&&i<=56319){var r=this.surrogateSize;return this.charLength+=r,this.charReceived+=r,this.charBuffer.copy(this.charBuffer,r,0,r),e.copy(this.charBuffer,0,0,r),t.substring(0,o)}return t},c.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(t<=2&&n>>4==14){this.charLength=3;break}if(t<=3&&n>>3==30){this.charLength=4;break}}this.charReceived=t},c.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,i=this.charBuffer,o=this.encoding;t+=i.slice(0,n).toString(o)}return t}},{buffer:8}],127:[function(e,t,n){function i(){}function o(e){var t={}.toString.call(e);switch(t){case"[object File]":case"[object Blob]":case"[object FormData]":return!0;default:return!1}}function r(e){return e===Object(e)}function s(e){if(!r(e))return e;var t=[];for(var n in e)null!=e[n]&&a(t,n,e[n]);return t.join("&")}function a(e,t,n){return Array.isArray(n)?n.forEach(function(n){a(e,t,n)}):void e.push(encodeURIComponent(t)+"="+encodeURIComponent(n))}function p(e){for(var t,n,i={},o=e.split("&"),r=0,s=o.length;r=200&&t.status<300)return n.callback(e,t);var i=new Error(t.statusText||"Unsuccessful HTTP response");i.original=e,i.response=t,i.status=t.status,n.callback(i,t)})}function h(e,t){return"function"==typeof t?new y("GET",e).end(t):1==arguments.length?new y("GET",e):new y(e,t)}function m(e,t){var n=h("DELETE",e);return t&&n.end(t),n}var v,g=e("emitter"),A=e("reduce");v="undefined"!=typeof window?window:"undefined"!=typeof self?self:this,h.getXHR=function(){if(!(!v.XMLHttpRequest||v.location&&"file:"==v.location.protocol&&v.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}return!1};var b="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};h.serializeObject=s,h.parseString=p,h.types={html:"text/html",json:"application/json",xml:"application/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},h.serialize={"application/x-www-form-urlencoded":s,"application/json":JSON.stringify},h.parse={"application/x-www-form-urlencoded":p,"application/json":JSON.parse},f.prototype.get=function(e){return this.header[e.toLowerCase()]},f.prototype.setHeaderProperties=function(e){var t=this.header["content-type"]||"";this.type=u(t);var n=d(t);for(var i in n)this[i]=n[i]},f.prototype.parseBody=function(e){var t=h.parse[this.type];return t&&e&&(e.length||e instanceof Object)?t(e):null},f.prototype.setStatusProperties=function(e){1223===e&&(e=204);var t=e/100|0;this.status=this.statusCode=e,this.statusType=t,this.info=1==t,this.ok=2==t,this.clientError=4==t,this.serverError=5==t,this.error=(4==t||5==t)&&this.toError(),this.accepted=202==e,this.noContent=204==e,this.badRequest=400==e,this.unauthorized=401==e,this.notAcceptable=406==e,this.notFound=404==e,this.forbidden=403==e},f.prototype.toError=function(){var e=this.req,t=e.method,n=e.url,i="cannot "+t+" "+n+" ("+this.status+")",o=new Error(i);return o.status=this.status,o.method=t,o.url=n,o},h.Response=f,g(y.prototype),y.prototype.use=function(e){return e(this),this},y.prototype.timeout=function(e){return this._timeout=e,this},y.prototype.clearTimeout=function(){return this._timeout=0,clearTimeout(this._timer),this},y.prototype.abort=function(){if(!this.aborted)return this.aborted=!0,this.xhr.abort(),this.clearTimeout(),this.emit("abort"),this},y.prototype.set=function(e,t){if(r(e)){for(var n in e)this.set(n,e[n]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},y.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},y.prototype.getHeader=function(e){return this._header[e.toLowerCase()]},y.prototype.type=function(e){return this.set("Content-Type",h.types[e]||e),this},y.prototype.parse=function(e){return this._parser=e,this},y.prototype.accept=function(e){return this.set("Accept",h.types[e]||e),this},y.prototype.auth=function(e,t){var n=btoa(e+":"+t);return this.set("Authorization","Basic "+n),this},y.prototype.query=function(e){return"string"!=typeof e&&(e=s(e)),e&&this._query.push(e),this},y.prototype.field=function(e,t){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t),this},y.prototype.attach=function(e,t,n){return this._formData||(this._formData=new v.FormData),this._formData.append(e,t,n||t.name),this},y.prototype.send=function(e){var t=r(e),n=this.getHeader("Content-Type");if(t&&r(this._data))for(var i in e)this._data[i]=e[i];else"string"==typeof e?(n||this.type("form"),n=this.getHeader("Content-Type"),"application/x-www-form-urlencoded"==n?this._data=this._data?this._data+"&"+e:e:this._data=(this._data||"")+e):this._data=e;return!t||o(e)?this:(n||this.type("json"),this)},y.prototype.callback=function(e,t){var n=this._callback;this.clearTimeout(),n(e,t)},y.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},y.prototype.timeoutError=function(){var e=this._timeout,t=new Error("timeout of "+e+"ms exceeded");t.timeout=e,this.callback(t)},y.prototype.withCredentials=function(){return this._withCredentials=!0,this},y.prototype.end=function(e){var t=this,n=this.xhr=h.getXHR(),r=this._query.join("&"),s=this._timeout,a=this._formData||this._data;this._callback=e||i,n.onreadystatechange=function(){if(4==n.readyState){var e;try{e=n.status}catch(t){e=0}if(0==e){if(t.timedout)return t.timeoutError();if(t.aborted)return;return t.crossDomainError()}t.emit("end")}};var p=function(e){e.total>0&&(e.percent=e.loaded/e.total*100),e.direction="download",t.emit("progress",e)};this.hasListeners("progress")&&(n.onprogress=p);try{n.upload&&this.hasListeners("progress")&&(n.upload.onprogress=p)}catch(e){}if(s&&!this._timer&&(this._timer=setTimeout(function(){t.timedout=!0,t.abort()},s)),r&&(r=h.serializeObject(r),this.url+=~this.url.indexOf("?")?"&"+r:"?"+r),n.open(this.method,this.url,!0),this._withCredentials&&(n.withCredentials=!0),"GET"!=this.method&&"HEAD"!=this.method&&"string"!=typeof a&&!o(a)){var c=this.getHeader("Content-Type"),u=this._parser||h.serialize[c?c.split(";")[0]:""];!u&&l(c)&&(u=h.serialize["application/json"]),u&&(a=u(a))}for(var d in this.header)null!=this.header[d]&&n.setRequestHeader(d,this.header[d]);return this.emit("request",this),n.send("undefined"!=typeof a?a:null),this},y.prototype.then=function(e,t){return this.end(function(n,i){n?t(n):e(i)})},h.Request=y,h.get=function(e,t,n){var i=h("GET",e);return"function"==typeof t&&(n=t,t=null),t&&i.query(t),n&&i.end(n),i},h.head=function(e,t,n){var i=h("HEAD",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},h.del=m,h.delete=m,h.patch=function(e,t,n){var i=h("PATCH",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},h.post=function(e,t,n){var i=h("POST",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},h.put=function(e,t,n){var i=h("PUT",e);return"function"==typeof t&&(n=t,t=null),t&&i.send(t),n&&i.end(n),i},t.exports=h},{emitter:40,reduce:100}],128:[function(e,t,n){function i(e,t){this._id=e,this._clearFn=t}var o=e("process/browser.js").nextTick,r=Function.prototype.apply,s=Array.prototype.slice,a={},p=0;n.setTimeout=function(){return new i(r.call(setTimeout,window,arguments),clearTimeout)},n.setInterval=function(){return new i(r.call(setInterval,window,arguments),clearInterval)},n.clearTimeout=n.clearInterval=function(e){e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(window,this._id)},n.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},n.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},n._unrefActive=n.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout(function(){e._onTimeout&&e._onTimeout()},t))},n.setImmediate="function"==typeof setImmediate?setImmediate:function(e){var t=p++,i=!(arguments.length<2)&&s.call(arguments,1);return a[t]=!0,o(function(){a[t]&&(i?e.apply(null,i):e.call(null),n.clearImmediate(t))}),t},n.clearImmediate="function"==typeof clearImmediate?clearImmediate:function(e){delete a[e]}},{"process/browser.js":94}],129:[function(e,t,n){var i=e("buffer").Buffer;t.exports=function(e){if(e instanceof Uint8Array){if(0===e.byteOffset&&e.byteLength===e.buffer.byteLength)return e.buffer;if("function"==typeof e.buffer.slice)return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}if(i.isBuffer(e)){for(var t=new Uint8Array(e.length),n=e.length,o=0;o",'"',"`"," ","\r","\n","\t"],y=["{","}","|","\\","^","`"].concat(f),h=["'"].concat(y),m=["%","/","?",";","#"].concat(h),v=["/","?","#"],g=255,A=/^[+a-z0-9A-Z_-]{0,63}$/,b=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,C={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},P=e("querystring");i.prototype.parse=function(e,t,n){if(!c.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),o=i!==-1&&i127?"x":M[N];if(!F.match(A)){var L=x.slice(0,I),q=x.slice(I+1),B=M.match(b);B&&(L.push(B[1]),q.unshift(B[2])),q.length&&(a="/"+q.join(".")+a),this.hostname=L.join(".");break}}}this.hostname.length>g?this.hostname="":this.hostname=this.hostname.toLowerCase(),k||(this.hostname=p.toASCII(this.hostname));var U=this.port?":"+this.port:"",G=this.hostname||"";this.host=G+U,this.href+=this.host,k&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!C[y])for(var I=0,_=h.length;I<_;I++){var V=h[I];if(a.indexOf(V)!==-1){var z=encodeURIComponent(V);z===V&&(z=escape(V)),a=a.split(V).join(z)}}var H=a.indexOf("#");H!==-1&&(this.hash=a.substr(H),a=a.slice(0,H));var K=a.indexOf("?");if(K!==-1?(this.search=a.substr(K),this.query=a.substr(K+1),t&&(this.query=P.parse(this.query)),a=a.slice(0,K)):t&&(this.search="",this.query={}),a&&(this.pathname=a),R[y]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var U=this.pathname||"",W=this.search||"";this.path=U+W}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",i=this.hash||"",o=!1,r="";this.host?o=e+this.host:this.hostname&&(o=e+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(o+=":"+this.port)),this.query&&c.isObject(this.query)&&Object.keys(this.query).length&&(r=P.stringify(this.query));var s=this.search||r&&"?"+r||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||R[t])&&o!==!1?(o="//"+(o||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):o||(o=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+o+n+s+i},i.prototype.resolve=function(e){return this.resolveObject(o(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(c.isString(e)){var t=new i;t.parse(e,!1,!0),e=t}for(var n=new i,o=Object.keys(this),r=0;r0)&&n.host.split("@");T&&(n.auth=T.shift(),n.host=n.hostname=T.shift())}return n.search=e.search,n.query=e.query,c.isNull(n.pathname)&&c.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!C.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var S=C.slice(-1)[0],I=(n.host||e.host||C.length>1)&&("."===S||".."===S)||""===S,O=0,j=C.length;j>=0;j--)S=C[j],"."===S?C.splice(j,1):".."===S?(C.splice(j,1),O++):O&&(C.splice(j,1),O--);if(!A&&!b)for(;O--;O)C.unshift("..");!A||""===C[0]||C[0]&&"/"===C[0].charAt(0)||C.unshift(""),I&&"/"!==C.join("/").substr(-1)&&C.push("");var E=""===C[0]||C[0]&&"/"===C[0].charAt(0);if(P){n.hostname=n.host=E?"":C.length?C.shift():"";var T=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");T&&(n.auth=T.shift(),n.host=n.hostname=T.shift())}return A=A||n.host&&C.length,A&&!E&&C.unshift(""),C.length?n.pathname=C.join("/"):(n.pathname=null,n.path=null),c.isNull(n.pathname)&&c.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=u.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{"./util":133,punycode:96,querystring:99}],133:[function(e,t,n){"use strict";t.exports={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}}},{}],134:[function(e,t,n){(function(e){function n(e,t){function n(){if(!o){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),o=!0}return e.apply(this,arguments)}if(i("noDeprecation"))return e;var o=!1;return n}function i(t){try{if(!e.localStorage)return!1}catch(e){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],135:[function(e,t,n){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],136:[function(e,t,n){(function(t,i){function o(e,t){var i={seen:[],stylize:s};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),h(t)?i.showHidden=t:t&&n._extend(i,t),C(i.showHidden)&&(i.showHidden=!1),C(i.depth)&&(i.depth=2),C(i.colors)&&(i.colors=!1),C(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=r),p(i,e,i.depth)}function r(e,t){var n=o.styles[t];return n?"["+o.colors[n][0]+"m"+e+"["+o.colors[n][1]+"m":e}function s(e,t){return e}function a(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}function p(e,t,i){if(e.customInspect&&t&&S(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var o=t.inspect(i,e);return A(o)||(o=p(e,o,i)),o}var r=c(e,t);if(r)return r;var s=Object.keys(t),h=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),T(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(t);if(0===s.length){if(S(t)){var m=t.name?": "+t.name:"";return e.stylize("[Function"+m+"]","special")}if(w(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(P(t))return e.stylize(Date.prototype.toString.call(t),"date");if(T(t))return l(t)}var v="",g=!1,b=["{","}"];if(y(t)&&(g=!0,b=["[","]"]),S(t)){var C=t.name?": "+t.name:"";v=" [Function"+C+"]"}if(w(t)&&(v=" "+RegExp.prototype.toString.call(t)),P(t)&&(v=" "+Date.prototype.toUTCString.call(t)),T(t)&&(v=" "+l(t)),0===s.length&&(!g||0==t.length))return b[0]+v+b[1];if(i<0)return w(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var R;return R=g?u(e,t,i,h,s):s.map(function(n){return d(e,t,i,h,n,g)}),e.seen.pop(),f(R,v,b)}function c(e,t){if(C(t))return e.stylize("undefined","undefined");if(A(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return g(t)?e.stylize(""+t,"number"):h(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function u(e,t,n,i,o){for(var r=[],s=0,a=t.length;s-1&&(a=r?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),C(s)){if(r&&o.match(/^\d+$/))return a;s=JSON.stringify(""+o),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function f(e,t,n){var i=0,o=e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return o>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function y(e){return Array.isArray(e)}function h(e){return"boolean"==typeof e}function m(e){return null===e}function v(e){return null==e}function g(e){return"number"==typeof e}function A(e){return"string"==typeof e}function b(e){return"symbol"==typeof e}function C(e){return void 0===e}function w(e){return R(e)&&"[object RegExp]"===O(e)}function R(e){return"object"==typeof e&&null!==e}function P(e){return R(e)&&"[object Date]"===O(e)}function T(e){return R(e)&&("[object Error]"===O(e)||e instanceof Error)}function S(e){return"function"==typeof e}function I(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function O(e){return Object.prototype.toString.call(e)}function j(e){return e<10?"0"+e.toString(10):e.toString(10)}function E(){var e=new Date,t=[j(e.getHours()),j(e.getMinutes()),j(e.getSeconds())].join(":");return[e.getDate(),F[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var x=/%[sdj%]/g;n.format=function(e){if(!A(e)){for(var t=[],n=0;n=r)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(e){return"[Circular]"}default:return e}}),a=i[n];n>e/4).toString(16):([1e16]+1e16).replace(/[01]/g,this.token)}},{key:"progress",value:function(e,t){if(e.lengthComputable&&this.promise){var n=Math.round(e.loaded/e.total*100);t.emit("progress",{total:e.total,loaded:e.loaded,percent:n})}}},{key:"buildUrlCustomBasePath",value:function(e,t,n){t.match(/^\//)||(t="/"+t);var i=e+t,o=this;return i=i.replace(/\{([\w-]+)\}/g,function(e,t){var i;return i=n.hasOwnProperty(t)?o.paramToString(n[t]):e,encodeURIComponent(i)})}}]),t}(p);a(u.prototype),t.exports=u},{"./alfresco-core-rest-api/src/ApiClient":271,"event-emitter":65,lodash:72,superagent:127}],398:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n\n \n /Company Home\n \n \n Folder: /Company Home\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
>Data Dictionary\n
>Guest Home\n
>User Homes\n
>Shared\n
>Imap Attachments\n
>IMAP Home\n
>Sites\n
>x\n
testFile.txt\n
>newFolder\n
>newFolder-1\n
testFile-1.txt\n
testFile-2.txt\n
testFile-3.txt\n
\n \n\n\n')}},{key:"get401Response",value:function(){a(this.host,{encodedQueryParams:!0}).get(this.scriptSlug).reply(401,{error:{errorKey:"framework.exception.ApiDefault",statusCode:401,briefSummary:"05210059 Authentication failed for Web Script org/alfresco/api/ResourceWebScript.get",stackTrace:"For security reasons the stack trace is no longer displayed, but the property is kept for previous versions.",descriptionURL:"https://api-explorer.alfresco.com"}})}}]),t}(p);t.exports=c},{"../baseMock":415,nock:75}],415:[function(e,t,n){"use strict";function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=function(){function e(e,t){for(var n=0;n Date: Mon, 24 Oct 2016 16:22:04 +0100 Subject: [PATCH 05/10] fixed version nock --- dist/alfresco-js-api.js | 19125 +++++++++++++++++++++++++++++++--- dist/alfresco-js-api.min.js | 55 +- package.json | 2 +- 3 files changed, 17759 insertions(+), 1423 deletions(-) diff --git a/dist/alfresco-js-api.js b/dist/alfresco-js-api.js index d7afaeb536..3b42ea719e 100644 --- a/dist/alfresco-js-api.js +++ b/dist/alfresco-js-api.js @@ -5,7 +5,7 @@ var AlfrescoApi = require('./src/alfrescoApi.js'); module.exports = AlfrescoApi; -},{"./src/alfrescoApi.js":396}],2:[function(require,module,exports){ +},{"./src/alfrescoApi.js":399}],2:[function(require,module,exports){ // http://wiki.commonjs.org/wiki/Unit_Testing/1.0 // // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8! @@ -366,7 +366,7 @@ var objectKeys = Object.keys || function (obj) { return keys; }; -},{"util/":136}],3:[function(require,module,exports){ +},{"util/":139}],3:[function(require,module,exports){ /*! * assertion-error * Copyright(c) 2013 Jake Luer @@ -487,6 +487,7 @@ AssertionError.prototype.toJSON = function (stack) { },{}],4:[function(require,module,exports){ 'use strict' +exports.byteLength = byteLength exports.toByteArray = toByteArray exports.fromByteArray = fromByteArray @@ -494,23 +495,17 @@ var lookup = [] var revLookup = [] var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array -function init () { - var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' - for (var i = 0, len = code.length; i < len; ++i) { - lookup[i] = code[i] - revLookup[code.charCodeAt(i)] = i - } - - revLookup['-'.charCodeAt(0)] = 62 - revLookup['_'.charCodeAt(0)] = 63 +var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/' +for (var i = 0, len = code.length; i < len; ++i) { + lookup[i] = code[i] + revLookup[code.charCodeAt(i)] = i } -init() +revLookup['-'.charCodeAt(0)] = 62 +revLookup['_'.charCodeAt(0)] = 63 -function toByteArray (b64) { - var i, j, l, tmp, placeHolders, arr +function placeHoldersCount (b64) { var len = b64.length - if (len % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4') } @@ -520,9 +515,19 @@ function toByteArray (b64) { // represent one byte // if there is only one, then the three characters before it represent 2 bytes // this is just a cheap hack to not do indexOf twice - placeHolders = b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 + return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0 +} +function byteLength (b64) { // base64 is 4/3 + up to two characters of the original data + return b64.length * 3 / 4 - placeHoldersCount(b64) +} + +function toByteArray (b64) { + var i, j, l, tmp, placeHolders, arr + var len = b64.length + placeHolders = placeHoldersCount(b64) + arr = new Arr(len * 3 / 4 - placeHolders) // if there are placeholders, only get up to the last complete 4 chars @@ -6866,7 +6871,7 @@ module.exports = function (obj, types) { } }; -},{"./flag":23,"assertion-error":3,"type-detect":130}],23:[function(require,module,exports){ +},{"./flag":23,"assertion-error":3,"type-detect":132}],23:[function(require,module,exports){ /*! * Chai - flag utility * Copyright(c) 2012-2014 Jake Luer @@ -7290,7 +7295,7 @@ module.exports = function hasProperty(name, obj) { return name in obj; }; -},{"type-detect":130}],32:[function(require,module,exports){ +},{"type-detect":132}],32:[function(require,module,exports){ /*! * chai * Copyright(c) 2011 Jake Luer @@ -7422,7 +7427,7 @@ exports.addChainableMethod = require('./addChainableMethod'); exports.overwriteChainableMethod = require('./overwriteChainableMethod'); -},{"./addChainableMethod":19,"./addMethod":20,"./addProperty":21,"./expectTypes":22,"./flag":23,"./getActual":24,"./getMessage":26,"./getName":27,"./getPathInfo":28,"./getPathValue":29,"./hasProperty":31,"./inspect":33,"./objDisplay":34,"./overwriteChainableMethod":35,"./overwriteMethod":36,"./overwriteProperty":37,"./test":38,"./transferFlags":39,"deep-eql":45,"type-detect":130}],33:[function(require,module,exports){ +},{"./addChainableMethod":19,"./addMethod":20,"./addProperty":21,"./expectTypes":22,"./flag":23,"./getActual":24,"./getMessage":26,"./getName":27,"./getPathInfo":28,"./getPathValue":29,"./hasProperty":31,"./inspect":33,"./objDisplay":34,"./overwriteChainableMethod":35,"./overwriteMethod":36,"./overwriteProperty":37,"./test":38,"./transferFlags":39,"deep-eql":45,"type-detect":132}],33:[function(require,module,exports){ // This is (almost) directly from Node.js utils // https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/util.js @@ -9893,7 +9898,7 @@ https.request = function (params, cb) { return http.request.call(this, params, cb); } -},{"http":114}],68:[function(require,module,exports){ +},{"http":116}],68:[function(require,module,exports){ exports.read = function (buffer, offset, isLE, mLen, nBytes) { var e, m var eLen = nBytes * 8 - mLen - 1 @@ -10072,17 +10077,21 @@ function serializer(replacer, cycleReplacer) { var undefined; /** Used as the semantic version number. */ - var VERSION = '4.15.0'; + var VERSION = '4.16.4'; /** Used as the size to enable large array optimizations. */ var LARGE_ARRAY_SIZE = 200; - /** Used as the `TypeError` message for "Functions" methods. */ - var FUNC_ERROR_TEXT = 'Expected a function'; + /** Error message constants. */ + var CORE_ERROR_TEXT = 'Unsupported core-js use. Try https://github.com/es-shims.', + FUNC_ERROR_TEXT = 'Expected a function'; /** Used to stand-in for `undefined` hash values. */ var HASH_UNDEFINED = '__lodash_hash_undefined__'; + /** Used as the maximum memoize cache size. */ + var MAX_MEMOIZE_SIZE = 500; + /** Used as the internal argument placeholder. */ var PLACEHOLDER = '__lodash_placeholder__'; @@ -10107,7 +10116,7 @@ function serializer(replacer, cycleReplacer) { DEFAULT_TRUNC_OMISSION = '...'; /** Used to detect hot functions by number of calls within a span of milliseconds. */ - var HOT_COUNT = 150, + var HOT_COUNT = 500, HOT_SPAN = 16; /** Used to indicate the type of lazy iteratees. */ @@ -10151,6 +10160,7 @@ function serializer(replacer, cycleReplacer) { numberTag = '[object Number]', objectTag = '[object Object]', promiseTag = '[object Promise]', + proxyTag = '[object Proxy]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', @@ -10176,8 +10186,8 @@ function serializer(replacer, cycleReplacer) { reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; /** Used to match HTML entities and HTML characters. */ - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, - reUnescapedHtml = /[&<>"'`]/g, + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, + reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); @@ -10224,9 +10234,6 @@ function serializer(replacer, cycleReplacer) { /** Used to match `RegExp` flags from their coerced string values. */ var reFlags = /\w*$/; - /** Used to detect hexadecimal string values. */ - var reHasHexPrefix = /^0x/i; - /** Used to detect bad signed hexadecimal string values. */ var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; @@ -10421,7 +10428,7 @@ function serializer(replacer, cycleReplacer) { '\u017a': 'z', '\u017c': 'z', '\u017e': 'z', '\u0132': 'IJ', '\u0133': 'ij', '\u0152': 'Oe', '\u0153': 'oe', - '\u0149': "'n", '\u017f': 'ss' + '\u0149': "'n", '\u017f': 's' }; /** Used to map characters to HTML entities. */ @@ -10430,8 +10437,7 @@ function serializer(replacer, cycleReplacer) { '<': '<', '>': '>', '"': '"', - "'": ''', - '`': '`' + "'": ''' }; /** Used to map HTML entities to characters. */ @@ -10440,8 +10446,7 @@ function serializer(replacer, cycleReplacer) { '<': '<', '>': '>', '"': '"', - ''': "'", - '`': '`' + ''': "'" }; /** Used to escape characters for inclusion in compiled string literals. */ @@ -10882,18 +10887,9 @@ function serializer(replacer, cycleReplacer) { * @returns {number} Returns the index of the matched value, else `-1`. */ function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return baseFindIndex(array, baseIsNaN, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; + return value === value + ? strictIndexOf(array, value, fromIndex) + : baseFindIndex(array, baseIsNaN, fromIndex); } /** @@ -11098,7 +11094,7 @@ function serializer(replacer, cycleReplacer) { } /** - * Checks if a cache value for `key` exists. + * Checks if a `cache` value for `key` exists. * * @private * @param {Object} cache The cache to query. @@ -11156,7 +11152,7 @@ function serializer(replacer, cycleReplacer) { while (length--) { if (array[length] === placeholder) { - result++; + ++result; } } return result; @@ -11226,25 +11222,6 @@ function serializer(replacer, cycleReplacer) { return reHasUnicodeWord.test(string); } - /** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ - function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; - } - /** * Converts `iterator` to an array. * @@ -11352,6 +11329,48 @@ function serializer(replacer, cycleReplacer) { return result; } + /** + * A specialized version of `_.indexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictIndexOf(array, value, fromIndex) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * A specialized version of `_.lastIndexOf` which performs strict equality + * comparisons of values, i.e. `===`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function strictLastIndexOf(array, value, fromIndex) { + var index = fromIndex + 1; + while (index--) { + if (array[index] === value) { + return index; + } + } + return index; + } + /** * Gets the number of symbols in `string`. * @@ -11397,7 +11416,7 @@ function serializer(replacer, cycleReplacer) { function unicodeSize(string) { var result = reUnicode.lastIndex = 0; while (reUnicode.test(string)) { - result++; + ++result; } return result; } @@ -11452,17 +11471,10 @@ function serializer(replacer, cycleReplacer) { * lodash.isFunction(lodash.bar); * // => true * - * // Use `context` to stub `Date#getTime` use in `_.now`. - * var stubbed = _.runInContext({ - * 'Date': function() { - * return { 'getTime': stubGetTime }; - * } - * }); - * * // Create a suped-up `defer` in Node.js. * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; */ - function runInContext(context) { + var runInContext = (function runInContext(context) { context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root; /** Built-in constructor references. */ @@ -11522,6 +11534,7 @@ function serializer(replacer, cycleReplacer) { var Buffer = moduleExports ? context.Buffer : undefined, Symbol = context.Symbol, Uint8Array = context.Uint8Array, + allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined, getPrototype = overArg(Object.getPrototypeOf, Object), iteratorSymbol = Symbol ? Symbol.iterator : undefined, objectCreate = Object.create, @@ -11529,6 +11542,14 @@ function serializer(replacer, cycleReplacer) { splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + var defineProperty = (function() { + try { + var func = getNative(Object, 'defineProperty'); + func({}, '', {}); + return func; + } catch (e) {} + }()); + /** Mocked built-ins. */ var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.now, @@ -11544,6 +11565,7 @@ function serializer(replacer, cycleReplacer) { nativeKeys = overArg(Object.keys, Object), nativeMax = Math.max, nativeMin = Math.min, + nativeNow = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math.random, nativeReverse = arrayProto.reverse; @@ -11556,20 +11578,9 @@ function serializer(replacer, cycleReplacer) { WeakMap = getNative(context, 'WeakMap'), nativeCreate = getNative(Object, 'create'); - /* Used to set `toString` methods. */ - var defineProperty = (function() { - var func = getNative(Object, 'defineProperty'), - name = getNative.name; - - return (name && name.length > 2) ? func : undefined; - }()); - /** Used to store function metadata. */ var metaMap = WeakMap && new WeakMap; - /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ - var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); - /** Used to lookup unminified function names. */ var realNames = {}; @@ -11716,6 +11727,30 @@ function serializer(replacer, cycleReplacer) { return new LodashWrapper(value); } + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} proto The object to inherit from. + * @returns {Object} Returns the new object. + */ + var baseCreate = (function() { + function object() {} + return function(proto) { + if (!isObject(proto)) { + return {}; + } + if (objectCreate) { + return objectCreate(proto); + } + object.prototype = proto; + var result = new object; + object.prototype = undefined; + return result; + }; + }()); + /** * The function whose prototype chain sequence wrappers inherit from. * @@ -11957,6 +11992,7 @@ function serializer(replacer, cycleReplacer) { */ function hashClear() { this.__data__ = nativeCreate ? nativeCreate(null) : {}; + this.size = 0; } /** @@ -11970,7 +12006,9 @@ function serializer(replacer, cycleReplacer) { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; + var result = this.has(key) && delete this.__data__[key]; + this.size -= result ? 1 : 0; + return result; } /** @@ -12017,6 +12055,7 @@ function serializer(replacer, cycleReplacer) { */ function hashSet(key, value) { var data = this.__data__; + this.size += this.has(key) ? 0 : 1; data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; return this; } @@ -12057,6 +12096,7 @@ function serializer(replacer, cycleReplacer) { */ function listCacheClear() { this.__data__ = []; + this.size = 0; } /** @@ -12081,6 +12121,7 @@ function serializer(replacer, cycleReplacer) { } else { splice.call(data, index, 1); } + --this.size; return true; } @@ -12128,6 +12169,7 @@ function serializer(replacer, cycleReplacer) { index = assocIndexOf(data, key); if (index < 0) { + ++this.size; data.push([key, value]); } else { data[index][1] = value; @@ -12170,6 +12212,7 @@ function serializer(replacer, cycleReplacer) { * @memberOf MapCache */ function mapCacheClear() { + this.size = 0; this.__data__ = { 'hash': new Hash, 'map': new (Map || ListCache), @@ -12187,7 +12230,9 @@ function serializer(replacer, cycleReplacer) { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); + var result = getMapData(this, key)['delete'](key); + this.size -= result ? 1 : 0; + return result; } /** @@ -12227,7 +12272,11 @@ function serializer(replacer, cycleReplacer) { * @returns {Object} Returns the map cache instance. */ function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); + var data = getMapData(this, key), + size = data.size; + + data.set(key, value); + this.size += data.size == size ? 0 : 1; return this; } @@ -12300,7 +12349,8 @@ function serializer(replacer, cycleReplacer) { * @param {Array} [entries] The key-value pairs to cache. */ function Stack(entries) { - this.__data__ = new ListCache(entries); + var data = this.__data__ = new ListCache(entries); + this.size = data.size; } /** @@ -12312,6 +12362,7 @@ function serializer(replacer, cycleReplacer) { */ function stackClear() { this.__data__ = new ListCache; + this.size = 0; } /** @@ -12324,7 +12375,11 @@ function serializer(replacer, cycleReplacer) { * @returns {boolean} Returns `true` if the entry was removed, else `false`. */ function stackDelete(key) { - return this.__data__['delete'](key); + var data = this.__data__, + result = data['delete'](key); + + this.size = data.size; + return result; } /** @@ -12364,16 +12419,18 @@ function serializer(replacer, cycleReplacer) { * @returns {Object} Returns the stack cache instance. */ function stackSet(key, value) { - var cache = this.__data__; - if (cache instanceof ListCache) { - var pairs = cache.__data__; + var data = this.__data__; + if (data instanceof ListCache) { + var pairs = data.__data__; if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { pairs.push([key, value]); + this.size = ++data.size; return this; } - cache = this.__data__ = new MapCache(pairs); + data = this.__data__ = new MapCache(pairs); } - cache.set(key, value); + data.set(key, value); + this.size = data.size; return this; } @@ -12395,24 +12452,67 @@ function serializer(replacer, cycleReplacer) { * @returns {Array} Returns the array of property names. */ function arrayLikeKeys(value, inherited) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - // Safari 9 makes `arguments.length` enumerable in strict mode. - var result = (isArray(value) || isArguments(value)) - ? baseTimes(value.length, String) - : []; - - var length = result.length, - skipIndexes = !!length; + var isArr = isArray(value), + isArg = !isArr && isArguments(value), + isBuff = !isArr && !isArg && isBuffer(value), + isType = !isArr && !isArg && !isBuff && isTypedArray(value), + skipIndexes = isArr || isArg || isBuff || isType, + result = skipIndexes ? baseTimes(value.length, String) : [], + length = result.length; for (var key in value) { if ((inherited || hasOwnProperty.call(value, key)) && - !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + !(skipIndexes && ( + // Safari 9 has enumerable `arguments.length` in strict mode. + key == 'length' || + // Node.js 0.10 has enumerable non-index properties on buffers. + (isBuff && (key == 'offset' || key == 'parent')) || + // PhantomJS 2 has enumerable non-index properties on typed arrays. + (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) || + // Skip index properties. + isIndex(key, length) + ))) { result.push(key); } } return result; } + /** + * A specialized version of `_.sample` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @returns {*} Returns the random element. + */ + function arraySample(array) { + var length = array.length; + return length ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * A specialized version of `_.sampleSize` for arrays. + * + * @private + * @param {Array} array The array to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function arraySampleSize(array, n) { + return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); + } + + /** + * A specialized version of `_.shuffle` for arrays. + * + * @private + * @param {Array} array The array to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function arrayShuffle(array) { + return shuffleSelf(copyArray(array)); + } + /** * Used by `_.defaults` to customize its `_.assignIn` use. * @@ -12442,8 +12542,8 @@ function serializer(replacer, cycleReplacer) { */ function assignMergeValue(object, key, value) { if ((value !== undefined && !eq(object[key], value)) || - (typeof key == 'number' && value === undefined && !(key in object))) { - object[key] = value; + (value === undefined && !(key in object))) { + baseAssignValue(object, key, value); } } @@ -12461,7 +12561,7 @@ function serializer(replacer, cycleReplacer) { var objValue = object[key]; if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || (value === undefined && !(key in object))) { - object[key] = value; + baseAssignValue(object, key, value); } } @@ -12514,6 +12614,28 @@ function serializer(replacer, cycleReplacer) { return object && copyObject(source, keys(source), object); } + /** + * The base implementation of `assignValue` and `assignMergeValue` without + * value checks. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function baseAssignValue(object, key, value) { + if (key == '__proto__' && defineProperty) { + defineProperty(object, key, { + 'configurable': true, + 'enumerable': true, + 'value': value, + 'writable': true + }); + } else { + object[key] = value; + } + } + /** * The base implementation of `_.at` without support for individual paths. * @@ -12594,9 +12716,6 @@ function serializer(replacer, cycleReplacer) { return cloneBuffer(value, isDeep); } if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } result = initCloneObject(isFunc ? {} : value); if (!isDeep) { return copySymbols(value, baseAssign(result, value)); @@ -12616,9 +12735,7 @@ function serializer(replacer, cycleReplacer) { } stack.set(value, result); - if (!isArr) { - var props = isFull ? getAllKeys(value) : keys(value); - } + var props = isArr ? undefined : (isFull ? getAllKeys : keys)(value); arrayEach(props || value, function(subValue, key) { if (props) { key = subValue; @@ -12670,18 +12787,6 @@ function serializer(replacer, cycleReplacer) { return true; } - /** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ - function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; - } - /** * The base implementation of `_.delay` and `_.defer` which accepts `args` * to provide to `func`. @@ -13164,6 +13269,17 @@ function serializer(replacer, cycleReplacer) { return func == null ? undefined : apply(func, object, args); } + /** + * The base implementation of `_.isArguments`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + */ + function baseIsArguments(value) { + return isObjectLike(value) && objectToString.call(value) == argsTag; + } + /** * The base implementation of `_.isArrayBuffer` without Node.js optimizations. * @@ -13240,10 +13356,17 @@ function serializer(replacer, cycleReplacer) { othTag = getTag(other); othTag = othTag == argsTag ? objectTag : othTag; } - var objIsObj = objTag == objectTag && !isHostObject(object), - othIsObj = othTag == objectTag && !isHostObject(other), + var objIsObj = objTag == objectTag, + othIsObj = othTag == objectTag, isSameTag = objTag == othTag; + if (isSameTag && isBuffer(object)) { + if (!isBuffer(other)) { + return false; + } + objIsArr = true; + objIsObj = false; + } if (isSameTag && !objIsObj) { stack || (stack = new Stack); return (objIsArr || isTypedArray(object)) @@ -13346,7 +13469,7 @@ function serializer(replacer, cycleReplacer) { if (!isObject(value) || isMasked(value)) { return false; } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + var pattern = isFunction(value) ? reIsNative : reIsHostCtor; return pattern.test(toSource(value)); } @@ -13533,14 +13656,7 @@ function serializer(replacer, cycleReplacer) { if (object === source) { return; } - if (!(isArray(source) || isTypedArray(source))) { - var props = baseKeysIn(source); - } - arrayEach(props || source, function(srcValue, key) { - if (props) { - key = srcValue; - srcValue = source[key]; - } + baseFor(source, function(srcValue, key) { if (isObject(srcValue)) { stack || (stack = new Stack); baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); @@ -13555,7 +13671,7 @@ function serializer(replacer, cycleReplacer) { } assignMergeValue(object, key, newValue); } - }); + }, keysIn); } /** @@ -13589,29 +13705,37 @@ function serializer(replacer, cycleReplacer) { var isCommon = newValue === undefined; if (isCommon) { + var isArr = isArray(srcValue), + isBuff = !isArr && isBuffer(srcValue), + isTyped = !isArr && !isBuff && isTypedArray(srcValue); + newValue = srcValue; - if (isArray(srcValue) || isTypedArray(srcValue)) { + if (isArr || isBuff || isTyped) { if (isArray(objValue)) { newValue = objValue; } else if (isArrayLikeObject(objValue)) { newValue = copyArray(objValue); } - else { + else if (isBuff) { isCommon = false; - newValue = baseClone(srcValue, true); + newValue = cloneBuffer(srcValue, true); + } + else if (isTyped) { + isCommon = false; + newValue = cloneTypedArray(srcValue, true); + } + else { + newValue = []; } } else if (isPlainObject(srcValue) || isArguments(srcValue)) { + newValue = objValue; if (isArguments(objValue)) { newValue = toPlainObject(objValue); } else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { - isCommon = false; - newValue = baseClone(srcValue, true); - } - else { - newValue = objValue; + newValue = initCloneObject(srcValue); } } else { @@ -13704,7 +13828,7 @@ function serializer(replacer, cycleReplacer) { value = object[key]; if (predicate(value, key)) { - result[key] = value; + baseAssignValue(result, key, value); } } return result; @@ -13870,24 +13994,31 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new function. */ function baseRest(func, start) { - start = nativeMax(start === undefined ? (func.length - 1) : start, 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); + return setToString(overRest(func, start, identity), func + ''); + } - while (++index < length) { - array[index] = args[start + index]; - } - index = -1; - var otherArgs = Array(start + 1); - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; + /** + * The base implementation of `_.sample`. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + */ + function baseSample(collection) { + return arraySample(values(collection)); + } + + /** + * The base implementation of `_.sampleSize` without param guards. + * + * @private + * @param {Array|Object} collection The collection to sample. + * @param {number} n The number of elements to sample. + * @returns {Array} Returns the random elements. + */ + function baseSampleSize(collection, n) { + var array = values(collection); + return shuffleSelf(array, baseClamp(n, 0, array.length)); } /** @@ -13931,7 +14062,7 @@ function serializer(replacer, cycleReplacer) { } /** - * The base implementation of `setData` without support for hot loop detection. + * The base implementation of `setData` without support for hot loop shorting. * * @private * @param {Function} func The function to associate metadata with. @@ -13943,6 +14074,34 @@ function serializer(replacer, cycleReplacer) { return func; }; + /** + * The base implementation of `setToString` without support for hot loop shorting. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var baseSetToString = !defineProperty ? identity : function(func, string) { + return defineProperty(func, 'toString', { + 'configurable': true, + 'enumerable': false, + 'value': constant(string), + 'writable': true + }); + }; + + /** + * The base implementation of `_.shuffle`. + * + * @private + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + */ + function baseShuffle(collection) { + return shuffleSelf(values(collection)); + } + /** * The base implementation of `_.slice` without an iteratee call guard. * @@ -14136,6 +14295,10 @@ function serializer(replacer, cycleReplacer) { if (typeof value == 'string') { return value; } + if (isArray(value)) { + // Recursively convert values (susceptible to call stack limits). + return arrayMap(value, baseToString) + ''; + } if (isSymbol(value)) { return symbolToString ? symbolToString.call(value) : ''; } @@ -14357,6 +14520,17 @@ function serializer(replacer, cycleReplacer) { return isArray(value) ? value : stringToPath(value); } + /** + * A `baseRest` alias which can be replaced with `identity` by module + * replacement plugins. + * + * @private + * @type {Function} + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + var castRest = baseRest; + /** * Casts `array` to a slice if it's needed. * @@ -14394,7 +14568,9 @@ function serializer(replacer, cycleReplacer) { if (isDeep) { return buffer.slice(); } - var result = new buffer.constructor(buffer.length); + var length = buffer.length, + result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); + buffer.copy(result); return result; } @@ -14671,6 +14847,7 @@ function serializer(replacer, cycleReplacer) { * @returns {Object} Returns `object`. */ function copyObject(source, props, object, customizer) { + var isNew = !object; object || (object = {}); var index = -1, @@ -14683,7 +14860,14 @@ function serializer(replacer, cycleReplacer) { ? customizer(object[key], source[key], key, object, source) : undefined; - assignValue(object, key, newValue === undefined ? source[key] : newValue); + if (newValue === undefined) { + newValue = source[key]; + } + if (isNew) { + baseAssignValue(object, key, newValue); + } else { + assignValue(object, key, newValue); + } } return object; } @@ -14962,9 +15146,7 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new flow function. */ function createFlow(fromRight) { - return baseRest(function(funcs) { - funcs = baseFlatten(funcs, 1); - + return flatRest(function(funcs) { var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; @@ -15147,11 +15329,8 @@ function serializer(replacer, cycleReplacer) { * @returns {Function} Returns the new over function. */ function createOver(arrayFunc) { - return baseRest(function(iteratees) { - iteratees = (iteratees.length == 1 && isArray(iteratees[0])) - ? arrayMap(iteratees[0], baseUnary(getIteratee())) - : arrayMap(baseFlatten(iteratees, 1), baseUnary(getIteratee())); - + return flatRest(function(iteratees) { + iteratees = arrayMap(iteratees, baseUnary(getIteratee())); return baseRest(function(args) { var thisArg = this; return arrayFunc(iteratees, function(iteratee) { @@ -15494,9 +15673,9 @@ function serializer(replacer, cycleReplacer) { // Recursively compare arrays (susceptible to call stack limits). if (seen) { if (!arraySome(other, function(othValue, othIndex) { - if (!seen.has(othIndex) && + if (!cacheHas(seen, othIndex) && (arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { - return seen.add(othIndex); + return seen.push(othIndex); } })) { result = false; @@ -15676,6 +15855,17 @@ function serializer(replacer, cycleReplacer) { return result; } + /** + * A specialized version of `baseRest` which flattens the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @returns {Function} Returns the new function. + */ + function flatRest(func) { + return setToString(overRest(func, undefined, flatten), func + ''); + } + /** * Creates an array of own enumerable property names and symbols of `object`. * @@ -15844,8 +16034,7 @@ function serializer(replacer, cycleReplacer) { */ var getTag = baseGetTag; - // Fallback for data views, maps, sets, and weak maps in IE 11, - // for data views in Edge < 14, and promises in Node.js. + // Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6. if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || (Map && getTag(new Map) != mapTag) || (Promise && getTag(Promise.resolve()) != promiseTag) || @@ -15921,9 +16110,9 @@ function serializer(replacer, cycleReplacer) { function hasPath(object, path, hasFunc) { path = isKey(path, object) ? [path] : castPath(path); - var result, - index = -1, - length = path.length; + var index = -1, + length = path.length, + result = false; while (++index < length) { var key = toKey(path[index]); @@ -15932,10 +16121,10 @@ function serializer(replacer, cycleReplacer) { } object = object[key]; } - if (result) { + if (result || ++index != length) { return result; } - var length = object ? object.length : 0; + length = object ? object.length : 0; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } @@ -16030,9 +16219,11 @@ function serializer(replacer, cycleReplacer) { * @returns {string} Returns the modified source. */ function insertWrapDetails(source, details) { - var length = details.length, - lastIndex = length - 1; - + var length = details.length; + if (!length) { + return source; + } + var lastIndex = length - 1; details[lastIndex] = (length > 1 ? '& ' : '') + details[lastIndex]; details = details.join(length > 2 ? ', ' : ' '); return source.replace(reWrapComment, '{\n/* [wrapped with ' + details + '] */\n'); @@ -16211,6 +16402,26 @@ function serializer(replacer, cycleReplacer) { }; } + /** + * A specialized version of `_.memoize` which clears the memoized function's + * cache when it exceeds `MAX_MEMOIZE_SIZE`. + * + * @private + * @param {Function} func The function to have its output memoized. + * @returns {Function} Returns the new memoized function. + */ + function memoizeCapped(func) { + var result = memoize(func, function(key) { + if (cache.size === MAX_MEMOIZE_SIZE) { + cache.clear(); + } + return key; + }); + + var cache = result.cache; + return result; + } + /** * Merges the function metadata of `source` into `data`. * @@ -16324,6 +16535,36 @@ function serializer(replacer, cycleReplacer) { return result; } + /** + * A specialized version of `baseRest` which transforms the rest array. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @param {Function} transform The rest array transform. + * @returns {Function} Returns the new function. + */ + function overRest(func, start, transform) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = transform(array); + return apply(func, this, otherArgs); + }; + } + /** * Gets the parent value at `path` of `object`. * @@ -16372,25 +16613,7 @@ function serializer(replacer, cycleReplacer) { * @param {*} data The metadata. * @returns {Function} Returns `func`. */ - var setData = (function() { - var count = 0, - lastCalled = 0; - - return function(key, value) { - var stamp = now(), - remaining = HOT_SPAN - (stamp - lastCalled); - - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return key; - } - } else { - count = 0; - } - return baseSetData(key, value); - }; - }()); + var setData = shortOut(baseSetData); /** * A simple wrapper around the global [`setTimeout`](https://mdn.io/setTimeout). @@ -16404,6 +16627,16 @@ function serializer(replacer, cycleReplacer) { return root.setTimeout(func, wait); }; + /** + * Sets the `toString` method of `func` to return `string`. + * + * @private + * @param {Function} func The function to modify. + * @param {Function} string The `toString` result. + * @returns {Function} Returns `func`. + */ + var setToString = shortOut(baseSetToString); + /** * Sets the `toString` method of `wrapper` to mimic the source of `reference` * with wrapper details in a comment at the top of the source body. @@ -16414,14 +16647,64 @@ function serializer(replacer, cycleReplacer) { * @param {number} bitmask The bitmask flags. See `createWrap` for more details. * @returns {Function} Returns `wrapper`. */ - var setWrapToString = !defineProperty ? identity : function(wrapper, reference, bitmask) { + function setWrapToString(wrapper, reference, bitmask) { var source = (reference + ''); - return defineProperty(wrapper, 'toString', { - 'configurable': true, - 'enumerable': false, - 'value': constant(insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))) - }); - }; + return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); + } + + /** + * Creates a function that'll short out and invoke `identity` instead + * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN` + * milliseconds. + * + * @private + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new shortable function. + */ + function shortOut(func) { + var count = 0, + lastCalled = 0; + + return function() { + var stamp = nativeNow(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return arguments[0]; + } + } else { + count = 0; + } + return func.apply(undefined, arguments); + }; + } + + /** + * A specialized version of `_.shuffle` which mutates and sets the size of `array`. + * + * @private + * @param {Array} array The array to shuffle. + * @param {number} [size=array.length] The size of `array`. + * @returns {Array} Returns `array`. + */ + function shuffleSelf(array, size) { + var index = -1, + length = array.length, + lastIndex = length - 1; + + size = size === undefined ? length : size; + while (++index < size) { + var rand = baseRandom(index, lastIndex), + value = array[rand]; + + array[rand] = array[index]; + array[index] = value; + } + array.length = size; + return array; + } /** * Converts `string` to a property path array. @@ -16430,7 +16713,7 @@ function serializer(replacer, cycleReplacer) { * @param {string} string The string to convert. * @returns {Array} Returns the property path array. */ - var stringToPath = memoize(function(string) { + var stringToPath = memoizeCapped(function(string) { string = toString(string); var result = []; @@ -16609,24 +16892,25 @@ function serializer(replacer, cycleReplacer) { * // => [1] */ function concat() { - var length = arguments.length, - args = Array(length ? length - 1 : 0), + var length = arguments.length; + if (!length) { + return []; + } + var args = Array(length - 1), array = arguments[0], index = length; while (index--) { args[index - 1] = arguments[index]; } - return length - ? arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)) - : []; + return arrayPush(isArray(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } /** * Creates an array of `array` values not included in the other given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order of result values is determined by the - * order they occur in the first array. + * for equality comparisons. The order and references of result values are + * determined by the first array. * * **Note:** Unlike `_.pullAll`, this method returns a new array. * @@ -16652,8 +16936,9 @@ function serializer(replacer, cycleReplacer) { /** * This method is like `_.difference` except that it accepts `iteratee` which * is invoked for each element of `array` and `values` to generate the criterion - * by which they're compared. Result values are chosen from the first array. - * The iteratee is invoked with one argument: (value). + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). * * **Note:** Unlike `_.pullAllBy`, this method returns a new array. * @@ -16686,9 +16971,9 @@ function serializer(replacer, cycleReplacer) { /** * This method is like `_.difference` except that it accepts `comparator` - * which is invoked to compare elements of `array` to `values`. Result values - * are chosen from the first array. The comparator is invoked with two arguments: - * (arrVal, othVal). + * which is invoked to compare elements of `array` to `values`. The order and + * references of result values are determined by the first array. The comparator + * is invoked with two arguments: (arrVal, othVal). * * **Note:** Unlike `_.pullAllWith`, this method returns a new array. * @@ -17182,8 +17467,8 @@ function serializer(replacer, cycleReplacer) { /** * Creates an array of unique values that are included in all given arrays * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons. The order of result values is determined by the - * order they occur in the first array. + * for equality comparisons. The order and references of result values are + * determined by the first array. * * @static * @memberOf _ @@ -17206,8 +17491,9 @@ function serializer(replacer, cycleReplacer) { /** * This method is like `_.intersection` except that it accepts `iteratee` * which is invoked for each element of each `arrays` to generate the criterion - * by which they're compared. Result values are chosen from the first array. - * The iteratee is invoked with one argument: (value). + * by which they're compared. The order and references of result values are + * determined by the first array. The iteratee is invoked with one argument: + * (value). * * @static * @memberOf _ @@ -17241,9 +17527,9 @@ function serializer(replacer, cycleReplacer) { /** * This method is like `_.intersection` except that it accepts `comparator` - * which is invoked to compare elements of `arrays`. Result values are chosen - * from the first array. The comparator is invoked with two arguments: - * (arrVal, othVal). + * which is invoked to compare elements of `arrays`. The order and references + * of result values are determined by the first array. The comparator is + * invoked with two arguments: (arrVal, othVal). * * @static * @memberOf _ @@ -17341,21 +17627,11 @@ function serializer(replacer, cycleReplacer) { var index = length; if (fromIndex !== undefined) { index = toInteger(fromIndex); - index = ( - index < 0 - ? nativeMax(length + index, 0) - : nativeMin(index, length - 1) - ) + 1; + index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); } - if (value !== value) { - return baseFindIndex(array, baseIsNaN, index - 1, true); - } - while (index--) { - if (array[index] === value) { - return index; - } - } - return -1; + return value === value + ? strictLastIndexOf(array, value, index) + : baseFindIndex(array, baseIsNaN, index, true); } /** @@ -17517,9 +17793,7 @@ function serializer(replacer, cycleReplacer) { * console.log(pulled); * // => ['b', 'd'] */ - var pullAt = baseRest(function(array, indexes) { - indexes = baseFlatten(indexes, 1); - + var pullAt = flatRest(function(array, indexes) { var length = array ? array.length : 0, result = baseAt(array, indexes); @@ -18094,8 +18368,9 @@ function serializer(replacer, cycleReplacer) { /** * Creates a duplicate-free version of an array, using * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) - * for equality comparisons, in which only the first occurrence of each - * element is kept. + * for equality comparisons, in which only the first occurrence of each element + * is kept. The order of result values is determined by the order they occur + * in the array. * * @static * @memberOf _ @@ -18117,7 +18392,9 @@ function serializer(replacer, cycleReplacer) { /** * This method is like `_.uniq` except that it accepts `iteratee` which is * invoked for each element in `array` to generate the criterion by which - * uniqueness is computed. The iteratee is invoked with one argument: (value). + * uniqueness is computed. The order of result values is determined by the + * order they occur in the array. The iteratee is invoked with one argument: + * (value). * * @static * @memberOf _ @@ -18144,8 +18421,9 @@ function serializer(replacer, cycleReplacer) { /** * This method is like `_.uniq` except that it accepts `comparator` which - * is invoked to compare elements of `array`. The comparator is invoked with - * two arguments: (arrVal, othVal). + * is invoked to compare elements of `array`. The order of result values is + * determined by the order they occur in the array.The comparator is invoked + * with two arguments: (arrVal, othVal). * * @static * @memberOf _ @@ -18287,8 +18565,9 @@ function serializer(replacer, cycleReplacer) { /** * This method is like `_.xor` except that it accepts `iteratee` which is * invoked for each element of each `arrays` to generate the criterion by - * which by which they're compared. The iteratee is invoked with one argument: - * (value). + * which by which they're compared. The order of result values is determined + * by the order they occur in the arrays. The iteratee is invoked with one + * argument: (value). * * @static * @memberOf _ @@ -18317,8 +18596,9 @@ function serializer(replacer, cycleReplacer) { /** * This method is like `_.xor` except that it accepts `comparator` which is - * invoked to compare elements of `arrays`. The comparator is invoked with - * two arguments: (arrVal, othVal). + * invoked to compare elements of `arrays`. The order of result values is + * determined by the order they occur in the arrays. The comparator is invoked + * with two arguments: (arrVal, othVal). * * @static * @memberOf _ @@ -18535,8 +18815,7 @@ function serializer(replacer, cycleReplacer) { * _(object).at(['a[0].b.c', 'a[1]']).value(); * // => [3, 4] */ - var wrapperAt = baseRest(function(paths) { - paths = baseFlatten(paths, 1); + var wrapperAt = flatRest(function(paths) { var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, @@ -18801,7 +19080,11 @@ function serializer(replacer, cycleReplacer) { * // => { '3': 2, '5': 1 } */ var countBy = createAggregator(function(result, value, key) { - hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); + if (hasOwnProperty.call(result, key)) { + ++result[key]; + } else { + baseAssignValue(result, key, 1); + } }); /** @@ -19056,7 +19339,7 @@ function serializer(replacer, cycleReplacer) { * @see _.forEachRight * @example * - * _([1, 2]).forEach(function(value) { + * _.forEach([1, 2], function(value) { * console.log(value); * }); * // => Logs `1` then `2`. @@ -19124,7 +19407,7 @@ function serializer(replacer, cycleReplacer) { if (hasOwnProperty.call(result, key)) { result[key].push(value); } else { - result[key] = [value]; + baseAssignValue(result, key, [value]); } }); @@ -19237,7 +19520,7 @@ function serializer(replacer, cycleReplacer) { * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } */ var keyBy = createAggregator(function(result, value, key) { - result[key] = value; + baseAssignValue(result, key, value); }); /** @@ -19497,10 +19780,8 @@ function serializer(replacer, cycleReplacer) { * // => 2 */ function sample(collection) { - var array = isArrayLike(collection) ? collection : values(collection), - length = array.length; - - return length > 0 ? array[baseRandom(0, length - 1)] : undefined; + var func = isArray(collection) ? arraySample : baseSample; + return func(collection); } /** @@ -19524,25 +19805,13 @@ function serializer(replacer, cycleReplacer) { * // => [2, 3, 1] */ function sampleSize(collection, n, guard) { - var index = -1, - result = toArray(collection), - length = result.length, - lastIndex = length - 1; - if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { n = 1; } else { - n = baseClamp(toInteger(n), 0, length); - } - while (++index < n) { - var rand = baseRandom(index, lastIndex), - value = result[rand]; - - result[rand] = result[index]; - result[index] = value; + n = toInteger(n); } - result.length = n; - return result; + var func = isArray(collection) ? arraySampleSize : baseSampleSize; + return func(collection, n); } /** @@ -19561,7 +19830,8 @@ function serializer(replacer, cycleReplacer) { * // => [4, 1, 3, 2] */ function shuffle(collection) { - return sampleSize(collection, MAX_ARRAY_LENGTH); + var func = isArray(collection) ? arrayShuffle : baseShuffle; + return func(collection); } /** @@ -19666,16 +19936,11 @@ function serializer(replacer, cycleReplacer) { * { 'user': 'barney', 'age': 34 } * ]; * - * _.sortBy(users, function(o) { return o.user; }); + * _.sortBy(users, [function(o) { return o.user; }]); * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] * * _.sortBy(users, ['user', 'age']); * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] - * - * _.sortBy(users, 'user', function(o) { - * return Math.floor(o.age / 10); - * }); - * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] */ var sortBy = baseRest(function(collection, iteratees) { if (collection == null) { @@ -20190,7 +20455,7 @@ function serializer(replacer, cycleReplacer) { * _.defer(function(text) { * console.log(text); * }, 'deferred'); - * // => Logs 'deferred' after one or more milliseconds. + * // => Logs 'deferred' after one millisecond. */ var defer = baseRest(function(func, args) { return baseDelay(func, 1, args); @@ -20298,14 +20563,14 @@ function serializer(replacer, cycleReplacer) { return cache.get(key); } var result = func.apply(this, args); - memoized.cache = cache.set(key, result); + memoized.cache = cache.set(key, result) || cache; return result; }; memoized.cache = new (memoize.Cache || MapCache); return memoized; } - // Assign cache to `_.memoize`. + // Expose `MapCache`. memoize.Cache = MapCache; /** @@ -20397,7 +20662,7 @@ function serializer(replacer, cycleReplacer) { * func(10, 5); * // => [100, 10] */ - var overArgs = baseRest(function(func, transforms) { + var overArgs = castRest(function(func, transforms) { transforms = (transforms.length == 1 && isArray(transforms[0])) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); @@ -20511,8 +20776,8 @@ function serializer(replacer, cycleReplacer) { * rearged('b', 'c', 'a') * // => ['a', 'b', 'c'] */ - var rearg = baseRest(function(func, indexes) { - return createWrap(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); + var rearg = flatRest(function(func, indexes) { + return createWrap(func, REARG_FLAG, undefined, undefined, undefined, indexes); }); /** @@ -21002,11 +21267,10 @@ function serializer(replacer, cycleReplacer) { * _.isArguments([1, 2, 3]); * // => false */ - function isArguments(value) { - // Safari 8.1 makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); - } + var isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) { + return isObjectLike(value) && hasOwnProperty.call(value, 'callee') && + !propertyIsEnumerable.call(value, 'callee'); + }; /** * Checks if `value` is classified as an `Array` object. @@ -21188,7 +21452,7 @@ function serializer(replacer, cycleReplacer) { * // => false */ function isElement(value) { - return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); + return value != null && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); } /** @@ -21226,16 +21490,16 @@ function serializer(replacer, cycleReplacer) { */ function isEmpty(value) { if (isArrayLike(value) && - (isArray(value) || typeof value == 'string' || - typeof value.splice == 'function' || isBuffer(value) || isArguments(value))) { + (isArray(value) || typeof value == 'string' || typeof value.splice == 'function' || + isBuffer(value) || isTypedArray(value) || isArguments(value))) { return !value.length; } var tag = getTag(value); if (tag == mapTag || tag == setTag) { return !value.size; } - if (nonEnumShadows || isPrototype(value)) { - return !nativeKeys(value).length; + if (isPrototype(value)) { + return !baseKeys(value).length; } for (var key in value) { if (hasOwnProperty.call(value, key)) { @@ -21390,9 +21654,9 @@ function serializer(replacer, cycleReplacer) { */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8-9 which returns 'object' for typed array and other constructors. + // in Safari 9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; + return tag == funcTag || tag == genTag || tag == proxyTag; } /** @@ -21483,7 +21747,7 @@ function serializer(replacer, cycleReplacer) { */ function isObject(value) { var type = typeof value; - return !!value && (type == 'object' || type == 'function'); + return value != null && (type == 'object' || type == 'function'); } /** @@ -21511,7 +21775,7 @@ function serializer(replacer, cycleReplacer) { * // => false */ function isObjectLike(value) { - return !!value && typeof value == 'object'; + return value != null && typeof value == 'object'; } /** @@ -21665,7 +21929,7 @@ function serializer(replacer, cycleReplacer) { */ function isNative(value) { if (isMaskable(value)) { - throw new Error('This method is not supported with core-js. Try https://github.com/es-shims.'); + throw new Error(CORE_ERROR_TEXT); } return baseIsNative(value); } @@ -21775,8 +22039,7 @@ function serializer(replacer, cycleReplacer) { * // => true */ function isPlainObject(value) { - if (!isObjectLike(value) || - objectToString.call(value) != objectTag || isHostObject(value)) { + if (!isObjectLike(value) || objectToString.call(value) != objectTag) { return false; } var proto = getPrototype(value); @@ -22281,8 +22544,8 @@ function serializer(replacer, cycleReplacer) { * @memberOf _ * @since 4.0.0 * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. + * @param {*} value The value to convert. + * @returns {string} Returns the converted string. * @example * * _.toString(null); @@ -22333,7 +22596,7 @@ function serializer(replacer, cycleReplacer) { * // => { 'a': 1, 'c': 3 } */ var assign = createAssigner(function(object, source) { - if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } @@ -22461,9 +22724,7 @@ function serializer(replacer, cycleReplacer) { * _.at(object, ['a[0].b.c', 'a[1]']); * // => [3, 4] */ - var at = baseRest(function(object, paths) { - return baseAt(object, baseFlatten(paths, 1)); - }); + var at = flatRest(baseAt); /** * Creates an object that inherits from the `prototype` object. If a @@ -23066,7 +23327,7 @@ function serializer(replacer, cycleReplacer) { iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { - result[iteratee(value, key, object)] = value; + baseAssignValue(result, iteratee(value, key, object), value); }); return result; } @@ -23104,7 +23365,7 @@ function serializer(replacer, cycleReplacer) { iteratee = getIteratee(iteratee, 3); baseForOwn(object, function(value, key, object) { - result[key] = iteratee(value, key, object); + baseAssignValue(result, key, iteratee(value, key, object)); }); return result; } @@ -23148,7 +23409,7 @@ function serializer(replacer, cycleReplacer) { * This method is like `_.merge` except that it accepts `customizer` which * is invoked to produce the merged values of the destination and source * properties. If `customizer` returns `undefined`, merging is handled by the - * method instead. The `customizer` is invoked with seven arguments: + * method instead. The `customizer` is invoked with six arguments: * (objValue, srcValue, key, object, source, stack). * * **Note:** This method mutates `object`. @@ -23198,11 +23459,11 @@ function serializer(replacer, cycleReplacer) { * _.omit(object, ['a', 'c']); * // => { 'b': '2' } */ - var omit = baseRest(function(object, props) { + var omit = flatRest(function(object, props) { if (object == null) { return {}; } - props = arrayMap(baseFlatten(props, 1), toKey); + props = arrayMap(props, toKey); return basePick(object, baseDifference(getAllKeysIn(object), props)); }); @@ -23247,8 +23508,8 @@ function serializer(replacer, cycleReplacer) { * _.pick(object, ['a', 'c']); * // => { 'a': 1, 'c': 3 } */ - var pick = baseRest(function(object, props) { - return object == null ? {} : basePick(object, arrayMap(baseFlatten(props, 1), toKey)); + var pick = flatRest(function(object, props) { + return object == null ? {} : basePick(object, arrayMap(props, toKey)); }); /** @@ -23468,22 +23729,23 @@ function serializer(replacer, cycleReplacer) { * // => { '1': ['a', 'c'], '2': ['b'] } */ function transform(object, iteratee, accumulator) { - var isArr = isArray(object) || isTypedArray(object); - iteratee = getIteratee(iteratee, 4); + var isArr = isArray(object), + isArrLike = isArr || isBuffer(object) || isTypedArray(object); + iteratee = getIteratee(iteratee, 4); if (accumulator == null) { - if (isArr || isObject(object)) { - var Ctor = object.constructor; - if (isArr) { - accumulator = isArray(object) ? new Ctor : []; - } else { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } - } else { + var Ctor = object && object.constructor; + if (isArrLike) { + accumulator = isArr ? new Ctor : []; + } + else if (isObject(object)) { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + else { accumulator = {}; } } - (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { + (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object) { return iteratee(accumulator, value, index, object); }); return accumulator; @@ -23902,8 +24164,8 @@ function serializer(replacer, cycleReplacer) { } /** - * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to - * their corresponding HTML entities. + * Converts the characters "&", "<", ">", '"', and "'" in `string` to their + * corresponding HTML entities. * * **Note:** No other characters are escaped. To escape additional * characters use a third-party library like [_he_](https://mths.be/he). @@ -23914,12 +24176,6 @@ function serializer(replacer, cycleReplacer) { * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) * (under "semi-related fun fact") for more details. * - * Backticks are escaped because in IE < 9, they can break out of - * attribute values or HTML comments. See [#59](https://html5sec.org/#59), - * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and - * [#133](https://html5sec.org/#133) of the - * [HTML5 Security Cheatsheet](https://html5sec.org/) for more details. - * * When working with HTML you should always * [quote attribute values](http://wonko.com/post/html-escaping) to reduce * XSS vectors. @@ -24162,15 +24418,12 @@ function serializer(replacer, cycleReplacer) { * // => [6, 8, 10] */ function parseInt(string, radix, guard) { - // Chrome fails to trim leading whitespace characters. - // See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details. if (guard || radix == null) { radix = 0; } else if (radix) { radix = +radix; } - string = toString(string).replace(reTrim, ''); - return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); + return nativeParseInt(toString(string).replace(reTrimStart, ''), radix || 0); } /** @@ -24409,7 +24662,8 @@ function serializer(replacer, cycleReplacer) { * compiled({ 'user': 'barney' }); * // => 'hello barney!' * - * // Use the ES delimiter as an alternative to the default "interpolate" delimiter. + * // Use the ES template literal delimiter as an "interpolate" delimiter. + * // Disable support by replacing the "interpolate" delimiter. * var compiled = _.template('hello ${ user }!'); * compiled({ 'user': 'pebbles' }); * // => 'hello pebbles!' @@ -24810,7 +25064,7 @@ function serializer(replacer, cycleReplacer) { /** * The inverse of `_.escape`; this method converts the HTML entities - * `&`, `<`, `>`, `"`, `'`, and ``` in `string` to + * `&`, `<`, `>`, `"`, and `'` in `string` to * their corresponding characters. * * **Note:** No other HTML entities are unescaped. To unescape additional @@ -24964,10 +25218,10 @@ function serializer(replacer, cycleReplacer) { * jQuery(element).on('click', view.click); * // => Logs 'clicked docs' when clicked. */ - var bindAll = baseRest(function(object, methodNames) { - arrayEach(baseFlatten(methodNames, 1), function(key) { + var bindAll = flatRest(function(object, methodNames) { + arrayEach(methodNames, function(key) { key = toKey(key); - object[key] = bind(object[key], object); + baseAssignValue(object, key, bind(object[key], object)); }); return object; }); @@ -26758,7 +27012,7 @@ function serializer(replacer, cycleReplacer) { lodash.prototype[iteratorSymbol] = wrapperToIterator; } return lodash; - } + }); /*--------------------------------------------------------------------------*/ @@ -26895,7 +27149,7 @@ mkdirP.sync = function sync (p, opts, made) { }; }).call(this,require('_process')) -},{"_process":94,"fs":6,"path":92}],74:[function(require,module,exports){ +},{"_process":91,"fs":6,"path":89}],74:[function(require,module,exports){ /** * Helpers. */ @@ -27358,7 +27612,7 @@ Back.setMode(process.env.NOCK_BACK_MODE || 'dryrun'); module.exports = exports = Back; }).call(this,require('_process')) -},{"./recorder":84,"./scope":86,"_process":94,"chai":11,"debug":43,"fs":6,"lodash":72,"mkdirp":73,"path":92,"util":136}],77:[function(require,module,exports){ +},{"./recorder":84,"./scope":86,"_process":91,"chai":11,"debug":43,"fs":6,"lodash":88,"mkdirp":73,"path":89,"util":139}],77:[function(require,module,exports){ (function (Buffer){ 'use strict'; @@ -27583,6 +27837,20 @@ var headersFieldsArrayToLowerCase = function (headers) { })); }; +var headersArrayToObject = function (rawHeaders) { + if(!_.isArray(rawHeaders)) { + return rawHeaders; + } + + var headers = {}; + + for (var i=0, len=rawHeaders.length; i + * Build: `lodash -d -o ./foo/lodash.js` + * Copyright jQuery Foundation and other contributors + * Released under MIT license + * Based on Underscore.js 1.8.3 + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors + */ +;(function() { -var Stringify = require('./stringify'); -var Parse = require('./parse'); + /** Used as a safe reference for `undefined` in pre-ES5 environments. */ + var undefined; -module.exports = { - stringify: Stringify, - parse: Parse -}; + /** Used as the semantic version number. */ + var VERSION = '4.9.0'; -},{"./parse":89,"./stringify":90}],89:[function(require,module,exports){ -'use strict'; + /** Used as the size to enable large array optimizations. */ + var LARGE_ARRAY_SIZE = 200; -var Utils = require('./utils'); + /** Used as the `TypeError` message for "Functions" methods. */ + var FUNC_ERROR_TEXT = 'Expected a function'; -var has = Object.prototype.hasOwnProperty; + /** Used to stand-in for `undefined` hash values. */ + var HASH_UNDEFINED = '__lodash_hash_undefined__'; -var defaults = { - delimiter: '&', - depth: 5, - arrayLimit: 20, - parameterLimit: 1000, - strictNullHandling: false, - plainObjects: false, - allowPrototypes: false, - allowDots: false, - decoder: Utils.decode -}; + /** Used as the internal argument placeholder. */ + var PLACEHOLDER = '__lodash_placeholder__'; -var parseValues = function parseValues(str, options) { - var obj = {}; - var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); + /** Used to compose bitmasks for wrapper metadata. */ + var BIND_FLAG = 1, + BIND_KEY_FLAG = 2, + CURRY_BOUND_FLAG = 4, + CURRY_FLAG = 8, + CURRY_RIGHT_FLAG = 16, + PARTIAL_FLAG = 32, + PARTIAL_RIGHT_FLAG = 64, + ARY_FLAG = 128, + REARG_FLAG = 256, + FLIP_FLAG = 512; - for (var i = 0; i < parts.length; ++i) { - var part = parts[i]; - var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + /** Used to compose bitmasks for comparison styles. */ + var UNORDERED_COMPARE_FLAG = 1, + PARTIAL_COMPARE_FLAG = 2; - var key, val; - if (pos === -1) { - key = options.decoder(part); - val = options.strictNullHandling ? null : ''; - } else { - key = options.decoder(part.slice(0, pos)); - val = options.decoder(part.slice(pos + 1)); - } - if (has.call(obj, key)) { - obj[key] = [].concat(obj[key]).concat(val); - } else { - obj[key] = val; - } - } + /** Used as default options for `_.truncate`. */ + var DEFAULT_TRUNC_LENGTH = 30, + DEFAULT_TRUNC_OMISSION = '...'; - return obj; -}; + /** Used to detect hot functions by number of calls within a span of milliseconds. */ + var HOT_COUNT = 150, + HOT_SPAN = 16; -var parseObject = function parseObject(chain, val, options) { - if (!chain.length) { - return val; - } + /** Used to indicate the type of lazy iteratees. */ + var LAZY_FILTER_FLAG = 1, + LAZY_MAP_FLAG = 2, + LAZY_WHILE_FLAG = 3; - var root = chain.shift(); + /** Used as references for various `Number` constants. */ + var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991, + MAX_INTEGER = 1.7976931348623157e+308, + NAN = 0 / 0; - var obj; - if (root === '[]') { - obj = []; - obj = obj.concat(parseObject(chain, val, options)); - } else { - obj = options.plainObjects ? Object.create(null) : {}; - var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; - var index = parseInt(cleanRoot, 10); - if ( - !isNaN(index) && - root !== cleanRoot && - String(index) === cleanRoot && - index >= 0 && - (options.parseArrays && index <= options.arrayLimit) - ) { - obj = []; - obj[index] = parseObject(chain, val, options); - } else { - obj[cleanRoot] = parseObject(chain, val, options); - } - } + /** Used as references for the maximum length and index of an array. */ + var MAX_ARRAY_LENGTH = 4294967295, + MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, + HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - return obj; -}; + /** `Object#toString` result references. */ + var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]', + weakSetTag = '[object WeakSet]'; -var parseKeys = function parseKeys(givenKey, val, options) { - if (!givenKey) { - return; - } + var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; - // Transform dot notation to bracket notation - var key = options.allowDots ? givenKey.replace(/\.([^\.\[]+)/g, '[$1]') : givenKey; + /** Used to match empty string literals in compiled template source. */ + var reEmptyStringLeading = /\b__p \+= '';/g, + reEmptyStringMiddle = /\b(__p \+=) '' \+/g, + reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - // The regex chunks + /** Used to match HTML entities and HTML characters. */ + var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, + reUnescapedHtml = /[&<>"'`]/g, + reHasEscapedHtml = RegExp(reEscapedHtml.source), + reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - var parent = /^([^\[\]]*)/; - var child = /(\[[^\[\]]*\])/g; + /** Used to match template delimiters. */ + var reEscape = /<%-([\s\S]+?)%>/g, + reEvaluate = /<%([\s\S]+?)%>/g, + reInterpolate = /<%=([\s\S]+?)%>/g; - // Get the parent + /** Used to match property names within property paths. */ + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, + reIsPlainProp = /^\w*$/, + rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g; - var segment = parent.exec(key); + /** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). + */ + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, + reHasRegExpChar = RegExp(reRegExpChar.source); - // Stash the parent if it exists + /** Used to match leading and trailing whitespace. */ + var reTrim = /^\s+|\s+$/g, + reTrimStart = /^\s+/, + reTrimEnd = /\s+$/; - var keys = []; - if (segment[1]) { - // If we aren't using plain objects, optionally prefix keys - // that would overwrite object prototype properties - if (!options.plainObjects && has.call(Object.prototype, segment[1])) { - if (!options.allowPrototypes) { - return; - } - } + /** Used to match backslashes in property paths. */ + var reEscapeChar = /\\(\\)?/g; - keys.push(segment[1]); - } + /** + * Used to match + * [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). + */ + var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - // Loop through children appending to the array until we hit depth + /** Used to match `RegExp` flags from their coerced string values. */ + var reFlags = /\w*$/; - var i = 0; - while ((segment = child.exec(key)) !== null && i < options.depth) { - i += 1; - if (!options.plainObjects && has.call(Object.prototype, segment[1].replace(/\[|\]/g, ''))) { - if (!options.allowPrototypes) { - continue; - } - } - keys.push(segment[1]); - } + /** Used to detect hexadecimal string values. */ + var reHasHexPrefix = /^0x/i; - // If there's a remainder, just add whatever is left + /** Used to detect bad signed hexadecimal string values. */ + var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - if (segment) { - keys.push('[' + key.slice(segment.index) + ']'); - } + /** Used to detect binary string values. */ + var reIsBinary = /^0b[01]+$/i; - return parseObject(keys, val, options); -}; + /** Used to detect host constructors (Safari). */ + var reIsHostCtor = /^\[object .+?Constructor\]$/; -module.exports = function (str, opts) { - var options = opts || {}; + /** Used to detect octal string values. */ + var reIsOctal = /^0o[0-7]+$/i; - if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { - throw new TypeError('Decoder has to be a function.'); - } + /** Used to detect unsigned integer values. */ + var reIsUint = /^(?:0|[1-9]\d*)$/; - options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; - options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; - options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; - options.parseArrays = options.parseArrays !== false; - options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; - options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; - options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; - options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; - options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; - options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + /** Used to match latin-1 supplementary letters (excluding mathematical operators). */ + var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g; - if (str === '' || str === null || typeof str === 'undefined') { - return options.plainObjects ? Object.create(null) : {}; - } + /** Used to ensure capturing order of template delimiters. */ + var reNoMatch = /($^)/; - var tempObj = typeof str === 'string' ? parseValues(str, options) : str; - var obj = options.plainObjects ? Object.create(null) : {}; + /** Used to match unescaped characters in compiled string literals. */ + var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - // Iterate over the keys and setup the new object + /** Used to compose unicode character classes. */ + var rsAstralRange = '\\ud800-\\udfff', + rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', + rsComboSymbolsRange = '\\u20d0-\\u20f0', + rsDingbatRange = '\\u2700-\\u27bf', + rsLowerRange = 'a-z\\xdf-\\xf6\\xf8-\\xff', + rsMathOpRange = '\\xac\\xb1\\xd7\\xf7', + rsNonCharRange = '\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf', + rsQuoteRange = '\\u2018\\u2019\\u201c\\u201d', + rsSpaceRange = ' \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000', + rsUpperRange = 'A-Z\\xc0-\\xd6\\xd8-\\xde', + rsVarRange = '\\ufe0e\\ufe0f', + rsBreakRange = rsMathOpRange + rsNonCharRange + rsQuoteRange + rsSpaceRange; - var keys = Object.keys(tempObj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var newObj = parseKeys(key, tempObj[key], options); - obj = Utils.merge(obj, newObj, options); - } + /** Used to compose unicode capture groups. */ + var rsAstral = '[' + rsAstralRange + ']', + rsBreak = '[' + rsBreakRange + ']', + rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', + rsDigits = '\\d+', + rsDingbat = '[' + rsDingbatRange + ']', + rsLower = '[' + rsLowerRange + ']', + rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']', + rsFitz = '\\ud83c[\\udffb-\\udfff]', + rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', + rsNonAstral = '[^' + rsAstralRange + ']', + rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', + rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', + rsUpper = '[' + rsUpperRange + ']', + rsZWJ = '\\u200d'; - return Utils.compact(obj); -}; + /** Used to compose unicode regexes. */ + var rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')', + rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')', + reOptMod = rsModifier + '?', + rsOptVar = '[' + rsVarRange + ']?', + rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', + rsSeq = rsOptVar + reOptMod + rsOptJoin, + rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq, + rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; -},{"./utils":91}],90:[function(require,module,exports){ -'use strict'; + /** + * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and + * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols). + */ + var reComboMark = RegExp(rsCombo, 'g'); -var Utils = require('./utils'); + /** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ + var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); -var arrayPrefixGenerators = { - brackets: function brackets(prefix) { - return prefix + '[]'; - }, - indices: function indices(prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function repeat(prefix) { - return prefix; - } -}; + /** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ + var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); -var defaults = { - delimiter: '&', - strictNullHandling: false, - skipNulls: false, - encode: true, - encoder: Utils.encode -}; + /** Used to match non-compound words composed of alphanumeric characters. */ + var reBasicWord = /[a-zA-Z0-9]+/g; -var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots) { - var obj = object; - if (typeof filter === 'function') { - obj = filter(prefix, obj); - } else if (obj instanceof Date) { - obj = obj.toISOString(); - } else if (obj === null) { - if (strictNullHandling) { - return encoder ? encoder(prefix) : prefix; - } + /** Used to match complex or compound words. */ + var reComplexWord = RegExp([ + rsUpper + '?' + rsLower + '+(?=' + [rsBreak, rsUpper, '$'].join('|') + ')', + rsUpperMisc + '+(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')', + rsUpper + '?' + rsLowerMisc + '+', + rsUpper + '+', + rsDigits, + rsEmoji + ].join('|'), 'g'); - obj = ''; - } + /** Used to detect strings that need a more robust regexp to match words. */ + var reHasComplexWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || Utils.isBuffer(obj)) { - if (encoder) { - return [encoder(prefix) + '=' + encoder(obj)]; - } - return [prefix + '=' + String(obj)]; - } + /** Used to assign default `context` object properties. */ + var contextProps = [ + 'Array', 'Buffer', 'DataView', 'Date', 'Error', 'Float32Array', 'Float64Array', + 'Function', 'Int8Array', 'Int16Array', 'Int32Array', 'Map', 'Math', 'Object', + 'Promise', 'Reflect', 'RegExp', 'Set', 'String', 'Symbol', 'TypeError', + 'Uint8Array', 'Uint8ClampedArray', 'Uint16Array', 'Uint32Array', 'WeakMap', + '_', 'clearTimeout', 'isFinite', 'parseInt', 'setTimeout' + ]; - var values = []; + /** Used to make template sourceURLs easier to identify. */ + var templateCounter = -1; - if (typeof obj === 'undefined') { - return values; - } + /** Used to identify `toStringTag` values of typed arrays. */ + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = + typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = + typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = + typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = + typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = + typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = + typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = + typedArrayTags[errorTag] = typedArrayTags[funcTag] = + typedArrayTags[mapTag] = typedArrayTags[numberTag] = + typedArrayTags[objectTag] = typedArrayTags[regexpTag] = + typedArrayTags[setTag] = typedArrayTags[stringTag] = + typedArrayTags[weakMapTag] = false; - var objKeys; - if (Array.isArray(filter)) { - objKeys = filter; - } else { - var keys = Object.keys(obj); - objKeys = sort ? keys.sort(sort) : keys; - } + /** Used to identify `toStringTag` values supported by `_.clone`. */ + var cloneableTags = {}; + cloneableTags[argsTag] = cloneableTags[arrayTag] = + cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = + cloneableTags[boolTag] = cloneableTags[dateTag] = + cloneableTags[float32Tag] = cloneableTags[float64Tag] = + cloneableTags[int8Tag] = cloneableTags[int16Tag] = + cloneableTags[int32Tag] = cloneableTags[mapTag] = + cloneableTags[numberTag] = cloneableTags[objectTag] = + cloneableTags[regexpTag] = cloneableTags[setTag] = + cloneableTags[stringTag] = cloneableTags[symbolTag] = + cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = + cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; + cloneableTags[errorTag] = cloneableTags[funcTag] = + cloneableTags[weakMapTag] = false; - for (var i = 0; i < objKeys.length; ++i) { - var key = objKeys[i]; + /** Used to map latin-1 supplementary letters to basic latin letters. */ + var deburredLetters = { + '\xc0': 'A', '\xc1': 'A', '\xc2': 'A', '\xc3': 'A', '\xc4': 'A', '\xc5': 'A', + '\xe0': 'a', '\xe1': 'a', '\xe2': 'a', '\xe3': 'a', '\xe4': 'a', '\xe5': 'a', + '\xc7': 'C', '\xe7': 'c', + '\xd0': 'D', '\xf0': 'd', + '\xc8': 'E', '\xc9': 'E', '\xca': 'E', '\xcb': 'E', + '\xe8': 'e', '\xe9': 'e', '\xea': 'e', '\xeb': 'e', + '\xcC': 'I', '\xcd': 'I', '\xce': 'I', '\xcf': 'I', + '\xeC': 'i', '\xed': 'i', '\xee': 'i', '\xef': 'i', + '\xd1': 'N', '\xf1': 'n', + '\xd2': 'O', '\xd3': 'O', '\xd4': 'O', '\xd5': 'O', '\xd6': 'O', '\xd8': 'O', + '\xf2': 'o', '\xf3': 'o', '\xf4': 'o', '\xf5': 'o', '\xf6': 'o', '\xf8': 'o', + '\xd9': 'U', '\xda': 'U', '\xdb': 'U', '\xdc': 'U', + '\xf9': 'u', '\xfa': 'u', '\xfb': 'u', '\xfc': 'u', + '\xdd': 'Y', '\xfd': 'y', '\xff': 'y', + '\xc6': 'Ae', '\xe6': 'ae', + '\xde': 'Th', '\xfe': 'th', + '\xdf': 'ss' + }; - if (skipNulls && obj[key] === null) { - continue; - } + /** Used to map characters to HTML entities. */ + var htmlEscapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''', + '`': '`' + }; - if (Array.isArray(obj)) { - values = values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); - } else { - values = values.concat(stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); - } - } + /** Used to map HTML entities to characters. */ + var htmlUnescapes = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'", + '`': '`' + }; - return values; -}; + /** Used to determine if values are of the language type `Object`. */ + var objectTypes = { + 'function': true, + 'object': true + }; -module.exports = function (object, opts) { - var obj = object; - var options = opts || {}; - var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; - var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; - var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; - var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; - var encoder = encode ? (typeof options.encoder === 'function' ? options.encoder : defaults.encoder) : null; - var sort = typeof options.sort === 'function' ? options.sort : null; - var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; - var objKeys; - var filter; + /** Used to escape characters for inclusion in compiled string literals. */ + var stringEscapes = { + '\\': '\\', + "'": "'", + '\n': 'n', + '\r': 'r', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; - if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { - throw new TypeError('Encoder has to be a function.'); - } + /** Built-in method references without a dependency on `root`. */ + var freeParseFloat = parseFloat, + freeParseInt = parseInt; - if (typeof options.filter === 'function') { - filter = options.filter; - obj = filter('', obj); - } else if (Array.isArray(options.filter)) { - objKeys = filter = options.filter; - } + /** Detect free variable `exports`. */ + var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) + ? exports + : undefined; - var keys = []; + /** Detect free variable `module`. */ + var freeModule = (objectTypes[typeof module] && module && !module.nodeType) + ? module + : undefined; - if (typeof obj !== 'object' || obj === null) { - return ''; - } + /** Detect the popular CommonJS extension `module.exports`. */ + var moduleExports = (freeModule && freeModule.exports === freeExports) + ? freeExports + : undefined; - var arrayFormat; - if (options.arrayFormat in arrayPrefixGenerators) { - arrayFormat = options.arrayFormat; - } else if ('indices' in options) { - arrayFormat = options.indices ? 'indices' : 'repeat'; - } else { - arrayFormat = 'indices'; + /** Detect free variable `global` from Node.js. */ + var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); + + /** Detect free variable `self`. */ + var freeSelf = checkGlobal(objectTypes[typeof self] && self); + + /** Detect free variable `window`. */ + var freeWindow = checkGlobal(objectTypes[typeof window] && window); + + /** Detect `this` as the global object. */ + var thisGlobal = checkGlobal(objectTypes[typeof this] && this); + + /** + * Used as a reference to the global object. + * + * The `this` value is used if it's the global object to avoid Greasemonkey's + * restricted `window` object, otherwise the `window` object is used. + */ + var root = freeGlobal || + ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || + freeSelf || thisGlobal || Function('return this')(); + + /*--------------------------------------------------------------------------*/ + + /** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ + function addMapEntry(map, pair) { + // Don't return `Map#set` because it doesn't return the map instance in IE 11. + map.set(pair[0], pair[1]); + return map; + } + + /** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ + function addSetEntry(set, value) { + set.add(value); + return set; + } + + /** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ + function apply(func, thisArg, args) { + var length = args.length; + switch (length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); + } + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + /** + * Creates a new array concatenating `array` with `other`. + * + * @private + * @param {Array} array The first array to concatenate. + * @param {Array} other The second array to concatenate. + * @returns {Array} Returns the new concatenated array. + */ + function arrayConcat(array, other) { + var index = -1, + length = array.length, + othIndex = -1, + othLength = other.length, + result = Array(length + othLength); + + while (++index < length) { + result[index] = array[index]; + } + while (++othIndex < othLength) { + result[index++] = other[othIndex]; + } + return result; + } + + /** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEach(array, iteratee) { + var index = -1, + length = array.length; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.forEachRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ + function arrayEachRight(array, iteratee) { + var length = array.length; + + while (length--) { + if (iteratee(array[length], length, array) === false) { + break; + } + } + return array; + } + + /** + * A specialized version of `_.every` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + */ + function arrayEvery(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (!predicate(array[index], index, array)) { + return false; + } + } + return true; + } + + /** + * A specialized version of `_.filter` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function arrayFilter(array, predicate) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludes(array, value) { + return !!array.length && baseIndexOf(array, value, 0) > -1; + } + + /** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ + function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; + } + + /** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function arrayMap(array, iteratee) { + var index = -1, + length = array.length, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; + } + + /** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ + function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; + } + + /** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array.length; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; + } + + /** + * A specialized version of `_.reduceRight` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the last element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ + function arrayReduceRight(array, iteratee, accumulator, initAccum) { + var length = array.length; + if (initAccum && length) { + accumulator = array[--length]; + } + while (length--) { + accumulator = iteratee(accumulator, array[length], length, array); + } + return accumulator; + } + + /** + * A specialized version of `_.some` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function arraySome(array, predicate) { + var index = -1, + length = array.length; + + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; + } + } + return false; + } + + /** + * The base implementation of methods like `_.max` and `_.min` which accepts a + * `comparator` to determine the extremum value. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The iteratee invoked per iteration. + * @param {Function} comparator The comparator used to compare values. + * @returns {*} Returns the extremum value. + */ + function baseExtremum(array, iteratee, comparator) { + var index = -1, + length = array.length; + + while (++index < length) { + var value = array[index], + current = iteratee(value); + + if (current != null && (computed === undefined + ? current === current + : comparator(current, computed) + )) { + var computed = current, + result = value; + } + } + return result; + } + + /** + * The base implementation of methods like `_.find` and `_.findKey`, without + * support for iteratee shorthands, which iterates over `collection` using + * `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to search. + * @param {Function} predicate The function invoked per iteration. + * @param {Function} eachFunc The function to iterate over `collection`. + * @param {boolean} [retKey] Specify returning the key of the found element + * instead of the element itself. + * @returns {*} Returns the found element or its key, else `undefined`. + */ + function baseFind(collection, predicate, eachFunc, retKey) { + var result; + eachFunc(collection, function(value, key, collection) { + if (predicate(value, key, collection)) { + result = retKey ? key : value; + return false; + } + }); + return result; + } + + /** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to search. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseFindIndex(array, predicate, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return indexOfNaN(array, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * This function is like `baseIndexOf` except that it accepts a comparator. + * + * @private + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @param {Function} comparator The comparator invoked per element. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function baseIndexOfWith(array, value, fromIndex, comparator) { + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (comparator(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * The base implementation of `_.mean` and `_.meanBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the mean. + */ + function baseMean(array, iteratee) { + var length = array ? array.length : 0; + return length ? (baseSum(array, iteratee) / length) : NAN; + } + + /** + * The base implementation of `_.reduce` and `_.reduceRight`, without support + * for iteratee shorthands, which iterates over `collection` using `eachFunc`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} accumulator The initial value. + * @param {boolean} initAccum Specify using the first or last element of + * `collection` as the initial value. + * @param {Function} eachFunc The function to iterate over `collection`. + * @returns {*} Returns the accumulated value. + */ + function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { + eachFunc(collection, function(value, index, collection) { + accumulator = initAccum + ? (initAccum = false, value) + : iteratee(accumulator, value, index, collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.sortBy` which uses `comparer` to define the + * sort order of `array` and replaces criteria objects with their corresponding + * values. + * + * @private + * @param {Array} array The array to sort. + * @param {Function} comparer The function to define sort order. + * @returns {Array} Returns `array`. + */ + function baseSortBy(array, comparer) { + var length = array.length; + + array.sort(comparer); + while (length--) { + array[length] = array[length].value; + } + return array; + } + + /** + * The base implementation of `_.sum` and `_.sumBy` without support for + * iteratee shorthands. + * + * @private + * @param {Array} array The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {number} Returns the sum. + */ + function baseSum(array, iteratee) { + var result, + index = -1, + length = array.length; + + while (++index < length) { + var current = iteratee(array[index]); + if (current !== undefined) { + result = result === undefined ? current : (result + current); + } + } + return result; + } + + /** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ + function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; + } + + /** + * The base implementation of `_.toPairs` and `_.toPairsIn` which creates an array + * of key-value pairs for `object` corresponding to the property names of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the new array of key-value pairs. + */ + function baseToPairs(object, props) { + return arrayMap(props, function(key) { + return [key, object[key]]; + }); + } + + /** + * The base implementation of `_.unary` without support for storing wrapper metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new function. + */ + function baseUnary(func) { + return function(value) { + return func(value); + }; + } + + /** + * The base implementation of `_.values` and `_.valuesIn` which creates an + * array of `object` property values corresponding to the property names + * of `props`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} props The property names to get values for. + * @returns {Object} Returns the array of property values. + */ + function baseValues(object, props) { + return arrayMap(props, function(key) { + return object[key]; + }); + } + + /** + * Used by `_.trim` and `_.trimStart` to get the index of the first string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the first unmatched string symbol. + */ + function charsStartIndex(strSymbols, chrSymbols) { + var index = -1, + length = strSymbols.length; + + while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Used by `_.trim` and `_.trimEnd` to get the index of the last string symbol + * that is not found in the character symbols. + * + * @private + * @param {Array} strSymbols The string symbols to inspect. + * @param {Array} chrSymbols The character symbols to find. + * @returns {number} Returns the index of the last unmatched string symbol. + */ + function charsEndIndex(strSymbols, chrSymbols) { + var index = strSymbols.length; + + while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) {} + return index; + } + + /** + * Checks if `value` is a global object. + * + * @private + * @param {*} value The value to check. + * @returns {null|Object} Returns `value` if it's a global object, else `null`. + */ + function checkGlobal(value) { + return (value && value.Object === Object) ? value : null; + } + + /** + * Compares values to sort them in ascending order. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {number} Returns the sort order indicator for `value`. + */ + function compareAscending(value, other) { + if (value !== other) { + var valIsNull = value === null, + valIsUndef = value === undefined, + valIsReflexive = value === value; + + var othIsNull = other === null, + othIsUndef = other === undefined, + othIsReflexive = other === other; + + if ((value > other && !othIsNull) || !valIsReflexive || + (valIsNull && !othIsUndef && othIsReflexive) || + (valIsUndef && othIsReflexive)) { + return 1; + } + if ((value < other && !valIsNull) || !othIsReflexive || + (othIsNull && !valIsUndef && valIsReflexive) || + (othIsUndef && valIsReflexive)) { + return -1; + } + } + return 0; + } + + /** + * Used by `_.orderBy` to compare multiple properties of a value to another + * and stable sort them. + * + * If `orders` is unspecified, all values are sorted in ascending order. Otherwise, + * specify an order of "desc" for descending or "asc" for ascending sort order + * of corresponding values. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {boolean[]|string[]} orders The order to sort by for each property. + * @returns {number} Returns the sort order indicator for `object`. + */ + function compareMultiple(object, other, orders) { + var index = -1, + objCriteria = object.criteria, + othCriteria = other.criteria, + length = objCriteria.length, + ordersLength = orders.length; + + while (++index < length) { + var result = compareAscending(objCriteria[index], othCriteria[index]); + if (result) { + if (index >= ordersLength) { + return result; + } + var order = orders[index]; + return result * (order == 'desc' ? -1 : 1); + } + } + // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications + // that causes it, under certain circumstances, to provide the same value for + // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247 + // for more details. + // + // This also ensures a stable sort in V8 and other engines. + // See https://bugs.chromium.org/p/v8/issues/detail?id=90 for more details. + return object.index - other.index; + } + + /** + * Gets the number of `placeholder` occurrences in `array`. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} placeholder The placeholder to search for. + * @returns {number} Returns the placeholder count. + */ + function countHolders(array, placeholder) { + var length = array.length, + result = 0; + + while (length--) { + if (array[length] === placeholder) { + result++; + } + } + return result; + } + + /** + * Creates a function that performs a mathematical operation on two values. + * + * @private + * @param {Function} operator The function to perform the operation. + * @returns {Function} Returns the new mathematical operation function. + */ + function createMathOperation(operator) { + return function(value, other) { + var result; + if (value === undefined && other === undefined) { + return 0; + } + if (value !== undefined) { + result = value; + } + if (other !== undefined) { + result = result === undefined ? other : operator(result, other); + } + return result; + }; + } + + /** + * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters. + * + * @private + * @param {string} letter The matched letter to deburr. + * @returns {string} Returns the deburred letter. + */ + function deburrLetter(letter) { + return deburredLetters[letter]; + } + + /** + * Used by `_.escape` to convert characters to HTML entities. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeHtmlChar(chr) { + return htmlEscapes[chr]; + } + + /** + * Used by `_.template` to escape characters for inclusion in compiled string literals. + * + * @private + * @param {string} chr The matched character to escape. + * @returns {string} Returns the escaped character. + */ + function escapeStringChar(chr) { + return '\\' + stringEscapes[chr]; + } + + /** + * Gets the index at which the first occurrence of `NaN` is found in `array`. + * + * @private + * @param {Array} array The array to search. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched `NaN`, else `-1`. + */ + function indexOfNaN(array, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 0 : -1); + + while ((fromRight ? index-- : ++index < length)) { + var other = array[index]; + if (other !== other) { + return index; + } + } + return -1; + } + + /** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ + function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; + } + + /** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ + function isIndex(value, length) { + value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; + length = length == null ? MAX_SAFE_INTEGER : length; + return value > -1 && value % 1 == 0 && value < length; + } + + /** + * Converts `iterator` to an array. + * + * @private + * @param {Object} iterator The iterator to convert. + * @returns {Array} Returns the converted array. + */ + function iteratorToArray(iterator) { + var data, + result = []; + + while (!(data = iterator.next()).done) { + result.push(data.value); + } + return result; + } + + /** + * Converts `map` to an array. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the converted array. + */ + function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; + } + + /** + * Replaces all `placeholder` elements in `array` with an internal placeholder + * and returns an array of their indexes. + * + * @private + * @param {Array} array The array to modify. + * @param {*} placeholder The placeholder to replace. + * @returns {Array} Returns the new array of placeholder indexes. + */ + function replaceHolders(array, placeholder) { + var index = -1, + length = array.length, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value === placeholder || value === PLACEHOLDER) { + array[index] = PLACEHOLDER; + result[resIndex++] = index; + } + } + return result; + } + + /** + * Converts `set` to an array. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the converted array. + */ + function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; + } + + /** + * Gets the number of symbols in `string`. + * + * @private + * @param {string} string The string to inspect. + * @returns {number} Returns the string size. + */ + function stringSize(string) { + if (!(string && reHasComplexSymbol.test(string))) { + return string.length; + } + var result = reComplexSymbol.lastIndex = 0; + while (reComplexSymbol.test(string)) { + result++; + } + return result; + } + + /** + * Converts `string` to an array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the converted array. + */ + function stringToArray(string) { + return string.match(reComplexSymbol); + } + + /** + * Used by `_.unescape` to convert HTML entities to characters. + * + * @private + * @param {string} chr The matched character to unescape. + * @returns {string} Returns the unescaped character. + */ + function unescapeHtmlChar(chr) { + return htmlUnescapes[chr]; + } + + /*--------------------------------------------------------------------------*/ + + /** + * Create a new pristine `lodash` function using the `context` object. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Util + * @param {Object} [context=root] The context object. + * @returns {Function} Returns a new `lodash` function. + * @example + * + * _.mixin({ 'foo': _.constant('foo') }); + * + * var lodash = _.runInContext(); + * lodash.mixin({ 'bar': lodash.constant('bar') }); + * + * _.isFunction(_.foo); + * // => true + * _.isFunction(_.bar); + * // => false + * + * lodash.isFunction(lodash.foo); + * // => false + * lodash.isFunction(lodash.bar); + * // => true + * + * // Use `context` to mock `Date#getTime` use in `_.now`. + * var mock = _.runInContext({ + * 'Date': function() { + * return { 'getTime': getTimeMock }; + * } + * }); + * + * // Create a suped-up `defer` in Node.js. + * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer; + */ + function runInContext(context) { + context = context ? _.defaults({}, context, _.pick(root, contextProps)) : root; + + /** Built-in constructor references. */ + var Date = context.Date, + Error = context.Error, + Math = context.Math, + RegExp = context.RegExp, + TypeError = context.TypeError; + + /** Used for built-in method references. */ + var arrayProto = context.Array.prototype, + objectProto = context.Object.prototype; + + /** Used to resolve the decompiled source of functions. */ + var funcToString = context.Function.prototype.toString; + + /** Used to check objects for own properties. */ + var hasOwnProperty = objectProto.hasOwnProperty; + + /** Used to generate unique IDs. */ + var idCounter = 0; + + /** Used to infer the `Object` constructor. */ + var objectCtorString = funcToString.call(Object); + + /** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * of values. + */ + var objectToString = objectProto.toString; + + /** Used to restore the original `_` reference in `_.noConflict`. */ + var oldDash = root._; + + /** Used to detect if a method is native. */ + var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' + ); + + /** Built-in value references. */ + var Buffer = moduleExports ? context.Buffer : undefined, + Reflect = context.Reflect, + Symbol = context.Symbol, + Uint8Array = context.Uint8Array, + clearTimeout = context.clearTimeout, + enumerate = Reflect ? Reflect.enumerate : undefined, + getOwnPropertySymbols = Object.getOwnPropertySymbols, + iteratorSymbol = typeof (iteratorSymbol = Symbol && Symbol.iterator) == 'symbol' ? iteratorSymbol : undefined, + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + setTimeout = context.setTimeout, + splice = arrayProto.splice; + + /* Built-in method references for those with the same name as other `lodash` methods. */ + var nativeCeil = Math.ceil, + nativeFloor = Math.floor, + nativeGetPrototype = Object.getPrototypeOf, + nativeIsFinite = context.isFinite, + nativeJoin = arrayProto.join, + nativeKeys = Object.keys, + nativeMax = Math.max, + nativeMin = Math.min, + nativeParseInt = context.parseInt, + nativeRandom = Math.random, + nativeReverse = arrayProto.reverse; + + /* Built-in method references that are verified to be native. */ + var DataView = getNative(context, 'DataView'), + Map = getNative(context, 'Map'), + Promise = getNative(context, 'Promise'), + Set = getNative(context, 'Set'), + WeakMap = getNative(context, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + + /** Used to store function metadata. */ + var metaMap = WeakMap && new WeakMap; + + /** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */ + var nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf'); + + /** Used to lookup unminified function names. */ + var realNames = {}; + + /** Used to detect maps, sets, and weakmaps. */ + var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + + /** Used to convert symbols to primitives and strings. */ + var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined, + symbolToString = symbolProto ? symbolProto.toString : undefined; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` object which wraps `value` to enable implicit method + * chain sequences. Methods that operate on and return arrays, collections, + * and functions can be chained together. Methods that retrieve a single value + * or may return a primitive value will automatically end the chain sequence + * and return the unwrapped value. Otherwise, the value must be unwrapped + * with `_#value`. + * + * Explicit chain sequences, which must be unwrapped with `_#value`, may be + * enabled using `_.chain`. + * + * The execution of chained methods is lazy, that is, it's deferred until + * `_#value` is implicitly or explicitly called. + * + * Lazy evaluation allows several methods to support shortcut fusion. + * Shortcut fusion is an optimization to merge iteratee calls; this avoids + * the creation of intermediate arrays and can greatly reduce the number of + * iteratee executions. Sections of a chain sequence qualify for shortcut + * fusion if the section is applied to an array of at least `200` elements + * and any iteratees accept only one argument. The heuristic for whether a + * section qualifies for shortcut fusion is subject to change. + * + * Chaining is supported in custom builds as long as the `_#value` method is + * directly or indirectly included in the build. + * + * In addition to lodash methods, wrappers have `Array` and `String` methods. + * + * The wrapper `Array` methods are: + * `concat`, `join`, `pop`, `push`, `shift`, `sort`, `splice`, and `unshift` + * + * The wrapper `String` methods are: + * `replace` and `split` + * + * The wrapper methods that support shortcut fusion are: + * `at`, `compact`, `drop`, `dropRight`, `dropWhile`, `filter`, `find`, + * `findLast`, `head`, `initial`, `last`, `map`, `reject`, `reverse`, `slice`, + * `tail`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, and `toArray` + * + * The chainable wrapper methods are: + * `after`, `ary`, `assign`, `assignIn`, `assignInWith`, `assignWith`, `at`, + * `before`, `bind`, `bindAll`, `bindKey`, `castArray`, `chain`, `chunk`, + * `commit`, `compact`, `concat`, `conforms`, `constant`, `countBy`, `create`, + * `curry`, `debounce`, `defaults`, `defaultsDeep`, `defer`, `delay`, + * `difference`, `differenceBy`, `differenceWith`, `drop`, `dropRight`, + * `dropRightWhile`, `dropWhile`, `extend`, `extendWith`, `fill`, `filter`, + * `flatMap`, `flatMapDeep`, `flatMapDepth`, `flatten`, `flattenDeep`, + * `flattenDepth`, `flip`, `flow`, `flowRight`, `fromPairs`, `functions`, + * `functionsIn`, `groupBy`, `initial`, `intersection`, `intersectionBy`, + * `intersectionWith`, `invert`, `invertBy`, `invokeMap`, `iteratee`, `keyBy`, + * `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`, `matchesProperty`, + * `memoize`, `merge`, `mergeWith`, `method`, `methodOf`, `mixin`, `negate`, + * `nthArg`, `omit`, `omitBy`, `once`, `orderBy`, `over`, `overArgs`, + * `overEvery`, `overSome`, `partial`, `partialRight`, `partition`, `pick`, + * `pickBy`, `plant`, `property`, `propertyOf`, `pull`, `pullAll`, `pullAllBy`, + * `pullAllWith`, `pullAt`, `push`, `range`, `rangeRight`, `rearg`, `reject`, + * `remove`, `rest`, `reverse`, `sampleSize`, `set`, `setWith`, `shuffle`, + * `slice`, `sort`, `sortBy`, `splice`, `spread`, `tail`, `take`, `takeRight`, + * `takeRightWhile`, `takeWhile`, `tap`, `throttle`, `thru`, `toArray`, + * `toPairs`, `toPairsIn`, `toPath`, `toPlainObject`, `transform`, `unary`, + * `union`, `unionBy`, `unionWith`, `uniq`, `uniqBy`, `uniqWith`, `unset`, + * `unshift`, `unzip`, `unzipWith`, `update`, `updateWith`, `values`, + * `valuesIn`, `without`, `wrap`, `xor`, `xorBy`, `xorWith`, `zip`, + * `zipObject`, `zipObjectDeep`, and `zipWith` + * + * The wrapper methods that are **not** chainable by default are: + * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clamp`, `clone`, + * `cloneDeep`, `cloneDeepWith`, `cloneWith`, `deburr`, `divide`, `each`, + * `eachRight`, `endsWith`, `eq`, `escape`, `escapeRegExp`, `every`, `find`, + * `findIndex`, `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `first`, + * `floor`, `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, + * `forOwnRight`, `get`, `gt`, `gte`, `has`, `hasIn`, `head`, `identity`, + * `includes`, `indexOf`, `inRange`, `invoke`, `isArguments`, `isArray`, + * `isArrayBuffer`, `isArrayLike`, `isArrayLikeObject`, `isBoolean`, `isBuffer`, + * `isDate`, `isElement`, `isEmpty`, `isEqual`, `isEqualWith`, `isError`, + * `isFinite`, `isFunction`, `isInteger`, `isLength`, `isMap`, `isMatch`, + * `isMatchWith`, `isNaN`, `isNative`, `isNil`, `isNull`, `isNumber`, + * `isObject`, `isObjectLike`, `isPlainObject`, `isRegExp`, `isSafeInteger`, + * `isSet`, `isString`, `isUndefined`, `isTypedArray`, `isWeakMap`, `isWeakSet`, + * `join`, `kebabCase`, `last`, `lastIndexOf`, `lowerCase`, `lowerFirst`, + * `lt`, `lte`, `max`, `maxBy`, `mean`, `meanBy`, `min`, `minBy`, `multiply`, + * `noConflict`, `noop`, `now`, `pad`, `padEnd`, `padStart`, `parseInt`, + * `pop`, `random`, `reduce`, `reduceRight`, `repeat`, `result`, `round`, + * `runInContext`, `sample`, `shift`, `size`, `snakeCase`, `some`, `sortedIndex`, + * `sortedIndexBy`, `sortedLastIndex`, `sortedLastIndexBy`, `startCase`, + * `startsWith`, `subtract`, `sum`, `sumBy`, `template`, `times`, `toInteger`, + * `toJSON`, `toLength`, `toLower`, `toNumber`, `toSafeInteger`, `toString`, + * `toUpper`, `trim`, `trimEnd`, `trimStart`, `truncate`, `unescape`, + * `uniqueId`, `upperCase`, `upperFirst`, `value`, and `words` + * + * @name _ + * @constructor + * @category Seq + * @param {*} value The value to wrap in a `lodash` instance. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2, 3]); + * + * // Returns an unwrapped value. + * wrapped.reduce(_.add); + * // => 6 + * + * // Returns a wrapped value. + * var squares = wrapped.map(square); + * + * _.isArray(squares); + * // => false + * + * _.isArray(squares.value()); + * // => true + */ + function lodash(value) { + if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) { + if (value instanceof LodashWrapper) { + return value; + } + if (hasOwnProperty.call(value, '__wrapped__')) { + return wrapperClone(value); + } + } + return new LodashWrapper(value); + } + + /** + * The function whose prototype chain sequence wrappers inherit from. + * + * @private + */ + function baseLodash() { + // No operation performed. + } + + /** + * The base constructor for creating `lodash` wrapper objects. + * + * @private + * @param {*} value The value to wrap. + * @param {boolean} [chainAll] Enable explicit method chain sequences. + */ + function LodashWrapper(value, chainAll) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__chain__ = !!chainAll; + this.__index__ = 0; + this.__values__ = undefined; + } + + /** + * By default, the template delimiters used by lodash are like those in + * embedded Ruby (ERB). Change the following template settings to use + * alternative delimiters. + * + * @static + * @memberOf _ + * @type {Object} + */ + lodash.templateSettings = { + + /** + * Used to detect `data` property values to be HTML-escaped. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'escape': reEscape, + + /** + * Used to detect code to be evaluated. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'evaluate': reEvaluate, + + /** + * Used to detect `data` property values to inject. + * + * @memberOf _.templateSettings + * @type {RegExp} + */ + 'interpolate': reInterpolate, + + /** + * Used to reference the data object in the template text. + * + * @memberOf _.templateSettings + * @type {string} + */ + 'variable': '', + + /** + * Used to import variables into the compiled template. + * + * @memberOf _.templateSettings + * @type {Object} + */ + 'imports': { + + /** + * A reference to the `lodash` function. + * + * @memberOf _.templateSettings.imports + * @type {Function} + */ + '_': lodash + } + }; + + // Ensure wrappers are instances of `baseLodash`. + lodash.prototype = baseLodash.prototype; + lodash.prototype.constructor = lodash; + + LodashWrapper.prototype = baseCreate(baseLodash.prototype); + LodashWrapper.prototype.constructor = LodashWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation. + * + * @private + * @constructor + * @param {*} value The value to wrap. + */ + function LazyWrapper(value) { + this.__wrapped__ = value; + this.__actions__ = []; + this.__dir__ = 1; + this.__filtered__ = false; + this.__iteratees__ = []; + this.__takeCount__ = MAX_ARRAY_LENGTH; + this.__views__ = []; + } + + /** + * Creates a clone of the lazy wrapper object. + * + * @private + * @name clone + * @memberOf LazyWrapper + * @returns {Object} Returns the cloned `LazyWrapper` object. + */ + function lazyClone() { + var result = new LazyWrapper(this.__wrapped__); + result.__actions__ = copyArray(this.__actions__); + result.__dir__ = this.__dir__; + result.__filtered__ = this.__filtered__; + result.__iteratees__ = copyArray(this.__iteratees__); + result.__takeCount__ = this.__takeCount__; + result.__views__ = copyArray(this.__views__); + return result; + } + + /** + * Reverses the direction of lazy iteration. + * + * @private + * @name reverse + * @memberOf LazyWrapper + * @returns {Object} Returns the new reversed `LazyWrapper` object. + */ + function lazyReverse() { + if (this.__filtered__) { + var result = new LazyWrapper(this); + result.__dir__ = -1; + result.__filtered__ = true; + } else { + result = this.clone(); + result.__dir__ *= -1; + } + return result; + } + + /** + * Extracts the unwrapped value from its lazy wrapper. + * + * @private + * @name value + * @memberOf LazyWrapper + * @returns {*} Returns the unwrapped value. + */ + function lazyValue() { + var array = this.__wrapped__.value(), + dir = this.__dir__, + isArr = isArray(array), + isRight = dir < 0, + arrLength = isArr ? array.length : 0, + view = getView(0, arrLength, this.__views__), + start = view.start, + end = view.end, + length = end - start, + index = isRight ? end : (start - 1), + iteratees = this.__iteratees__, + iterLength = iteratees.length, + resIndex = 0, + takeCount = nativeMin(length, this.__takeCount__); + + if (!isArr || arrLength < LARGE_ARRAY_SIZE || + (arrLength == length && takeCount == length)) { + return baseWrapperValue(array, this.__actions__); + } + var result = []; + + outer: + while (length-- && resIndex < takeCount) { + index += dir; + + var iterIndex = -1, + value = array[index]; + + while (++iterIndex < iterLength) { + var data = iteratees[iterIndex], + iteratee = data.iteratee, + type = data.type, + computed = iteratee(value); + + if (type == LAZY_MAP_FLAG) { + value = computed; + } else if (!computed) { + if (type == LAZY_FILTER_FLAG) { + continue outer; + } else { + break outer; + } + } + } + result[resIndex++] = value; + } + return result; + } + + // Ensure `LazyWrapper` is an instance of `baseLodash`. + LazyWrapper.prototype = baseCreate(baseLodash.prototype); + LazyWrapper.prototype.constructor = LazyWrapper; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a hash object. + * + * @private + * @constructor + * @returns {Object} Returns the new hash object. + */ + function Hash() {} + + /** + * Removes `key` and its value from the hash. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function hashDelete(hash, key) { + return hashHas(hash, key) && delete hash[key]; + } + + /** + * Gets the hash value for `key`. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function hashGet(hash, key) { + if (nativeCreate) { + var result = hash[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(hash, key) ? hash[key] : undefined; + } + + /** + * Checks if a hash value for `key` exists. + * + * @private + * @param {Object} hash The hash to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function hashHas(hash, key) { + return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); + } + + /** + * Sets the hash `key` to `value`. + * + * @private + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ + function hashSet(hash, key, value) { + hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + } + + // Avoid inheriting from `Object.prototype` when possible. + Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function MapCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ + function mapClear() { + this.__data__ = { + 'hash': new Hash, + 'map': Map ? new Map : [], + 'string': new Hash + }; + } + + /** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function mapDelete(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashDelete(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map['delete'](key) : assocDelete(data.map, key); + } + + /** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function mapGet(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashGet(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.get(key) : assocGet(data.map, key); + } + + /** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function mapHas(key) { + var data = this.__data__; + if (isKeyable(key)) { + return hashHas(typeof key == 'string' ? data.string : data.hash, key); + } + return Map ? data.map.has(key) : assocHas(data.map, key); + } + + /** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ + function mapSet(key, value) { + var data = this.__data__; + if (isKeyable(key)) { + hashSet(typeof key == 'string' ? data.string : data.hash, key, value); + } else if (Map) { + data.map.set(key, value); + } else { + assocSet(data.map, key, value); + } + return this; + } + + // Add methods to `MapCache`. + MapCache.prototype.clear = mapClear; + MapCache.prototype['delete'] = mapDelete; + MapCache.prototype.get = mapGet; + MapCache.prototype.has = mapHas; + MapCache.prototype.set = mapSet; + + /*------------------------------------------------------------------------*/ + + /** + * + * Creates a set cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.push(values[index]); + } + } + + /** + * Checks if `value` is in `cache`. + * + * @private + * @param {Object} cache The set cache to search. + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ + function cacheHas(cache, value) { + var map = cache.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + return hash[value] === HASH_UNDEFINED; + } + return map.has(value); + } + + /** + * Adds `value` to the set cache. + * + * @private + * @name push + * @memberOf SetCache + * @param {*} value The value to cache. + */ + function cachePush(value) { + var map = this.__data__; + if (isKeyable(value)) { + var data = map.__data__, + hash = typeof value == 'string' ? data.string : data.hash; + + hash[value] = HASH_UNDEFINED; + } + else { + map.set(value, HASH_UNDEFINED); + } + } + + // Add methods to `SetCache`. + SetCache.prototype.push = cachePush; + + /*------------------------------------------------------------------------*/ + + /** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ + function Stack(values) { + var index = -1, + length = values ? values.length : 0; + + this.clear(); + while (++index < length) { + var entry = values[index]; + this.set(entry[0], entry[1]); + } + } + + /** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ + function stackClear() { + this.__data__ = { 'array': [], 'map': null }; + } + + /** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function stackDelete(key) { + var data = this.__data__, + array = data.array; + + return array ? assocDelete(array, key) : data.map['delete'](key); + } + + /** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function stackGet(key) { + var data = this.__data__, + array = data.array; + + return array ? assocGet(array, key) : data.map.get(key); + } + + /** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function stackHas(key) { + var data = this.__data__, + array = data.array; + + return array ? assocHas(array, key) : data.map.has(key); + } + + /** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ + function stackSet(key, value) { + var data = this.__data__, + array = data.array; + + if (array) { + if (array.length < (LARGE_ARRAY_SIZE - 1)) { + assocSet(array, key, value); + } else { + data.array = null; + data.map = new MapCache(array); + } + } + var map = data.map; + if (map) { + map.set(key, value); + } + return this; + } + + // Add methods to `Stack`. + Stack.prototype.clear = stackClear; + Stack.prototype['delete'] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + + /*------------------------------------------------------------------------*/ + + /** + * Removes `key` and its value from the associative array. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ + function assocDelete(array, key) { + var index = assocIndexOf(array, key); + if (index < 0) { + return false; + } + var lastIndex = array.length - 1; + if (index == lastIndex) { + array.pop(); + } else { + splice.call(array, index, 1); + } + return true; + } + + /** + * Gets the associative array value for `key`. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ + function assocGet(array, key) { + var index = assocIndexOf(array, key); + return index < 0 ? undefined : array[index][1]; + } + + /** + * Checks if an associative array value for `key` exists. + * + * @private + * @param {Array} array The array to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ + function assocHas(array, key) { + return assocIndexOf(array, key) > -1; + } + + /** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to search. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; + } + + /** + * Sets the associative array `key` to `value`. + * + * @private + * @param {Array} array The array to modify. + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + */ + function assocSet(array, key, value) { + var index = assocIndexOf(array, key); + if (index < 0) { + array.push([key, value]); + } else { + array[index][1] = value; + } + } + + /*------------------------------------------------------------------------*/ + + /** + * Used by `_.defaults` to customize its `_.assignIn` use. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to assign. + * @param {Object} object The parent object of `objValue`. + * @returns {*} Returns the value to assign. + */ + function assignInDefaults(objValue, srcValue, key, object) { + if (objValue === undefined || + (eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) { + return srcValue; + } + return objValue; + } + + /** + * This function is like `assignValue` except that it doesn't assign + * `undefined` values. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignMergeValue(object, key, value) { + if ((value !== undefined && !eq(object[key], value)) || + (typeof key == 'number' && value === undefined && !(key in object))) { + object[key] = value; + } + } + + /** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ + function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } + } + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + /** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ + function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); + } + + /** + * The base implementation of `_.at` without support for individual paths. + * + * @private + * @param {Object} object The object to iterate over. + * @param {string[]} paths The property paths of elements to pick. + * @returns {Array} Returns the new array of picked elements. + */ + function baseAt(object, paths) { + var index = -1, + isNil = object == null, + length = paths.length, + result = Array(length); + + while (++index < length) { + result[index] = isNil ? undefined : get(object, paths[index]); + } + return result; + } + + /** + * Casts `value` to an empty array if it's not an array like object. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array|Object} Returns the cast array-like object. + */ + function baseCastArrayLikeObject(value) { + return isArrayLikeObject(value) ? value : []; + } + + /** + * Casts `value` to `identity` if it's not a function. + * + * @private + * @param {*} value The value to inspect. + * @returns {Function} Returns cast function. + */ + function baseCastFunction(value) { + return typeof value == 'function' ? value : identity; + } + + /** + * Casts `value` to a string if it's not a string or symbol. + * + * @private + * @param {*} value The value to inspect. + * @returns {string|symbol} Returns the cast key. + */ + function baseCastKey(key) { + return (typeof key == 'string' || isSymbol(key)) ? key : (key + ''); + } + + /** + * Casts `value` to a path array if it's not one. + * + * @private + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast property path array. + */ + function baseCastPath(value) { + return isArray(value) ? value : stringToPath(value); + } + + /** + * The base implementation of `_.clamp` which doesn't coerce arguments to numbers. + * + * @private + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + */ + function baseClamp(number, lower, upper) { + if (number === number) { + if (upper !== undefined) { + number = number <= upper ? number : upper; + } + if (lower !== undefined) { + number = number >= lower ? number : lower; + } + } + return number; + } + + /** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ + function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } + // Recursively populate clone (susceptible to call stack limits). + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return result; + } + + /** + * The base implementation of `_.conforms` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property predicates to conform to. + * @returns {Function} Returns the new function. + */ + function baseConforms(source) { + var props = keys(source), + length = props.length; + + return function(object) { + if (object == null) { + return !length; + } + var index = length; + while (index--) { + var key = props[index], + predicate = source[key], + value = object[key]; + + if ((value === undefined && + !(key in Object(object))) || !predicate(value)) { + return false; + } + } + return true; + }; + } + + /** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ + function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; + } + + /** + * The base implementation of `_.delay` and `_.defer` which accepts an array + * of `func` arguments. + * + * @private + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {Object} args The arguments to provide to `func`. + * @returns {number} Returns the timer id. + */ + function baseDelay(func, wait, args) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return setTimeout(function() { func.apply(undefined, args); }, wait); + } + + /** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ + function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.forEach` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEach = createBaseEach(baseForOwn); + + /** + * The base implementation of `_.forEachRight` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + */ + var baseEachRight = createBaseEach(baseForOwnRight, true); + + /** + * The base implementation of `_.every` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false` + */ + function baseEvery(collection, predicate) { + var result = true; + baseEach(collection, function(value, index, collection) { + result = !!predicate(value, index, collection); + return result; + }); + return result; + } + + /** + * The base implementation of `_.fill` without an iteratee call guard. + * + * @private + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + */ + function baseFill(array, value, start, end) { + var length = array.length; + + start = toInteger(start); + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = (end === undefined || end > length) ? length : toInteger(end); + if (end < 0) { + end += length; + } + end = start > end ? 0 : toLength(end); + while (start < end) { + array[start++] = value; + } + return array; + } + + /** + * The base implementation of `_.filter` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + */ + function baseFilter(collection, predicate) { + var result = []; + baseEach(collection, function(value, index, collection) { + if (predicate(value, index, collection)) { + result.push(value); + } + }); + return result; + } + + /** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ + function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; + } + + /** + * The base implementation of `baseForOwn` which iterates over `object` + * properties returned by `keysFunc` invoking `iteratee` for each property. + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseFor = createBaseFor(); + + /** + * This function is like `baseFor` except that it iterates over properties + * in the opposite order. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {Function} keysFunc The function to get the keys of `object`. + * @returns {Object} Returns `object`. + */ + var baseForRight = createBaseFor(true); + + /** + * The base implementation of `_.forOwn` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + + /** + * The base implementation of `_.forOwnRight` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Object} Returns `object`. + */ + function baseForOwnRight(object, iteratee) { + return object && baseForRight(object, iteratee, keys); + } + + /** + * The base implementation of `_.functions` which creates an array of + * `object` function property names filtered from `props`. + * + * @private + * @param {Object} object The object to inspect. + * @param {Array} props The property names to filter. + * @returns {Array} Returns the new array of filtered property names. + */ + function baseFunctions(object, props) { + return arrayFilter(props, function(key) { + return isFunction(object[key]); + }); + } + + /** + * The base implementation of `_.get` without support for default values. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @returns {*} Returns the resolved value. + */ + function baseGet(object, path) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var index = 0, + length = path.length; + + while (object != null && index < length) { + object = object[path[index++]]; + } + return (index && index == length) ? object : undefined; + } + + /** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ + function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) + ? result + : arrayPush(result, symbolsFunc(object)); + } + + /** + * The base implementation of `_.has` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHas(object, key) { + // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, + // that are composed entirely of index properties, return `false` for + // `hasOwnProperty` checks of them. + return hasOwnProperty.call(object, key) || + (typeof object == 'object' && key in object && getPrototype(object) === null); + } + + /** + * The base implementation of `_.hasIn` without support for deep paths. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} key The key to check. + * @returns {boolean} Returns `true` if `key` exists, else `false`. + */ + function baseHasIn(object, key) { + return key in Object(object); + } + + /** + * The base implementation of `_.inRange` which doesn't coerce arguments to numbers. + * + * @private + * @param {number} number The number to check. + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + */ + function baseInRange(number, start, end) { + return number >= nativeMin(start, end) && number < nativeMax(start, end); + } + + /** + * The base implementation of methods like `_.intersection`, without support + * for iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of shared values. + */ + function baseIntersection(arrays, iteratee, comparator) { + var includes = comparator ? arrayIncludesWith : arrayIncludes, + length = arrays[0].length, + othLength = arrays.length, + othIndex = othLength, + caches = Array(othLength), + maxLength = Infinity, + result = []; + + while (othIndex--) { + var array = arrays[othIndex]; + if (othIndex && iteratee) { + array = arrayMap(array, baseUnary(iteratee)); + } + maxLength = nativeMin(array.length, maxLength); + caches[othIndex] = !comparator && (iteratee || (length >= 120 && array.length >= 120)) + ? new SetCache(othIndex && array) + : undefined; + } + array = arrays[0]; + + var index = -1, + seen = caches[0]; + + outer: + while (++index < length && result.length < maxLength) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!(seen + ? cacheHas(seen, computed) + : includes(result, computed, comparator) + )) { + othIndex = othLength; + while (--othIndex) { + var cache = caches[othIndex]; + if (!(cache + ? cacheHas(cache, computed) + : includes(arrays[othIndex], computed, comparator)) + ) { + continue outer; + } + } + if (seen) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.invert` and `_.invertBy` which inverts + * `object` with values transformed by `iteratee` and set by `setter`. + * + * @private + * @param {Object} object The object to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform values. + * @param {Object} accumulator The initial inverted object. + * @returns {Function} Returns `accumulator`. + */ + function baseInverter(object, setter, iteratee, accumulator) { + baseForOwn(object, function(value, key, object) { + setter(accumulator, iteratee(value), key, object); + }); + return accumulator; + } + + /** + * The base implementation of `_.invoke` without support for individual + * method arguments. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {Array} args The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + */ + function baseInvoke(object, path, args) { + if (!isKey(path, object)) { + path = baseCastPath(path); + object = parent(object, path); + path = last(path); + } + var func = object == null ? object : object[path]; + return func == null ? undefined : apply(func, object, args); + } + + /** + * The base implementation of `_.isEqual` which supports partial comparisons + * and tracks traversed objects. + * + * @private + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @param {boolean} [bitmask] The bitmask of comparison flags. + * The bitmask may be composed of the following flags: + * 1 - Unordered comparison + * 2 - Partial comparison + * @param {Object} [stack] Tracks traversed `value` and `other` objects. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + */ + function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || (!isObject(value) && !isObjectLike(other))) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); + } + + /** + * A specialized version of `baseIsEqual` for arrays and objects which performs + * deep comparisons and tracks traversed objects enabling objects with circular + * references to be compared. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} [customizer] The function to customize comparisons. + * @param {number} [bitmask] The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} [stack] Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), + othIsArr = isArray(other), + objTag = arrayTag, + othTag = arrayTag; + + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), + othIsObj = othTag == objectTag && !isHostObject(other), + isSameTag = objTag == othTag; + + if (isSameTag && !objIsObj) { + stack || (stack = new Stack); + return (objIsArr || isTypedArray(object)) + ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) + : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), + othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__'); + + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, + othUnwrapped = othIsWrapped ? other.value() : other; + + stack || (stack = new Stack); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); + } + } + if (!isSameTag) { + return false; + } + stack || (stack = new Stack); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); + } + + /** + * The base implementation of `_.isMatch` without support for iteratee shorthands. + * + * @private + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Array} matchData The property names, values, and compare flags to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + */ + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, + length = index, + noCustomizer = !customizer; + + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if ((noCustomizer && data[2]) + ? data[1] !== object[data[0]] + : !(data[0] in object) + ) { + return false; + } + } + while (++index < length) { + data = matchData[index]; + var key = data[0], + objValue = object[key], + srcValue = data[1]; + + if (noCustomizer && data[2]) { + if (objValue === undefined && !(key in object)) { + return false; + } + } else { + var stack = new Stack; + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === undefined + ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) + : result + )) { + return false; + } + } + } + return true; + } + + /** + * The base implementation of `_.iteratee`. + * + * @private + * @param {*} [value=_.identity] The value to convert to an iteratee. + * @returns {Function} Returns the iteratee. + */ + function baseIteratee(value) { + // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9. + // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details. + if (typeof value == 'function') { + return value; + } + if (value == null) { + return identity; + } + if (typeof value == 'object') { + return isArray(value) + ? baseMatchesProperty(value[0], value[1]) + : baseMatches(value); + } + return property(value); + } + + /** + * The base implementation of `_.keys` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeys(object) { + return nativeKeys(Object(object)); + } + + /** + * The base implementation of `_.keysIn` which doesn't skip the constructor + * property of prototypes or treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ + function baseKeysIn(object) { + object = object == null ? object : Object(object); + + var result = []; + for (var key in object) { + result.push(key); + } + return result; + } + + // Fallback for IE < 9 with es6-shim. + if (enumerate && !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf')) { + baseKeysIn = function(object) { + return iteratorToArray(enumerate(object)); + }; + } + + /** + * The base implementation of `_.map` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ + function baseMap(collection, iteratee) { + var index = -1, + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value, key, collection) { + result[++index] = iteratee(value, key, collection); + }); + return result; + } + + /** + * The base implementation of `_.matches` which doesn't clone `source`. + * + * @private + * @param {Object} source The object of property values to match. + * @returns {Function} Returns the new function. + */ + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; + } + + /** + * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`. + * + * @private + * @param {string} path The path of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new function. + */ + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(path, srcValue); + } + return function(object) { + var objValue = get(object, path); + return (objValue === undefined && objValue === srcValue) + ? hasIn(object, path) + : baseIsEqual(srcValue, objValue, undefined, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); + }; + } + + /** + * The base implementation of `_.merge` without support for multiple sources. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {number} srcIndex The index of `source`. + * @param {Function} [customizer] The function to customize merged values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMerge(object, source, srcIndex, customizer, stack) { + if (object === source) { + return; + } + if (!(isArray(source) || isTypedArray(source))) { + var props = keysIn(source); + } + arrayEach(props || source, function(srcValue, key) { + if (props) { + key = srcValue; + srcValue = source[key]; + } + if (isObject(srcValue)) { + stack || (stack = new Stack); + baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); + } + else { + var newValue = customizer + ? customizer(object[key], srcValue, (key + ''), object, source, stack) + : undefined; + + if (newValue === undefined) { + newValue = srcValue; + } + assignMergeValue(object, key, newValue); + } + }); + } + + /** + * A specialized version of `baseMerge` for arrays and objects which performs + * deep merges and tracks traversed objects enabling objects with circular + * references to be merged. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @param {string} key The key of the value to merge. + * @param {number} srcIndex The index of `source`. + * @param {Function} mergeFunc The function to merge values. + * @param {Function} [customizer] The function to customize assigned values. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + */ + function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { + var objValue = object[key], + srcValue = source[key], + stacked = stack.get(srcValue); + + if (stacked) { + assignMergeValue(object, key, stacked); + return; + } + var newValue = customizer + ? customizer(objValue, srcValue, (key + ''), object, source, stack) + : undefined; + + var isCommon = newValue === undefined; + + if (isCommon) { + newValue = srcValue; + if (isArray(srcValue) || isTypedArray(srcValue)) { + if (isArray(objValue)) { + newValue = objValue; + } + else if (isArrayLikeObject(objValue)) { + newValue = copyArray(objValue); + } + else { + isCommon = false; + newValue = baseClone(srcValue, true); + } + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { + if (isArguments(objValue)) { + newValue = toPlainObject(objValue); + } + else if (!isObject(objValue) || (srcIndex && isFunction(objValue))) { + isCommon = false; + newValue = baseClone(srcValue, true); + } + else { + newValue = objValue; + } + } + else { + isCommon = false; + } + } + stack.set(srcValue, newValue); + + if (isCommon) { + // Recursively merge objects and arrays (susceptible to call stack limits). + mergeFunc(newValue, srcValue, srcIndex, customizer, stack); + } + stack['delete'](srcValue); + assignMergeValue(object, key, newValue); + } + + /** + * The base implementation of `_.orderBy` without param guards. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by. + * @param {string[]} orders The sort orders of `iteratees`. + * @returns {Array} Returns the new sorted array. + */ + function baseOrderBy(collection, iteratees, orders) { + var index = -1; + iteratees = arrayMap(iteratees.length ? iteratees : [identity], getIteratee()); + + var result = baseMap(collection, function(value, key, collection) { + var criteria = arrayMap(iteratees, function(iteratee) { + return iteratee(value); + }); + return { 'criteria': criteria, 'index': ++index, 'value': value }; + }); + + return baseSortBy(result, function(object, other) { + return compareMultiple(object, other, orders); + }); + } + + /** + * The base implementation of `_.pick` without support for individual + * property identifiers. + * + * @private + * @param {Object} object The source object. + * @param {string[]} props The property identifiers to pick. + * @returns {Object} Returns the new object. + */ + function basePick(object, props) { + object = Object(object); + return arrayReduce(props, function(result, key) { + if (key in object) { + result[key] = object[key]; + } + return result; + }, {}); + } + + /** + * The base implementation of `_.pickBy` without support for iteratee shorthands. + * + * @private + * @param {Object} object The source object. + * @param {Function} predicate The function invoked per property. + * @returns {Object} Returns the new object. + */ + function basePickBy(object, predicate) { + var index = -1, + props = getAllKeysIn(object), + length = props.length, + result = {}; + + while (++index < length) { + var key = props[index], + value = object[key]; + + if (predicate(value, key)) { + result[key] = value; + } + } + return result; + } + + /** + * The base implementation of `_.property` without support for deep paths. + * + * @private + * @param {string} key The key of the property to get. + * @returns {Function} Returns the new function. + */ + function baseProperty(key) { + return function(object) { + return object == null ? undefined : object[key]; + }; + } + + /** + * A specialized version of `baseProperty` which supports deep paths. + * + * @private + * @param {Array|string} path The path of the property to get. + * @returns {Function} Returns the new function. + */ + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + + /** + * The base implementation of `_.pullAllBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + */ + function basePullAll(array, values, iteratee, comparator) { + var indexOf = comparator ? baseIndexOfWith : baseIndexOf, + index = -1, + length = values.length, + seen = array; + + if (iteratee) { + seen = arrayMap(array, baseUnary(iteratee)); + } + while (++index < length) { + var fromIndex = 0, + value = values[index], + computed = iteratee ? iteratee(value) : value; + + while ((fromIndex = indexOf(seen, computed, fromIndex, comparator)) > -1) { + if (seen !== array) { + splice.call(seen, fromIndex, 1); + } + splice.call(array, fromIndex, 1); + } + } + return array; + } + + /** + * The base implementation of `_.pullAt` without support for individual + * indexes or capturing the removed elements. + * + * @private + * @param {Array} array The array to modify. + * @param {number[]} indexes The indexes of elements to remove. + * @returns {Array} Returns `array`. + */ + function basePullAt(array, indexes) { + var length = array ? indexes.length : 0, + lastIndex = length - 1; + + while (length--) { + var index = indexes[length]; + if (lastIndex == length || index != previous) { + var previous = index; + if (isIndex(index)) { + splice.call(array, index, 1); + } + else if (!isKey(index, array)) { + var path = baseCastPath(index), + object = parent(array, path); + + if (object != null) { + delete object[last(path)]; + } + } + else { + delete array[index]; + } + } + } + return array; + } + + /** + * The base implementation of `_.random` without support for returning + * floating-point numbers. + * + * @private + * @param {number} lower The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the random number. + */ + function baseRandom(lower, upper) { + return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); + } + + /** + * The base implementation of `_.range` and `_.rangeRight` which doesn't + * coerce arguments to numbers. + * + * @private + * @param {number} start The start of the range. + * @param {number} end The end of the range. + * @param {number} step The value to increment or decrement by. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the new array of numbers. + */ + function baseRange(start, end, step, fromRight) { + var index = -1, + length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), + result = Array(length); + + while (length--) { + result[fromRight ? length : ++index] = start; + start += step; + } + return result; + } + + /** + * The base implementation of `_.repeat` which doesn't coerce arguments. + * + * @private + * @param {string} string The string to repeat. + * @param {number} n The number of times to repeat the string. + * @returns {string} Returns the repeated string. + */ + function baseRepeat(string, n) { + var result = ''; + if (!string || n < 1 || n > MAX_SAFE_INTEGER) { + return result; + } + // Leverage the exponentiation by squaring algorithm for a faster repeat. + // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. + do { + if (n % 2) { + result += string; + } + n = nativeFloor(n / 2); + if (n) { + string += string; + } + } while (n); + + return result; + } + + /** + * The base implementation of `_.set`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseSet(object, path, value, customizer) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var index = -1, + length = path.length, + lastIndex = length - 1, + nested = object; + + while (nested != null && ++index < length) { + var key = path[index]; + if (isObject(nested)) { + var newValue = value; + if (index != lastIndex) { + var objValue = nested[key]; + newValue = customizer ? customizer(objValue, key, nested) : undefined; + if (newValue === undefined) { + newValue = objValue == null + ? (isIndex(path[index + 1]) ? [] : {}) + : objValue; + } + } + assignValue(nested, key, newValue); + } + nested = nested[key]; + } + return object; + } + + /** + * The base implementation of `setData` without support for hot loop detection. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var baseSetData = !metaMap ? identity : function(func, data) { + metaMap.set(func, data); + return func; + }; + + /** + * The base implementation of `_.slice` without an iteratee call guard. + * + * @private + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function baseSlice(array, start, end) { + var index = -1, + length = array.length; + + if (start < 0) { + start = -start > length ? 0 : (length + start); + } + end = end > length ? length : end; + if (end < 0) { + end += length; + } + length = start > end ? 0 : ((end - start) >>> 0); + start >>>= 0; + + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; + } + + /** + * The base implementation of `_.some` without support for iteratee shorthands. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} predicate The function invoked per iteration. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + */ + function baseSome(collection, predicate) { + var result; + + baseEach(collection, function(value, index, collection) { + result = predicate(value, index, collection); + return !result; + }); + return !!result; + } + + /** + * The base implementation of `_.sortedIndex` and `_.sortedLastIndex` which + * performs a binary search of `array` to determine the index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndex(array, value, retHighest) { + var low = 0, + high = array ? array.length : low; + + if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) { + while (low < high) { + var mid = (low + high) >>> 1, + computed = array[mid]; + + if ((retHighest ? (computed <= value) : (computed < value)) && computed !== null) { + low = mid + 1; + } else { + high = mid; + } + } + return high; + } + return baseSortedIndexBy(array, value, identity, retHighest); + } + + /** + * The base implementation of `_.sortedIndexBy` and `_.sortedLastIndexBy` + * which invokes `iteratee` for `value` and each element of `array` to compute + * their sort ranking. The iteratee is invoked with one argument; (value). + * + * @private + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Function} iteratee The iteratee invoked per element. + * @param {boolean} [retHighest] Specify returning the highest qualified index. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + */ + function baseSortedIndexBy(array, value, iteratee, retHighest) { + value = iteratee(value); + + var low = 0, + high = array ? array.length : 0, + valIsNaN = value !== value, + valIsNull = value === null, + valIsUndef = value === undefined; + + while (low < high) { + var mid = nativeFloor((low + high) / 2), + computed = iteratee(array[mid]), + isDef = computed !== undefined, + isReflexive = computed === computed; + + if (valIsNaN) { + var setLow = isReflexive || retHighest; + } else if (valIsNull) { + setLow = isReflexive && isDef && (retHighest || computed != null); + } else if (valIsUndef) { + setLow = isReflexive && (retHighest || isDef); + } else if (computed == null) { + setLow = false; + } else { + setLow = retHighest ? (computed <= value) : (computed < value); + } + if (setLow) { + low = mid + 1; + } else { + high = mid; + } + } + return nativeMin(high, MAX_ARRAY_INDEX); + } + + /** + * The base implementation of `_.sortedUniq`. + * + * @private + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniq(array) { + return baseSortedUniqBy(array); + } + + /** + * The base implementation of `_.sortedUniqBy` without support for iteratee + * shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseSortedUniqBy(array, iteratee) { + var index = 0, + length = array.length, + value = array[0], + computed = iteratee ? iteratee(value) : value, + seen = computed, + resIndex = 1, + result = [value]; + + while (++index < length) { + value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (!eq(computed, seen)) { + seen = computed; + result[resIndex++] = value; + } + } + return result; + } + + /** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ + function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; + } + + /** + * The base implementation of `_.unset`. + * + * @private + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + */ + function baseUnset(object, path) { + path = isKey(path, object) ? [path] : baseCastPath(path); + object = parent(object, path); + var key = last(path); + return (object != null && has(object, key)) ? delete object[key] : true; + } + + /** + * The base implementation of `_.update`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to update. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize path creation. + * @returns {Object} Returns `object`. + */ + function baseUpdate(object, path, updater, customizer) { + return baseSet(object, path, updater(baseGet(object, path)), customizer); + } + + /** + * The base implementation of methods like `_.dropWhile` and `_.takeWhile` + * without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to query. + * @param {Function} predicate The function invoked per iteration. + * @param {boolean} [isDrop] Specify dropping elements instead of taking them. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Array} Returns the slice of `array`. + */ + function baseWhile(array, predicate, isDrop, fromRight) { + var length = array.length, + index = fromRight ? length : -1; + + while ((fromRight ? index-- : ++index < length) && + predicate(array[index], index, array)) {} + + return isDrop + ? baseSlice(array, (fromRight ? 0 : index), (fromRight ? index + 1 : length)) + : baseSlice(array, (fromRight ? index + 1 : 0), (fromRight ? length : index)); + } + + /** + * The base implementation of `wrapperValue` which returns the result of + * performing a sequence of actions on the unwrapped `value`, where each + * successive action is supplied the return value of the previous. + * + * @private + * @param {*} value The unwrapped value. + * @param {Array} actions Actions to perform to resolve the unwrapped value. + * @returns {*} Returns the resolved value. + */ + function baseWrapperValue(value, actions) { + var result = value; + if (result instanceof LazyWrapper) { + result = result.value(); + } + return arrayReduce(actions, function(result, action) { + return action.func.apply(action.thisArg, arrayPush([result], action.args)); + }, result); + } + + /** + * The base implementation of methods like `_.xor`, without support for + * iteratee shorthands, that accepts an array of arrays to inspect. + * + * @private + * @param {Array} arrays The arrays to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + */ + function baseXor(arrays, iteratee, comparator) { + var index = -1, + length = arrays.length; + + while (++index < length) { + var result = result + ? arrayPush( + baseDifference(result, arrays[index], iteratee, comparator), + baseDifference(arrays[index], result, iteratee, comparator) + ) + : arrays[index]; + } + return (result && result.length) ? baseUniq(result, iteratee, comparator) : []; + } + + /** + * This base implementation of `_.zipObject` which assigns values using `assignFunc`. + * + * @private + * @param {Array} props The property identifiers. + * @param {Array} values The property values. + * @param {Function} assignFunc The function to assign values. + * @returns {Object} Returns the new object. + */ + function baseZipObject(props, values, assignFunc) { + var index = -1, + length = props.length, + valsLength = values.length, + result = {}; + + while (++index < length) { + var value = index < valsLength ? values[index] : undefined; + assignFunc(result, props[index], value); + } + return result; + } + + /** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ + function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; + } + + /** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ + function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; + } + + /** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ + function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + } + + /** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ + function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); + } + + /** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ + function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; + } + + /** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ + function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); + } + + /** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ + function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; + } + + /** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ + function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + } + + /** + * Creates an array that is the composition of partially applied arguments, + * placeholders, and provided arguments into a single array of arguments. + * + * @private + * @param {Array|Object} args The provided arguments. + * @param {Array} partials The arguments to prepend to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgs(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersLength = holders.length, + leftIndex = -1, + leftLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(leftLength + rangeLength), + isUncurried = !isCurried; + + while (++leftIndex < leftLength) { + result[leftIndex] = partials[leftIndex]; + } + while (++argsIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[holders[argsIndex]] = args[argsIndex]; + } + } + while (rangeLength--) { + result[leftIndex++] = args[argsIndex++]; + } + return result; + } + + /** + * This function is like `composeArgs` except that the arguments composition + * is tailored for `_.partialRight`. + * + * @private + * @param {Array|Object} args The provided arguments. + * @param {Array} partials The arguments to append to those provided. + * @param {Array} holders The `partials` placeholder indexes. + * @params {boolean} [isCurried] Specify composing for a curried function. + * @returns {Array} Returns the new array of composed arguments. + */ + function composeArgsRight(args, partials, holders, isCurried) { + var argsIndex = -1, + argsLength = args.length, + holdersIndex = -1, + holdersLength = holders.length, + rightIndex = -1, + rightLength = partials.length, + rangeLength = nativeMax(argsLength - holdersLength, 0), + result = Array(rangeLength + rightLength), + isUncurried = !isCurried; + + while (++argsIndex < rangeLength) { + result[argsIndex] = args[argsIndex]; + } + var offset = argsIndex; + while (++rightIndex < rightLength) { + result[offset + rightIndex] = partials[rightIndex]; + } + while (++holdersIndex < holdersLength) { + if (isUncurried || argsIndex < argsLength) { + result[offset + holders[holdersIndex]] = args[argsIndex++]; + } + } + return result; + } + + /** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ + function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; + } + + /** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @returns {Object} Returns `object`. + */ + function copyObject(source, props, object) { + return copyObjectWith(source, props, object); + } + + /** + * This function is like `copyObject` except that it accepts a function to + * customize copied values. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ + function copyObjectWith(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : source[key]; + + assignValue(object, key, newValue); + } + return object; + } + + /** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ + function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); + } + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, getIteratee(iteratee), accumulator); + }; + } + + /** + * Creates a function like `_.assign`. + * + * @private + * @param {Function} assigner The function to assign values. + * @returns {Function} Returns the new assigner function. + */ + function createAssigner(assigner) { + return rest(function(object, sources) { + var index = -1, + length = sources.length, + customizer = length > 1 ? sources[length - 1] : undefined, + guard = length > 2 ? sources[2] : undefined; + + customizer = typeof customizer == 'function' + ? (length--, customizer) + : undefined; + + if (guard && isIterateeCall(sources[0], sources[1], guard)) { + customizer = length < 3 ? undefined : customizer; + length = 1; + } + object = Object(object); + while (++index < length) { + var source = sources[index]; + if (source) { + assigner(object, source, index, customizer); + } + } + return object; + }); + } + + /** + * Creates a `baseEach` or `baseEachRight` function. + * + * @private + * @param {Function} eachFunc The function to iterate over a collection. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, + index = fromRight ? length : -1, + iterable = Object(collection); + + while ((fromRight ? index-- : ++index < length)) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; + } + + /** + * Creates a base function for methods like `_.forIn` and `_.forOwn`. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new base function. + */ + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, + iterable = Object(object), + props = keysFunc(object), + length = props.length; + + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } + } + return object; + }; + } + + /** + * Creates a function that wraps `func` to invoke it with the optional `this` + * binding of `thisArg`. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createBaseWrapper(func, bitmask, thisArg) { + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); + + function wrapper() { + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return fn.apply(isBind ? thisArg : this, arguments); + } + return wrapper; + } + + /** + * Creates a function like `_.lowerFirst`. + * + * @private + * @param {string} methodName The name of the `String` case method to use. + * @returns {Function} Returns the new function. + */ + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + + var strSymbols = reHasComplexSymbol.test(string) + ? stringToArray(string) + : undefined; + + var chr = strSymbols ? strSymbols[0] : string.charAt(0), + trailing = strSymbols ? strSymbols.slice(1).join('') : string.slice(1); + + return chr[methodName]() + trailing; + }; + } + + /** + * Creates a function like `_.camelCase`. + * + * @private + * @param {Function} callback The function to combine each word. + * @returns {Function} Returns the new compounder function. + */ + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string)), callback, ''); + }; + } + + /** + * Creates a function that produces an instance of `Ctor` regardless of + * whether it was invoked as part of a `new` expression or by `call` or `apply`. + * + * @private + * @param {Function} Ctor The constructor to wrap. + * @returns {Function} Returns the new wrapped function. + */ + function createCtorWrapper(Ctor) { + return function() { + // Use a `switch` statement to work with class constructors. See + // http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist + // for more details. + var args = arguments; + switch (args.length) { + case 0: return new Ctor; + case 1: return new Ctor(args[0]); + case 2: return new Ctor(args[0], args[1]); + case 3: return new Ctor(args[0], args[1], args[2]); + case 4: return new Ctor(args[0], args[1], args[2], args[3]); + case 5: return new Ctor(args[0], args[1], args[2], args[3], args[4]); + case 6: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); + case 7: return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); + } + var thisBinding = baseCreate(Ctor.prototype), + result = Ctor.apply(thisBinding, args); + + // Mimic the constructor's `return` behavior. + // See https://es5.github.io/#x13.2.2 for more details. + return isObject(result) ? result : thisBinding; + }; + } + + /** + * Creates a function that wraps `func` to enable currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {number} arity The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createCurryWrapper(func, bitmask, arity) { + var Ctor = createCtorWrapper(func); + + function wrapper() { + var length = arguments.length, + args = Array(length), + index = length, + placeholder = getPlaceholder(wrapper); + + while (index--) { + args[index] = arguments[index]; + } + var holders = (length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder) + ? [] + : replaceHolders(args, placeholder); + + length -= holders.length; + if (length < arity) { + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, undefined, + args, holders, undefined, undefined, arity - length); + } + var fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + return apply(fn, this, args); + } + return wrapper; + } + + /** + * Creates a `_.flow` or `_.flowRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new flow function. + */ + function createFlow(fromRight) { + return rest(function(funcs) { + funcs = baseFlatten(funcs, 1); + + var length = funcs.length, + index = length, + prereq = LodashWrapper.prototype.thru; + + if (fromRight) { + funcs.reverse(); + } + while (index--) { + var func = funcs[index]; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (prereq && !wrapper && getFuncName(func) == 'wrapper') { + var wrapper = new LodashWrapper([], true); + } + } + index = wrapper ? index : length; + while (++index < length) { + func = funcs[index]; + + var funcName = getFuncName(func), + data = funcName == 'wrapper' ? getData(func) : undefined; + + if (data && isLaziable(data[0]) && + data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && + !data[4].length && data[9] == 1 + ) { + wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); + } else { + wrapper = (func.length == 1 && isLaziable(func)) + ? wrapper[funcName]() + : wrapper.thru(func); + } + } + return function() { + var args = arguments, + value = args[0]; + + if (wrapper && args.length == 1 && + isArray(value) && value.length >= LARGE_ARRAY_SIZE) { + return wrapper.plant(value).value(); + } + var index = 0, + result = length ? funcs[index].apply(this, args) : value; + + while (++index < length) { + result = funcs[index].call(this, result); + } + return result; + }; + }); + } + + /** + * Creates a function that wraps `func` to invoke it with optional `this` + * binding of `thisArg`, partial application, and currying. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [partialsRight] The arguments to append to those provided + * to the new function. + * @param {Array} [holdersRight] The `partialsRight` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) { + var isAry = bitmask & ARY_FLAG, + isBind = bitmask & BIND_FLAG, + isBindKey = bitmask & BIND_KEY_FLAG, + isCurried = bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG), + isFlip = bitmask & FLIP_FLAG, + Ctor = isBindKey ? undefined : createCtorWrapper(func); + + function wrapper() { + var length = arguments.length, + index = length, + args = Array(length); + + while (index--) { + args[index] = arguments[index]; + } + if (isCurried) { + var placeholder = getPlaceholder(wrapper), + holdersCount = countHolders(args, placeholder); + } + if (partials) { + args = composeArgs(args, partials, holders, isCurried); + } + if (partialsRight) { + args = composeArgsRight(args, partialsRight, holdersRight, isCurried); + } + length -= holdersCount; + if (isCurried && length < arity) { + var newHolders = replaceHolders(args, placeholder); + return createRecurryWrapper( + func, bitmask, createHybridWrapper, wrapper.placeholder, thisArg, + args, newHolders, argPos, ary, arity - length + ); + } + var thisBinding = isBind ? thisArg : this, + fn = isBindKey ? thisBinding[func] : func; + + length = args.length; + if (argPos) { + args = reorder(args, argPos); + } else if (isFlip && length > 1) { + args.reverse(); + } + if (isAry && ary < length) { + args.length = ary; + } + if (this && this !== root && this instanceof wrapper) { + fn = Ctor || createCtorWrapper(fn); + } + return fn.apply(thisBinding, args); + } + return wrapper; + } + + /** + * Creates a function like `_.invertBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} toIteratee The function to resolve iteratees. + * @returns {Function} Returns the new inverter function. + */ + function createInverter(setter, toIteratee) { + return function(object, iteratee) { + return baseInverter(object, setter, toIteratee(iteratee), {}); + }; + } + + /** + * Creates a function like `_.over`. + * + * @private + * @param {Function} arrayFunc The function to iterate over iteratees. + * @returns {Function} Returns the new invoker function. + */ + function createOver(arrayFunc) { + return rest(function(iteratees) { + iteratees = arrayMap(baseFlatten(iteratees, 1, isFlattenableIteratee), getIteratee()); + return rest(function(args) { + var thisArg = this; + return arrayFunc(iteratees, function(iteratee) { + return apply(iteratee, thisArg, args); + }); + }); + }); + } + + /** + * Creates the padding for `string` based on `length`. The `chars` string + * is truncated if the number of characters exceeds `length`. + * + * @private + * @param {number} length The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padding for `string`. + */ + function createPadding(length, chars) { + chars = chars === undefined ? ' ' : (chars + ''); + + var charsLength = chars.length; + if (charsLength < 2) { + return charsLength ? baseRepeat(chars, length) : chars; + } + var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); + return reHasComplexSymbol.test(chars) + ? stringToArray(result).slice(0, length).join('') + : result.slice(0, length); + } + + /** + * Creates a function that wraps `func` to invoke it with the `this` binding + * of `thisArg` and `partials` prepended to the arguments it receives. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} partials The arguments to prepend to those provided to + * the new function. + * @returns {Function} Returns the new wrapped function. + */ + function createPartialWrapper(func, bitmask, thisArg, partials) { + var isBind = bitmask & BIND_FLAG, + Ctor = createCtorWrapper(func); + + function wrapper() { + var argsIndex = -1, + argsLength = arguments.length, + leftIndex = -1, + leftLength = partials.length, + args = Array(leftLength + argsLength), + fn = (this && this !== root && this instanceof wrapper) ? Ctor : func; + + while (++leftIndex < leftLength) { + args[leftIndex] = partials[leftIndex]; + } + while (argsLength--) { + args[leftIndex++] = arguments[++argsIndex]; + } + return apply(fn, isBind ? thisArg : this, args); + } + return wrapper; + } + + /** + * Creates a `_.range` or `_.rangeRight` function. + * + * @private + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {Function} Returns the new range function. + */ + function createRange(fromRight) { + return function(start, end, step) { + if (step && typeof step != 'number' && isIterateeCall(start, end, step)) { + end = step = undefined; + } + // Ensure the sign of `-0` is preserved. + start = toNumber(start); + start = start === start ? start : 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = toNumber(end) || 0; + } + step = step === undefined ? (start < end ? 1 : -1) : (toNumber(step) || 0); + return baseRange(start, end, step, fromRight); + }; + } + + /** + * Creates a function that wraps `func` to continue currying. + * + * @private + * @param {Function} func The function to wrap. + * @param {number} bitmask The bitmask of wrapper flags. See `createWrapper` + * for more details. + * @param {Function} wrapFunc The function to create the `func` wrapper. + * @param {*} placeholder The placeholder value. + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to prepend to those provided to + * the new function. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createRecurryWrapper(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary, arity) { + var isCurry = bitmask & CURRY_FLAG, + newArgPos = argPos ? copyArray(argPos) : undefined, + newHolders = isCurry ? holders : undefined, + newHoldersRight = isCurry ? undefined : holders, + newPartials = isCurry ? partials : undefined, + newPartialsRight = isCurry ? undefined : partials; + + bitmask |= (isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG); + bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG); + + if (!(bitmask & CURRY_BOUND_FLAG)) { + bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG); + } + var newData = [ + func, bitmask, thisArg, newPartials, newHolders, newPartialsRight, + newHoldersRight, newArgPos, ary, arity + ]; + + var result = wrapFunc.apply(undefined, newData); + if (isLaziable(func)) { + setData(result, newData); + } + result.placeholder = placeholder; + return result; + } + + /** + * Creates a function like `_.round`. + * + * @private + * @param {string} methodName The name of the `Math` method to use when rounding. + * @returns {Function} Returns the new round function. + */ + function createRound(methodName) { + var func = Math[methodName]; + return function(number, precision) { + number = toNumber(number); + precision = toInteger(precision); + if (precision) { + // Shift with exponential notation to avoid floating-point issues. + // See [MDN](https://mdn.io/round#Examples) for more details. + var pair = (toString(number) + 'e').split('e'), + value = func(pair[0] + 'e' + (+pair[1] + precision)); + + pair = (toString(value) + 'e').split('e'); + return +(pair[0] + 'e' + (+pair[1] - precision)); + } + return func(number); + }; + } + + /** + * Creates a set of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ + var createSet = !(Set && new Set([1, 2]).size === 2) ? noop : function(values) { + return new Set(values); + }; + + /** + * Creates a function that either curries or invokes `func` with optional + * `this` binding and partially applied arguments. + * + * @private + * @param {Function|string} func The function or method name to wrap. + * @param {number} bitmask The bitmask of wrapper flags. + * The bitmask may be composed of the following flags: + * 1 - `_.bind` + * 2 - `_.bindKey` + * 4 - `_.curry` or `_.curryRight` of a bound function + * 8 - `_.curry` + * 16 - `_.curryRight` + * 32 - `_.partial` + * 64 - `_.partialRight` + * 128 - `_.rearg` + * 256 - `_.ary` + * @param {*} [thisArg] The `this` binding of `func`. + * @param {Array} [partials] The arguments to be partially applied. + * @param {Array} [holders] The `partials` placeholder indexes. + * @param {Array} [argPos] The argument positions of the new function. + * @param {number} [ary] The arity cap of `func`. + * @param {number} [arity] The arity of `func`. + * @returns {Function} Returns the new wrapped function. + */ + function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) { + var isBindKey = bitmask & BIND_KEY_FLAG; + if (!isBindKey && typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + var length = partials ? partials.length : 0; + if (!length) { + bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG); + partials = holders = undefined; + } + ary = ary === undefined ? ary : nativeMax(toInteger(ary), 0); + arity = arity === undefined ? arity : toInteger(arity); + length -= holders ? holders.length : 0; + + if (bitmask & PARTIAL_RIGHT_FLAG) { + var partialsRight = partials, + holdersRight = holders; + + partials = holders = undefined; + } + var data = isBindKey ? undefined : getData(func); + + var newData = [ + func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, + argPos, ary, arity + ]; + + if (data) { + mergeData(newData, data); + } + func = newData[0]; + bitmask = newData[1]; + thisArg = newData[2]; + partials = newData[3]; + holders = newData[4]; + arity = newData[9] = newData[9] == null + ? (isBindKey ? 0 : func.length) + : nativeMax(newData[9] - length, 0); + + if (!arity && bitmask & (CURRY_FLAG | CURRY_RIGHT_FLAG)) { + bitmask &= ~(CURRY_FLAG | CURRY_RIGHT_FLAG); + } + if (!bitmask || bitmask == BIND_FLAG) { + var result = createBaseWrapper(func, bitmask, thisArg); + } else if (bitmask == CURRY_FLAG || bitmask == CURRY_RIGHT_FLAG) { + result = createCurryWrapper(func, bitmask, arity); + } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !holders.length) { + result = createPartialWrapper(func, bitmask, thisArg, partials); + } else { + result = createHybridWrapper.apply(undefined, newData); + } + var setter = data ? baseSetData : setData; + return setter(result, newData); + } + + /** + * A specialized version of `baseIsEqualDeep` for arrays with support for + * partial deep comparisons. + * + * @private + * @param {Array} array The array to compare. + * @param {Array} other The other array to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `array` and `other` objects. + * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`. + */ + function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var index = -1, + isPartial = bitmask & PARTIAL_COMPARE_FLAG, + isUnordered = bitmask & UNORDERED_COMPARE_FLAG, + arrLength = array.length, + othLength = other.length; + + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(array); + if (stacked) { + return stacked == other; + } + var result = true; + stack.set(array, other); + + // Ignore non-index properties. + while (++index < arrLength) { + var arrValue = array[index], + othValue = other[index]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, arrValue, index, other, array, stack) + : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== undefined) { + if (compared) { + continue; + } + result = false; + break; + } + // Recursively compare arrays (susceptible to call stack limits). + if (isUnordered) { + if (!arraySome(other, function(othValue) { + return arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack); + })) { + result = false; + break; + } + } else if (!( + arrValue === othValue || + equalFunc(arrValue, othValue, customizer, bitmask, stack) + )) { + result = false; + break; + } + } + stack['delete'](array); + return result; + } + + /** + * A specialized version of `baseIsEqualDeep` for comparing objects of + * the same `toStringTag`. + * + * **Note:** This function only supports comparing values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {string} tag The `toStringTag` of the objects to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if ((object.byteLength != other.byteLength) || + (object.byteOffset != other.byteOffset)) { + return false; + } + object = object.buffer; + other = other.buffer; + + case arrayBufferTag: + if ((object.byteLength != other.byteLength) || + !equalFunc(new Uint8Array(object), new Uint8Array(other))) { + return false; + } + return true; + + case boolTag: + case dateTag: + // Coerce dates and booleans to numbers, dates to milliseconds and + // booleans to `1` or `0` treating invalid dates coerced to `NaN` as + // not equal. + return +object == +other; + + case errorTag: + return object.name == other.name && object.message == other.message; + + case numberTag: + // Treat `NaN` vs. `NaN` as equal. + return (object != +object) ? other != +other : object == +other; + + case regexpTag: + case stringTag: + // Coerce regexes to strings and treat strings, primitives and objects, + // as equal. See http://www.ecma-international.org/ecma-262/6.0/#sec-regexp.prototype.tostring + // for more details. + return object == (other + ''); + + case mapTag: + var convert = mapToArray; + + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + + if (object.size != other.size && !isPartial) { + return false; + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + stack.set(object, other); + + // Recursively compare objects (susceptible to call stack limits). + return equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + + /** + * A specialized version of `baseIsEqualDeep` for objects with support for + * partial deep comparisons. + * + * @private + * @param {Object} object The object to compare. + * @param {Object} other The other object to compare. + * @param {Function} equalFunc The function to determine equivalents of values. + * @param {Function} customizer The function to customize comparisons. + * @param {number} bitmask The bitmask of comparison flags. See `baseIsEqual` + * for more details. + * @param {Object} stack Tracks traversed `object` and `other` objects. + * @returns {boolean} Returns `true` if the objects are equivalent, else `false`. + */ + function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, + objProps = keys(object), + objLength = objProps.length, + othProps = keys(other), + othLength = othProps.length; + + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : baseHas(other, key))) { + return false; + } + } + // Assume cyclic values are equal. + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + var result = true; + stack.set(object, other); + + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], + othValue = other[key]; + + if (customizer) { + var compared = isPartial + ? customizer(othValue, objValue, key, other, object, stack) + : customizer(objValue, othValue, key, object, other, stack); + } + // Recursively compare objects (susceptible to call stack limits). + if (!(compared === undefined + ? (objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack)) + : compared + )) { + result = false; + break; + } + skipCtor || (skipCtor = key == 'constructor'); + } + if (result && !skipCtor) { + var objCtor = object.constructor, + othCtor = other.constructor; + + // Non `Object` object instances with different constructors are not equal. + if (objCtor != othCtor && + ('constructor' in object && 'constructor' in other) && + !(typeof objCtor == 'function' && objCtor instanceof objCtor && + typeof othCtor == 'function' && othCtor instanceof othCtor)) { + result = false; + } + } + stack['delete'](object); + return result; + } + + /** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); + } + + /** + * Creates an array of own and inherited enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ + function getAllKeysIn(object) { + return baseGetAllKeys(object, keysIn, getSymbolsIn); + } + + /** + * Gets metadata for `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {*} Returns the metadata for `func`. + */ + var getData = !metaMap ? noop : function(func) { + return metaMap.get(func); + }; + + /** + * Gets the name of `func`. + * + * @private + * @param {Function} func The function to query. + * @returns {string} Returns the function name. + */ + function getFuncName(func) { + var result = (func.name + ''), + array = realNames[result], + length = hasOwnProperty.call(realNames, result) ? array.length : 0; + + while (length--) { + var data = array[length], + otherFunc = data.func; + if (otherFunc == null || otherFunc == func) { + return data.name; + } + } + return result; + } + + /** + * Gets the appropriate "iteratee" function. If `_.iteratee` is customized, + * this function returns the custom method, otherwise it returns `baseIteratee`. + * If arguments are provided, the chosen function is invoked with them and + * its result is returned. + * + * @private + * @param {*} [value] The value to convert to an iteratee. + * @param {number} [arity] The arity of the created iteratee. + * @returns {Function} Returns the chosen function or its result. + */ + function getIteratee() { + var result = lodash.iteratee || iteratee; + result = result === iteratee ? baseIteratee : result; + return arguments.length ? result(arguments[0], arguments[1]) : result; + } + + /** + * Gets the "length" property value of `object`. + * + * **Note:** This function is used to avoid a + * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects + * Safari on at least iOS 8.1-8.3 ARM64. + * + * @private + * @param {Object} object The object to query. + * @returns {*} Returns the "length" value. + */ + var getLength = baseProperty('length'); + + /** + * Gets the property names, values, and compare flags of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the match data of `object`. + */ + function getMatchData(object) { + var result = toPairs(object), + length = result.length; + + while (length--) { + result[length][2] = isStrictComparable(result[length][1]); + } + return result; + } + + /** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ + function getNative(object, key) { + var value = object[key]; + return isNative(value) ? value : undefined; + } + + /** + * Gets the argument placeholder value for `func`. + * + * @private + * @param {Function} func The function to inspect. + * @returns {*} Returns the placeholder value. + */ + function getPlaceholder(func) { + var object = hasOwnProperty.call(lodash, 'placeholder') ? lodash : func; + return object.placeholder; + } + + /** + * Gets the `[[Prototype]]` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {null|Object} Returns the `[[Prototype]]`. + */ + function getPrototype(value) { + return nativeGetPrototype(Object(value)); + } + + /** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + function getSymbols(object) { + // Coerce `object` to an object to avoid non-object errors in V8. + // See https://bugs.chromium.org/p/v8/issues/detail?id=3443 for more details. + return getOwnPropertySymbols(Object(object)); + } + + // Fallback for IE < 11. + if (!getOwnPropertySymbols) { + getSymbols = function() { + return []; + }; + } + + /** + * Creates an array of the own and inherited enumerable symbol properties + * of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ + var getSymbolsIn = !getOwnPropertySymbols ? getSymbols : function(object) { + var result = []; + while (object) { + arrayPush(result, getSymbols(object)); + object = getPrototype(object); + } + return result; + }; + + /** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ + function getTag(value) { + return objectToString.call(value); + } + + // Fallback for data views, maps, sets, and weak maps in IE 11, + // for data views in Edge, and promises in Node.js. + if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; + } + + /** + * Gets the view, applying any `transforms` to the `start` and `end` positions. + * + * @private + * @param {number} start The start of the view. + * @param {number} end The end of the view. + * @param {Array} transforms The transformations to apply to the view. + * @returns {Object} Returns an object containing the `start` and `end` + * positions of the view. + */ + function getView(start, end, transforms) { + var index = -1, + length = transforms.length; + + while (++index < length) { + var data = transforms[index], + size = data.size; + + switch (data.type) { + case 'drop': start += size; break; + case 'dropRight': end -= size; break; + case 'take': end = nativeMin(end, start + size); break; + case 'takeRight': start = nativeMax(start, end - size); break; + } + } + return { 'start': start, 'end': end }; + } + + /** + * Checks if `path` exists on `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @param {Function} hasFunc The function to check properties. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + */ + function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var result, + index = -1, + length = path.length; + + while (++index < length) { + var key = path[index]; + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && + (isArray(object) || isString(object) || isArguments(object)); + } + + /** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ + function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; + } + + /** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; + } + + /** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ + function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } + } + + /** + * Creates an array of index keys for `object` values of arrays, + * `arguments` objects, and strings, otherwise `null` is returned. + * + * @private + * @param {Object} object The object to query. + * @returns {Array|null} Returns index keys, else `null`. + */ + function indexKeys(object) { + var length = object ? object.length : undefined; + if (isLength(length) && + (isArray(object) || isString(object) || isArguments(object))) { + return baseTimes(length, String); + } + return null; + } + + /** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenable(value) { + return isArrayLikeObject(value) && (isArray(value) || isArguments(value)); + } + + /** + * Checks if `value` is a flattenable array and not a `_.matchesProperty` + * iteratee shorthand. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ + function isFlattenableIteratee(value) { + return isArray(value) && !(value.length == 2 && !isFunction(value[0])); + } + + /** + * Checks if the given arguments are from an iteratee call. + * + * @private + * @param {*} value The potential iteratee value argument. + * @param {*} index The potential iteratee index or key argument. + * @param {*} object The potential iteratee object argument. + * @returns {boolean} Returns `true` if the arguments are from an iteratee call, + * else `false`. + */ + function isIterateeCall(value, index, object) { + if (!isObject(object)) { + return false; + } + var type = typeof index; + if (type == 'number' + ? (isArrayLike(object) && isIndex(index, object.length)) + : (type == 'string' && index in object) + ) { + return eq(object[index], value); + } + return false; + } + + /** + * Checks if `value` is a property name and not a property path. + * + * @private + * @param {*} value The value to check. + * @param {Object} [object] The object to query keys on. + * @returns {boolean} Returns `true` if `value` is a property name, else `false`. + */ + function isKey(value, object) { + var type = typeof value; + if (type == 'number' || type == 'symbol') { + return true; + } + return !isArray(value) && + (isSymbol(value) || reIsPlainProp.test(value) || !reIsDeepProp.test(value) || + (object != null && value in Object(object))); + } + + /** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ + function isKeyable(value) { + var type = typeof value; + return type == 'number' || type == 'boolean' || + (type == 'string' && value != '__proto__') || value == null; + } + + /** + * Checks if `func` has a lazy counterpart. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` has a lazy counterpart, + * else `false`. + */ + function isLaziable(func) { + var funcName = getFuncName(func), + other = lodash[funcName]; + + if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) { + return false; + } + if (func === other) { + return true; + } + var data = getData(other); + return !!data && func === data[0]; + } + + /** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ + function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; + } + + /** + * Checks if `value` is suitable for strict equality comparisons, i.e. `===`. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` if suitable for strict + * equality comparisons, else `false`. + */ + function isStrictComparable(value) { + return value === value && !isObject(value); + } + + /** + * A specialized version of `matchesProperty` for source values suitable + * for strict equality comparisons, i.e. `===`. + * + * @private + * @param {string} key The key of the property to get. + * @param {*} srcValue The value to match. + * @returns {Function} Returns the new function. + */ + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; + } + return object[key] === srcValue && + (srcValue !== undefined || (key in Object(object))); + }; + } + + /** + * Merges the function metadata of `source` into `data`. + * + * Merging metadata reduces the number of wrappers used to invoke a function. + * This is possible because methods like `_.bind`, `_.curry`, and `_.partial` + * may be applied regardless of execution order. Methods like `_.ary` and + * `_.rearg` modify function arguments, making the order in which they are + * executed important, preventing the merging of metadata. However, we make + * an exception for a safe combined case where curried functions have `_.ary` + * and or `_.rearg` applied. + * + * @private + * @param {Array} data The destination metadata. + * @param {Array} source The source metadata. + * @returns {Array} Returns `data`. + */ + function mergeData(data, source) { + var bitmask = data[1], + srcBitmask = source[1], + newBitmask = bitmask | srcBitmask, + isCommon = newBitmask < (BIND_FLAG | BIND_KEY_FLAG | ARY_FLAG); + + var isCombo = + ((srcBitmask == ARY_FLAG) && (bitmask == CURRY_FLAG)) || + ((srcBitmask == ARY_FLAG) && (bitmask == REARG_FLAG) && (data[7].length <= source[8])) || + ((srcBitmask == (ARY_FLAG | REARG_FLAG)) && (source[7].length <= source[8]) && (bitmask == CURRY_FLAG)); + + // Exit early if metadata can't be merged. + if (!(isCommon || isCombo)) { + return data; + } + // Use source `thisArg` if available. + if (srcBitmask & BIND_FLAG) { + data[2] = source[2]; + // Set when currying a bound function. + newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG; + } + // Compose partial arguments. + var value = source[3]; + if (value) { + var partials = data[3]; + data[3] = partials ? composeArgs(partials, value, source[4]) : copyArray(value); + data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : copyArray(source[4]); + } + // Compose partial right arguments. + value = source[5]; + if (value) { + partials = data[5]; + data[5] = partials ? composeArgsRight(partials, value, source[6]) : copyArray(value); + data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : copyArray(source[6]); + } + // Use source `argPos` if available. + value = source[7]; + if (value) { + data[7] = copyArray(value); + } + // Use source `ary` if it's smaller. + if (srcBitmask & ARY_FLAG) { + data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); + } + // Use source `arity` if one is not provided. + if (data[9] == null) { + data[9] = source[9]; + } + // Use source `func` and merge bitmasks. + data[0] = source[0]; + data[1] = newBitmask; + + return data; + } + + /** + * Used by `_.defaultsDeep` to customize its `_.merge` use. + * + * @private + * @param {*} objValue The destination value. + * @param {*} srcValue The source value. + * @param {string} key The key of the property to merge. + * @param {Object} object The parent object of `objValue`. + * @param {Object} source The parent object of `srcValue`. + * @param {Object} [stack] Tracks traversed source values and their merged + * counterparts. + * @returns {*} Returns the value to assign. + */ + function mergeDefaults(objValue, srcValue, key, object, source, stack) { + if (isObject(objValue) && isObject(srcValue)) { + baseMerge(objValue, srcValue, undefined, mergeDefaults, stack.set(srcValue, objValue)); + } + return objValue; + } + + /** + * Gets the parent value at `path` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Array} path The path to get the parent value of. + * @returns {*} Returns the parent value. + */ + function parent(object, path) { + return path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1)); + } + + /** + * Reorder `array` according to the specified indexes where the element at + * the first index is assigned as the first element, the element at + * the second index is assigned as the second element, and so on. + * + * @private + * @param {Array} array The array to reorder. + * @param {Array} indexes The arranged array indexes. + * @returns {Array} Returns `array`. + */ + function reorder(array, indexes) { + var arrLength = array.length, + length = nativeMin(indexes.length, arrLength), + oldArray = copyArray(array); + + while (length--) { + var index = indexes[length]; + array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined; + } + return array; + } + + /** + * Sets metadata for `func`. + * + * **Note:** If this function becomes hot, i.e. is invoked a lot in a short + * period of time, it will trip its breaker and transition to an identity + * function to avoid garbage collection pauses in V8. See + * [V8 issue 2070](https://bugs.chromium.org/p/v8/issues/detail?id=2070) + * for more details. + * + * @private + * @param {Function} func The function to associate metadata with. + * @param {*} data The metadata. + * @returns {Function} Returns `func`. + */ + var setData = (function() { + var count = 0, + lastCalled = 0; + + return function(key, value) { + var stamp = now(), + remaining = HOT_SPAN - (stamp - lastCalled); + + lastCalled = stamp; + if (remaining > 0) { + if (++count >= HOT_COUNT) { + return key; + } + } else { + count = 0; + } + return baseSetData(key, value); + }; + }()); + + /** + * Converts `string` to a property path array. + * + * @private + * @param {string} string The string to convert. + * @returns {Array} Returns the property path array. + */ + var stringToPath = memoize(function(string) { + var result = []; + toString(string).replace(rePropName, function(match, number, quote, string) { + result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match)); + }); + return result; + }); + + /** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; + } + + /** + * Creates a clone of `wrapper`. + * + * @private + * @param {Object} wrapper The wrapper to clone. + * @returns {Object} Returns the cloned wrapper. + */ + function wrapperClone(wrapper) { + if (wrapper instanceof LazyWrapper) { + return wrapper.clone(); + } + var result = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); + result.__actions__ = copyArray(wrapper.__actions__); + result.__index__ = wrapper.__index__; + result.__values__ = wrapper.__values__; + return result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the new array containing chunks. + * @example + * + * _.chunk(['a', 'b', 'c', 'd'], 2); + * // => [['a', 'b'], ['c', 'd']] + * + * _.chunk(['a', 'b', 'c', 'd'], 3); + * // => [['a', 'b', 'c'], ['d']] + */ + function chunk(array, size, guard) { + if ((guard ? isIterateeCall(array, size, guard) : size === undefined)) { + size = 1; + } else { + size = nativeMax(toInteger(size), 0); + } + var length = array ? array.length : 0; + if (!length || size < 1) { + return []; + } + var index = 0, + resIndex = 0, + result = Array(nativeCeil(length / size)); + + while (index < length) { + result[resIndex++] = baseSlice(array, index, (index += size)); + } + return result; + } + + /** + * Creates an array with all falsey values removed. The values `false`, `null`, + * `0`, `""`, `undefined`, and `NaN` are falsey. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to compact. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.compact([0, 1, false, 2, '', 3]); + * // => [1, 2, 3] + */ + function compact(array) { + var index = -1, + length = array ? array.length : 0, + resIndex = 0, + result = []; + + while (++index < length) { + var value = array[index]; + if (value) { + result[resIndex++] = value; + } + } + return result; + } + + /** + * Creates a new array concatenating `array` with any additional arrays + * and/or values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to concatenate. + * @param {...*} [values] The values to concatenate. + * @returns {Array} Returns the new concatenated array. + * @example + * + * var array = [1]; + * var other = _.concat(array, 2, [3], [[4]]); + * + * console.log(other); + * // => [1, 2, 3, [4]] + * + * console.log(array); + * // => [1] + */ + function concat() { + var length = arguments.length, + array = castArray(arguments[0]); + + if (length < 2) { + return length ? copyArray(array) : []; + } + var args = Array(length - 1); + while (length--) { + args[length - 1] = arguments[length]; + } + return arrayConcat(array, baseFlatten(args, 1)); + } + + /** + * Creates an array of unique `array` values not included in the other given + * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.difference([3, 2, 1], [4, 2]); + * // => [3, 1] + */ + var difference = rest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `iteratee` which + * is invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.differenceBy([3.1, 2.2, 1.3], [4.4, 2.5], Math.floor); + * // => [3.1, 1.3] + * + * // The `_.property` iteratee shorthand. + * _.differenceBy([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var differenceBy = rest(function(array, values) { + var iteratee = last(values); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), getIteratee(iteratee)) + : []; + }); + + /** + * This method is like `_.difference` except that it accepts `comparator` + * which is invoked to compare elements of `array` to `values`. Result values + * are chosen from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {...Array} [values] The values to exclude. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * + * _.differenceWith(objects, [{ 'x': 1, 'y': 2 }], _.isEqual); + * // => [{ 'x': 2, 'y': 1 }] + */ + var differenceWith = rest(function(array, values) { + var comparator = last(values); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return isArrayLikeObject(array) + ? baseDifference(array, baseFlatten(values, 1, isArrayLikeObject, true), undefined, comparator) + : []; + }); + + /** + * Creates a slice of `array` with `n` elements dropped from the beginning. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.drop([1, 2, 3]); + * // => [2, 3] + * + * _.drop([1, 2, 3], 2); + * // => [3] + * + * _.drop([1, 2, 3], 5); + * // => [] + * + * _.drop([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function drop(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with `n` elements dropped from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to drop. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.dropRight([1, 2, 3]); + * // => [1, 2] + * + * _.dropRight([1, 2, 3], 2); + * // => [1] + * + * _.dropRight([1, 2, 3], 5); + * // => [] + * + * _.dropRight([1, 2, 3], 0); + * // => [1, 2, 3] + */ + function dropRight(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` excluding elements dropped from the end. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.dropRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney'] + * + * // The `_.matches` iteratee shorthand. + * _.dropRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropRightWhile(users, ['active', false]); + * // => objects for ['barney'] + * + * // The `_.property` iteratee shorthand. + * _.dropRightWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true, true) + : []; + } + + /** + * Creates a slice of `array` excluding elements dropped from the beginning. + * Elements are dropped until `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.dropWhile(users, function(o) { return !o.active; }); + * // => objects for ['pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.dropWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.dropWhile(users, ['active', false]); + * // => objects for ['pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.dropWhile(users, 'active'); + * // => objects for ['barney', 'fred', 'pebbles'] + */ + function dropWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), true) + : []; + } + + /** + * Fills elements of `array` with `value` from `start` up to, but not + * including, `end`. + * + * **Note:** This method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Array + * @param {Array} array The array to fill. + * @param {*} value The value to fill `array` with. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.fill(array, 'a'); + * console.log(array); + * // => ['a', 'a', 'a'] + * + * _.fill(Array(3), 2); + * // => [2, 2, 2] + * + * _.fill([4, 6, 8, 10], '*', 1, 3); + * // => [4, '*', '*', 10] + */ + function fill(array, value, start, end) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (start && typeof start != 'number' && isIterateeCall(array, value, start)) { + start = 0; + end = length; + } + return baseFill(array, value, start, end); + } + + /** + * This method is like `_.find` except that it returns the index of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.findIndex(users, function(o) { return o.user == 'barney'; }); + * // => 0 + * + * // The `_.matches` iteratee shorthand. + * _.findIndex(users, { 'user': 'fred', 'active': false }); + * // => 1 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findIndex(users, ['active', false]); + * // => 0 + * + * // The `_.property` iteratee shorthand. + * _.findIndex(users, 'active'); + * // => 2 + */ + function findIndex(array, predicate) { + return (array && array.length) + ? baseFindIndex(array, getIteratee(predicate, 3)) + : -1; + } + + /** + * This method is like `_.findIndex` except that it iterates over elements + * of `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {number} Returns the index of the found element, else `-1`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.findLastIndex(users, function(o) { return o.user == 'pebbles'; }); + * // => 2 + * + * // The `_.matches` iteratee shorthand. + * _.findLastIndex(users, { 'user': 'barney', 'active': true }); + * // => 0 + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastIndex(users, ['active', false]); + * // => 2 + * + * // The `_.property` iteratee shorthand. + * _.findLastIndex(users, 'active'); + * // => 0 + */ + function findLastIndex(array, predicate) { + return (array && array.length) + ? baseFindIndex(array, getIteratee(predicate, 3), true) + : -1; + } + + /** + * Flattens `array` a single level deep. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flatten([1, [2, [3, [4]], 5]]); + * // => [1, 2, [3, [4]], 5] + */ + function flatten(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, 1) : []; + } + + /** + * Recursively flattens `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to flatten. + * @returns {Array} Returns the new flattened array. + * @example + * + * _.flattenDeep([1, [2, [3, [4]], 5]]); + * // => [1, 2, 3, 4, 5] + */ + function flattenDeep(array) { + var length = array ? array.length : 0; + return length ? baseFlatten(array, INFINITY) : []; + } + + /** + * Recursively flatten `array` up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Array + * @param {Array} array The array to flatten. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * var array = [1, [2, [3, [4]], 5]]; + * + * _.flattenDepth(array, 1); + * // => [1, 2, [3, [4]], 5] + * + * _.flattenDepth(array, 2); + * // => [1, 2, 3, [4], 5] + */ + function flattenDepth(array, depth) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(array, depth); + } + + /** + * The inverse of `_.toPairs`; this method returns an object composed + * from key-value `pairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} pairs The key-value pairs. + * @returns {Object} Returns the new object. + * @example + * + * _.fromPairs([['fred', 30], ['barney', 40]]); + * // => { 'fred': 30, 'barney': 40 } + */ + function fromPairs(pairs) { + var index = -1, + length = pairs ? pairs.length : 0, + result = {}; + + while (++index < length) { + var pair = pairs[index]; + result[pair[0]] = pair[1]; + } + return result; + } + + /** + * Gets the first element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias first + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the first element of `array`. + * @example + * + * _.head([1, 2, 3]); + * // => 1 + * + * _.head([]); + * // => undefined + */ + function head(array) { + return array ? array[0] : undefined; + } + + /** + * Gets the index at which the first occurrence of `value` is found in `array` + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. If `fromIndex` is negative, it's used as the + * offset from the end of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.indexOf([1, 2, 1, 2], 2); + * // => 1 + * + * // Search from the `fromIndex`. + * _.indexOf([1, 2, 1, 2], 2, 2); + * // => 3 + */ + function indexOf(array, value, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + fromIndex = toInteger(fromIndex); + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return baseIndexOf(array, value, fromIndex); + } + + /** + * Gets all but the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.initial([1, 2, 3]); + * // => [1, 2] + */ + function initial(array) { + return dropRight(array, 1); + } + + /** + * Creates an array of unique values that are included in all given arrays + * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. The order of result values is determined by the + * order they occur in the first array. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersection([2, 1], [4, 2], [1, 2]); + * // => [2] + */ + var intersection = rest(function(arrays) { + var mapped = arrayMap(arrays, baseCastArrayLikeObject); + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `iteratee` + * which is invoked for each element of each `arrays` to generate the criterion + * by which they're compared. Result values are chosen from the first array. + * The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * _.intersectionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1] + * + * // The `_.property` iteratee shorthand. + * _.intersectionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }] + */ + var intersectionBy = rest(function(arrays) { + var iteratee = last(arrays), + mapped = arrayMap(arrays, baseCastArrayLikeObject); + + if (iteratee === last(mapped)) { + iteratee = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, getIteratee(iteratee)) + : []; + }); + + /** + * This method is like `_.intersection` except that it accepts `comparator` + * which is invoked to compare elements of `arrays`. Result values are chosen + * from the first array. The comparator is invoked with two arguments: + * (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of intersecting values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.intersectionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }] + */ + var intersectionWith = rest(function(arrays) { + var comparator = last(arrays), + mapped = arrayMap(arrays, baseCastArrayLikeObject); + + if (comparator === last(mapped)) { + comparator = undefined; + } else { + mapped.pop(); + } + return (mapped.length && mapped[0] === arrays[0]) + ? baseIntersection(mapped, undefined, comparator) + : []; + }); + + /** + * Converts all elements in `array` into a string separated by `separator`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to convert. + * @param {string} [separator=','] The element separator. + * @returns {string} Returns the joined string. + * @example + * + * _.join(['a', 'b', 'c'], '~'); + * // => 'a~b~c' + */ + function join(array, separator) { + return array ? nativeJoin.call(array, separator) : ''; + } + + /** + * Gets the last element of `array`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @returns {*} Returns the last element of `array`. + * @example + * + * _.last([1, 2, 3]); + * // => 3 + */ + function last(array) { + var length = array ? array.length : 0; + return length ? array[length - 1] : undefined; + } + + /** + * This method is like `_.indexOf` except that it iterates over elements of + * `array` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=array.length-1] The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.lastIndexOf([1, 2, 1, 2], 2); + * // => 3 + * + * // Search from the `fromIndex`. + * _.lastIndexOf([1, 2, 1, 2], 2, 2); + * // => 1 + */ + function lastIndexOf(array, value, fromIndex) { + var length = array ? array.length : 0; + if (!length) { + return -1; + } + var index = length; + if (fromIndex !== undefined) { + index = toInteger(fromIndex); + index = ( + index < 0 + ? nativeMax(length + index, 0) + : nativeMin(index, length - 1) + ) + 1; + } + if (value !== value) { + return indexOfNaN(array, index, true); + } + while (index--) { + if (array[index] === value) { + return index; + } + } + return -1; + } + + /** + * Removes all given values from `array` using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * **Note:** Unlike `_.without`, this method mutates `array`. Use `_.remove` + * to remove elements from an array by predicate. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...*} [values] The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pull(array, 2, 3); + * console.log(array); + * // => [1, 1] + */ + var pull = rest(pullAll); + + /** + * This method is like `_.pull` except that it accepts an array of values to remove. + * + * **Note:** Unlike `_.difference`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3, 1, 2, 3]; + * + * _.pullAll(array, [2, 3]); + * console.log(array); + * // => [1, 1] + */ + function pullAll(array, values) { + return (array && array.length && values && values.length) + ? basePullAll(array, values) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `iteratee` which is + * invoked for each element of `array` and `values` to generate the criterion + * by which they're compared. The iteratee is invoked with one argument: (value). + * + * **Note:** Unlike `_.differenceBy`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1 }, { 'x': 2 }, { 'x': 3 }, { 'x': 1 }]; + * + * _.pullAllBy(array, [{ 'x': 1 }, { 'x': 3 }], 'x'); + * console.log(array); + * // => [{ 'x': 2 }] + */ + function pullAllBy(array, values, iteratee) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, getIteratee(iteratee)) + : array; + } + + /** + * This method is like `_.pullAll` except that it accepts `comparator` which + * is invoked to compare elements of `array` to `values`. The comparator is + * invoked with two arguments: (arrVal, othVal). + * + * **Note:** Unlike `_.differenceWith`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array} values The values to remove. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns `array`. + * @example + * + * var array = [{ 'x': 1, 'y': 2 }, { 'x': 3, 'y': 4 }, { 'x': 5, 'y': 6 }]; + * + * _.pullAllWith(array, [{ 'x': 3, 'y': 4 }], _.isEqual); + * console.log(array); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 5, 'y': 6 }] + */ + function pullAllWith(array, values, comparator) { + return (array && array.length && values && values.length) + ? basePullAll(array, values, undefined, comparator) + : array; + } + + /** + * Removes elements from `array` corresponding to `indexes` and returns an + * array of removed elements. + * + * **Note:** Unlike `_.at`, this method mutates `array`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {...(number|number[])} [indexes] The indexes of elements to remove, + * specified individually or in arrays. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [5, 10, 15, 20]; + * var evens = _.pullAt(array, 1, 3); + * + * console.log(array); + * // => [5, 15] + * + * console.log(evens); + * // => [10, 20] + */ + var pullAt = rest(function(array, indexes) { + indexes = arrayMap(baseFlatten(indexes, 1), String); + + var result = baseAt(array, indexes); + basePullAt(array, indexes.sort(compareAscending)); + return result; + }); + + /** + * Removes all elements from `array` that `predicate` returns truthy for + * and returns an array of the removed elements. The predicate is invoked + * with three arguments: (value, index, array). + * + * **Note:** Unlike `_.filter`, this method mutates `array`. Use `_.pull` + * to pull elements from an array by value. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Array + * @param {Array} array The array to modify. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new array of removed elements. + * @example + * + * var array = [1, 2, 3, 4]; + * var evens = _.remove(array, function(n) { + * return n % 2 == 0; + * }); + * + * console.log(array); + * // => [1, 3] + * + * console.log(evens); + * // => [2, 4] + */ + function remove(array, predicate) { + var result = []; + if (!(array && array.length)) { + return result; + } + var index = -1, + indexes = [], + length = array.length; + + predicate = getIteratee(predicate, 3); + while (++index < length) { + var value = array[index]; + if (predicate(value, index, array)) { + result.push(value); + indexes.push(index); + } + } + basePullAt(array, indexes); + return result; + } + + /** + * Reverses `array` so that the first element becomes the last, the second + * element becomes the second to last, and so on. + * + * **Note:** This method mutates `array` and is based on + * [`Array#reverse`](https://mdn.io/Array/reverse). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to modify. + * @returns {Array} Returns `array`. + * @example + * + * var array = [1, 2, 3]; + * + * _.reverse(array); + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function reverse(array) { + return array ? nativeReverse.call(array) : array; + } + + /** + * Creates a slice of `array` from `start` up to, but not including, `end`. + * + * **Note:** This method is used instead of + * [`Array#slice`](https://mdn.io/Array/slice) to ensure dense arrays are + * returned. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to slice. + * @param {number} [start=0] The start position. + * @param {number} [end=array.length] The end position. + * @returns {Array} Returns the slice of `array`. + */ + function slice(array, start, end) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + if (end && typeof end != 'number' && isIterateeCall(array, start, end)) { + start = 0; + end = length; + } + else { + start = start == null ? 0 : toInteger(start); + end = end === undefined ? length : toInteger(end); + } + return baseSlice(array, start, end); + } + + /** + * Uses a binary search to determine the lowest index at which `value` + * should be inserted into `array` in order to maintain its sort order. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedIndex([30, 50], 40); + * // => 1 + * + * _.sortedIndex([4, 5], 4); + * // => 0 + */ + function sortedIndex(array, value) { + return baseSortedIndex(array, value); + } + + /** + * This method is like `_.sortedIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * var dict = { 'thirty': 30, 'forty': 40, 'fifty': 50 }; + * + * _.sortedIndexBy(['thirty', 'fifty'], 'forty', _.propertyOf(dict)); + * // => 1 + * + * // The `_.property` iteratee shorthand. + * _.sortedIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 0 + */ + function sortedIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee)); + } + + /** + * This method is like `_.indexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedIndexOf([1, 1, 2, 2], 2); + * // => 2 + */ + function sortedIndexOf(array, value) { + var length = array ? array.length : 0; + if (length) { + var index = baseSortedIndex(array, value); + if (index < length && eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.sortedIndex` except that it returns the highest + * index at which `value` should be inserted into `array` in order to + * maintain its sort order. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * _.sortedLastIndex([4, 5], 4); + * // => 1 + */ + function sortedLastIndex(array, value) { + return baseSortedIndex(array, value, true); + } + + /** + * This method is like `_.sortedLastIndex` except that it accepts `iteratee` + * which is invoked for `value` and each element of `array` to compute their + * sort ranking. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The sorted array to inspect. + * @param {*} value The value to evaluate. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {number} Returns the index at which `value` should be inserted + * into `array`. + * @example + * + * // The `_.property` iteratee shorthand. + * _.sortedLastIndexBy([{ 'x': 4 }, { 'x': 5 }], { 'x': 4 }, 'x'); + * // => 1 + */ + function sortedLastIndexBy(array, value, iteratee) { + return baseSortedIndexBy(array, value, getIteratee(iteratee), true); + } + + /** + * This method is like `_.lastIndexOf` except that it performs a binary + * search on a sorted `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to search. + * @param {*} value The value to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + * @example + * + * _.sortedLastIndexOf([1, 1, 2, 2], 2); + * // => 3 + */ + function sortedLastIndexOf(array, value) { + var length = array ? array.length : 0; + if (length) { + var index = baseSortedIndex(array, value, true) - 1; + if (eq(array[index], value)) { + return index; + } + } + return -1; + } + + /** + * This method is like `_.uniq` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniq([1, 1, 2]); + * // => [1, 2] + */ + function sortedUniq(array) { + return (array && array.length) + ? baseSortedUniq(array) + : []; + } + + /** + * This method is like `_.uniqBy` except that it's designed and optimized + * for sorted arrays. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.sortedUniqBy([1.1, 1.2, 2.3, 2.4], Math.floor); + * // => [1.1, 2.3] + */ + function sortedUniqBy(array, iteratee) { + return (array && array.length) + ? baseSortedUniqBy(array, getIteratee(iteratee)) + : []; + } + + /** + * Gets all but the first element of `array`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to query. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.tail([1, 2, 3]); + * // => [2, 3] + */ + function tail(array) { + return drop(array, 1); + } + + /** + * Creates a slice of `array` with `n` elements taken from the beginning. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.take([1, 2, 3]); + * // => [1] + * + * _.take([1, 2, 3], 2); + * // => [1, 2] + * + * _.take([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.take([1, 2, 3], 0); + * // => [] + */ + function take(array, n, guard) { + if (!(array && array.length)) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + return baseSlice(array, 0, n < 0 ? 0 : n); + } + + /** + * Creates a slice of `array` with `n` elements taken from the end. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {number} [n=1] The number of elements to take. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the slice of `array`. + * @example + * + * _.takeRight([1, 2, 3]); + * // => [3] + * + * _.takeRight([1, 2, 3], 2); + * // => [2, 3] + * + * _.takeRight([1, 2, 3], 5); + * // => [1, 2, 3] + * + * _.takeRight([1, 2, 3], 0); + * // => [] + */ + function takeRight(array, n, guard) { + var length = array ? array.length : 0; + if (!length) { + return []; + } + n = (guard || n === undefined) ? 1 : toInteger(n); + n = length - n; + return baseSlice(array, n < 0 ? 0 : n, length); + } + + /** + * Creates a slice of `array` with elements taken from the end. Elements are + * taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false }, + * { 'user': 'pebbles', 'active': false } + * ]; + * + * _.takeRightWhile(users, function(o) { return !o.active; }); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.matches` iteratee shorthand. + * _.takeRightWhile(users, { 'user': 'pebbles', 'active': false }); + * // => objects for ['pebbles'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeRightWhile(users, ['active', false]); + * // => objects for ['fred', 'pebbles'] + * + * // The `_.property` iteratee shorthand. + * _.takeRightWhile(users, 'active'); + * // => [] + */ + function takeRightWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3), false, true) + : []; + } + + /** + * Creates a slice of `array` with elements taken from the beginning. Elements + * are taken until `predicate` returns falsey. The predicate is invoked with + * three arguments: (value, index, array). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Array + * @param {Array} array The array to query. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the slice of `array`. + * @example + * + * var users = [ + * { 'user': 'barney', 'active': false }, + * { 'user': 'fred', 'active': false}, + * { 'user': 'pebbles', 'active': true } + * ]; + * + * _.takeWhile(users, function(o) { return !o.active; }); + * // => objects for ['barney', 'fred'] + * + * // The `_.matches` iteratee shorthand. + * _.takeWhile(users, { 'user': 'barney', 'active': false }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.takeWhile(users, ['active', false]); + * // => objects for ['barney', 'fred'] + * + * // The `_.property` iteratee shorthand. + * _.takeWhile(users, 'active'); + * // => [] + */ + function takeWhile(array, predicate) { + return (array && array.length) + ? baseWhile(array, getIteratee(predicate, 3)) + : []; + } + + /** + * Creates an array of unique values, in order, from all given arrays using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.union([2, 1], [4, 2], [1, 2]); + * // => [2, 1, 4] + */ + var union = rest(function(arrays) { + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); + }); + + /** + * This method is like `_.union` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which uniqueness is computed. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * _.unionBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [2.1, 1.2, 4.3] + * + * // The `_.property` iteratee shorthand. + * _.unionBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + var unionBy = rest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee)); + }); + + /** + * This method is like `_.union` except that it accepts `comparator` which + * is invoked to compare elements of `arrays`. The comparator is invoked + * with two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of combined values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.unionWith(objects, others, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var unionWith = rest(function(arrays) { + var comparator = last(arrays); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined, comparator); + }); + + /** + * Creates a duplicate-free version of an array, using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons, in which only the first occurrence of each + * element is kept. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to inspect. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniq([2, 1, 2]); + * // => [2, 1] + */ + function uniq(array) { + return (array && array.length) + ? baseUniq(array) + : []; + } + + /** + * This method is like `_.uniq` except that it accepts `iteratee` which is + * invoked for each element in `array` to generate the criterion by which + * uniqueness is computed. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * _.uniqBy([2.1, 1.2, 2.3], Math.floor); + * // => [2.1, 1.2] + * + * // The `_.property` iteratee shorthand. + * _.uniqBy([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 1 }, { 'x': 2 }] + */ + function uniqBy(array, iteratee) { + return (array && array.length) + ? baseUniq(array, getIteratee(iteratee)) + : []; + } + + /** + * This method is like `_.uniq` except that it accepts `comparator` which + * is invoked to compare elements of `array`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {Array} array The array to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.uniqWith(objects, _.isEqual); + * // => [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }] + */ + function uniqWith(array, comparator) { + return (array && array.length) + ? baseUniq(array, undefined, comparator) + : []; + } + + /** + * This method is like `_.zip` except that it accepts an array of grouped + * elements and creates an array regrouping the elements to their pre-zip + * configuration. + * + * @static + * @memberOf _ + * @since 1.2.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + * + * _.unzip(zipped); + * // => [['fred', 'barney'], [30, 40], [true, false]] + */ + function unzip(array) { + if (!(array && array.length)) { + return []; + } + var length = 0; + array = arrayFilter(array, function(group) { + if (isArrayLikeObject(group)) { + length = nativeMax(group.length, length); + return true; + } + }); + return baseTimes(length, function(index) { + return arrayMap(array, baseProperty(index)); + }); + } + + /** + * This method is like `_.unzip` except that it accepts `iteratee` to specify + * how regrouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {Array} array The array of grouped elements to process. + * @param {Function} [iteratee=_.identity] The function to combine + * regrouped values. + * @returns {Array} Returns the new array of regrouped elements. + * @example + * + * var zipped = _.zip([1, 2], [10, 20], [100, 200]); + * // => [[1, 10, 100], [2, 20, 200]] + * + * _.unzipWith(zipped, _.add); + * // => [3, 30, 300] + */ + function unzipWith(array, iteratee) { + if (!(array && array.length)) { + return []; + } + var result = unzip(array); + if (iteratee == null) { + return result; + } + return arrayMap(result, function(group) { + return apply(iteratee, undefined, group); + }); + } + + /** + * Creates an array excluding all given values using + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * for equality comparisons. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {Array} array The array to filter. + * @param {...*} [values] The values to exclude. + * @returns {Array} Returns the new array of filtered values. + * @example + * + * _.without([1, 2, 1, 3], 1, 2); + * // => [3] + */ + var without = rest(function(array, values) { + return isArrayLikeObject(array) + ? baseDifference(array, values) + : []; + }); + + /** + * Creates an array of unique values that is the + * [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference) + * of the given arrays. The order of result values is determined by the order + * they occur in the arrays. + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @returns {Array} Returns the new array of values. + * @example + * + * _.xor([2, 1], [4, 2]); + * // => [1, 4] + */ + var xor = rest(function(arrays) { + return baseXor(arrayFilter(arrays, isArrayLikeObject)); + }); + + /** + * This method is like `_.xor` except that it accepts `iteratee` which is + * invoked for each element of each `arrays` to generate the criterion by + * which by which they're compared. The iteratee is invoked with one argument: + * (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Array} Returns the new array of values. + * @example + * + * _.xorBy([2.1, 1.2], [4.3, 2.4], Math.floor); + * // => [1.2, 4.3] + * + * // The `_.property` iteratee shorthand. + * _.xorBy([{ 'x': 1 }], [{ 'x': 2 }, { 'x': 1 }], 'x'); + * // => [{ 'x': 2 }] + */ + var xorBy = rest(function(arrays) { + var iteratee = last(arrays); + if (isArrayLikeObject(iteratee)) { + iteratee = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee)); + }); + + /** + * This method is like `_.xor` except that it accepts `comparator` which is + * invoked to compare elements of `arrays`. The comparator is invoked with + * two arguments: (arrVal, othVal). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Array + * @param {...Array} [arrays] The arrays to inspect. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of values. + * @example + * + * var objects = [{ 'x': 1, 'y': 2 }, { 'x': 2, 'y': 1 }]; + * var others = [{ 'x': 1, 'y': 1 }, { 'x': 1, 'y': 2 }]; + * + * _.xorWith(objects, others, _.isEqual); + * // => [{ 'x': 2, 'y': 1 }, { 'x': 1, 'y': 1 }] + */ + var xorWith = rest(function(arrays) { + var comparator = last(arrays); + if (isArrayLikeObject(comparator)) { + comparator = undefined; + } + return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined, comparator); + }); + + /** + * Creates an array of grouped elements, the first of which contains the + * first elements of the given arrays, the second of which contains the + * second elements of the given arrays, and so on. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zip(['fred', 'barney'], [30, 40], [true, false]); + * // => [['fred', 30, true], ['barney', 40, false]] + */ + var zip = rest(unzip); + + /** + * This method is like `_.fromPairs` except that it accepts two arrays, + * one of property identifiers and one of corresponding values. + * + * @static + * @memberOf _ + * @since 0.4.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObject(['a', 'b'], [1, 2]); + * // => { 'a': 1, 'b': 2 } + */ + function zipObject(props, values) { + return baseZipObject(props || [], values || [], assignValue); + } + + /** + * This method is like `_.zipObject` except that it supports property paths. + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Array + * @param {Array} [props=[]] The property identifiers. + * @param {Array} [values=[]] The property values. + * @returns {Object} Returns the new object. + * @example + * + * _.zipObjectDeep(['a.b[0].c', 'a.b[1].d'], [1, 2]); + * // => { 'a': { 'b': [{ 'c': 1 }, { 'd': 2 }] } } + */ + function zipObjectDeep(props, values) { + return baseZipObject(props || [], values || [], baseSet); + } + + /** + * This method is like `_.zip` except that it accepts `iteratee` to specify + * how grouped values should be combined. The iteratee is invoked with the + * elements of each group: (...group). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Array + * @param {...Array} [arrays] The arrays to process. + * @param {Function} [iteratee=_.identity] The function to combine grouped values. + * @returns {Array} Returns the new array of grouped elements. + * @example + * + * _.zipWith([1, 2], [10, 20], [100, 200], function(a, b, c) { + * return a + b + c; + * }); + * // => [111, 222] + */ + var zipWith = rest(function(arrays) { + var length = arrays.length, + iteratee = length > 1 ? arrays[length - 1] : undefined; + + iteratee = typeof iteratee == 'function' ? (arrays.pop(), iteratee) : undefined; + return unzipWith(arrays, iteratee); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Creates a `lodash` wrapper instance that wraps `value` with explicit method + * chain sequences enabled. The result of such sequences must be unwrapped + * with `_#value`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Seq + * @param {*} value The value to wrap. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'pebbles', 'age': 1 } + * ]; + * + * var youngest = _ + * .chain(users) + * .sortBy('age') + * .map(function(o) { + * return o.user + ' is ' + o.age; + * }) + * .head() + * .value(); + * // => 'pebbles is 1' + */ + function chain(value) { + var result = lodash(value); + result.__chain__ = true; + return result; + } + + /** + * This method invokes `interceptor` and returns `value`. The interceptor + * is invoked with one argument; (value). The purpose of this method is to + * "tap into" a method chain sequence in order to modify intermediate results. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns `value`. + * @example + * + * _([1, 2, 3]) + * .tap(function(array) { + * // Mutate input array. + * array.pop(); + * }) + * .reverse() + * .value(); + * // => [2, 1] + */ + function tap(value, interceptor) { + interceptor(value); + return value; + } + + /** + * This method is like `_.tap` except that it returns the result of `interceptor`. + * The purpose of this method is to "pass thru" values replacing intermediate + * results in a method chain sequence. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Seq + * @param {*} value The value to provide to `interceptor`. + * @param {Function} interceptor The function to invoke. + * @returns {*} Returns the result of `interceptor`. + * @example + * + * _(' abc ') + * .chain() + * .trim() + * .thru(function(value) { + * return [value]; + * }) + * .value(); + * // => ['abc'] + */ + function thru(value, interceptor) { + return interceptor(value); + } + + /** + * This method is the wrapper version of `_.at`. + * + * @name at + * @memberOf _ + * @since 1.0.0 + * @category Seq + * @param {...(string|string[])} [paths] The property paths of elements to pick, + * specified individually or in arrays. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _(object).at(['a[0].b.c', 'a[1]']).value(); + * // => [3, 4] + * + * _(['a', 'b', 'c']).at(0, 2).value(); + * // => ['a', 'c'] + */ + var wrapperAt = rest(function(paths) { + paths = baseFlatten(paths, 1); + var length = paths.length, + start = length ? paths[0] : 0, + value = this.__wrapped__, + interceptor = function(object) { return baseAt(object, paths); }; + + if (length > 1 || this.__actions__.length || + !(value instanceof LazyWrapper) || !isIndex(start)) { + return this.thru(interceptor); + } + value = value.slice(start, +start + (length ? 1 : 0)); + value.__actions__.push({ + 'func': thru, + 'args': [interceptor], + 'thisArg': undefined + }); + return new LodashWrapper(value, this.__chain__).thru(function(array) { + if (length && !array.length) { + array.push(undefined); + } + return array; + }); + }); + + /** + * Creates a `lodash` wrapper instance with explicit method chain sequences enabled. + * + * @name chain + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 } + * ]; + * + * // A sequence without explicit chaining. + * _(users).head(); + * // => { 'user': 'barney', 'age': 36 } + * + * // A sequence with explicit chaining. + * _(users) + * .chain() + * .head() + * .pick('user') + * .value(); + * // => { 'user': 'barney' } + */ + function wrapperChain() { + return chain(this); + } + + /** + * Executes the chain sequence and returns the wrapped result. + * + * @name commit + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2]; + * var wrapped = _(array).push(3); + * + * console.log(array); + * // => [1, 2] + * + * wrapped = wrapped.commit(); + * console.log(array); + * // => [1, 2, 3] + * + * wrapped.last(); + * // => 3 + * + * console.log(array); + * // => [1, 2, 3] + */ + function wrapperCommit() { + return new LodashWrapper(this.value(), this.__chain__); + } + + /** + * Gets the next value on a wrapped object following the + * [iterator protocol](https://mdn.io/iteration_protocols#iterator). + * + * @name next + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the next iterator value. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped.next(); + * // => { 'done': false, 'value': 1 } + * + * wrapped.next(); + * // => { 'done': false, 'value': 2 } + * + * wrapped.next(); + * // => { 'done': true, 'value': undefined } + */ + function wrapperNext() { + if (this.__values__ === undefined) { + this.__values__ = toArray(this.value()); + } + var done = this.__index__ >= this.__values__.length, + value = done ? undefined : this.__values__[this.__index__++]; + + return { 'done': done, 'value': value }; + } + + /** + * Enables the wrapper to be iterable. + * + * @name Symbol.iterator + * @memberOf _ + * @since 4.0.0 + * @category Seq + * @returns {Object} Returns the wrapper object. + * @example + * + * var wrapped = _([1, 2]); + * + * wrapped[Symbol.iterator]() === wrapped; + * // => true + * + * Array.from(wrapped); + * // => [1, 2] + */ + function wrapperToIterator() { + return this; + } + + /** + * Creates a clone of the chain sequence planting `value` as the wrapped value. + * + * @name plant + * @memberOf _ + * @since 3.2.0 + * @category Seq + * @param {*} value The value to plant. + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * function square(n) { + * return n * n; + * } + * + * var wrapped = _([1, 2]).map(square); + * var other = wrapped.plant([3, 4]); + * + * other.value(); + * // => [9, 16] + * + * wrapped.value(); + * // => [1, 4] + */ + function wrapperPlant(value) { + var result, + parent = this; + + while (parent instanceof baseLodash) { + var clone = wrapperClone(parent); + clone.__index__ = 0; + clone.__values__ = undefined; + if (result) { + previous.__wrapped__ = clone; + } else { + result = clone; + } + var previous = clone; + parent = parent.__wrapped__; + } + previous.__wrapped__ = value; + return result; + } + + /** + * This method is the wrapper version of `_.reverse`. + * + * **Note:** This method mutates the wrapped array. + * + * @name reverse + * @memberOf _ + * @since 0.1.0 + * @category Seq + * @returns {Object} Returns the new `lodash` wrapper instance. + * @example + * + * var array = [1, 2, 3]; + * + * _(array).reverse().value() + * // => [3, 2, 1] + * + * console.log(array); + * // => [3, 2, 1] + */ + function wrapperReverse() { + var value = this.__wrapped__; + if (value instanceof LazyWrapper) { + var wrapped = value; + if (this.__actions__.length) { + wrapped = new LazyWrapper(this); + } + wrapped = wrapped.reverse(); + wrapped.__actions__.push({ + 'func': thru, + 'args': [reverse], + 'thisArg': undefined + }); + return new LodashWrapper(wrapped, this.__chain__); + } + return this.thru(reverse); + } + + /** + * Executes the chain sequence to resolve the unwrapped value. + * + * @name value + * @memberOf _ + * @since 0.1.0 + * @alias toJSON, valueOf + * @category Seq + * @returns {*} Returns the resolved unwrapped value. + * @example + * + * _([1, 2, 3]).value(); + * // => [1, 2, 3] + */ + function wrapperValue() { + return baseWrapperValue(this.__wrapped__, this.__actions__); + } + + /*------------------------------------------------------------------------*/ + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the number of times the key was returned by `iteratee`. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.countBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': 1, '6': 2 } + * + * _.countBy(['one', 'two', 'three'], 'length'); + * // => { '3': 2, '5': 1 } + */ + var countBy = createAggregator(function(result, value, key) { + hasOwnProperty.call(result, key) ? ++result[key] : (result[key] = 1); + }); + + /** + * Checks if `predicate` returns truthy for **all** elements of `collection`. + * Iteration is stopped once `predicate` returns falsey. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if all elements pass the predicate check, + * else `false`. + * @example + * + * _.every([true, 1, null, 'yes'], Boolean); + * // => false + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.every(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.every(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.every(users, 'active'); + * // => false + */ + function every(collection, predicate, guard) { + var func = isArray(collection) ? arrayEvery : baseEvery; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning an array of all elements + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false } + * ]; + * + * _.filter(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.filter(users, { 'age': 36, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.filter(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.filter(users, 'active'); + * // => objects for ['barney'] + */ + function filter(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + function find(collection, predicate) { + predicate = getIteratee(predicate, 3); + if (isArray(collection)) { + var index = baseFindIndex(collection, predicate); + return index > -1 ? collection[index] : undefined; + } + return baseFind(collection, predicate, baseEach); + } + + /** + * This method is like `_.find` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * _.findLast([1, 2, 3, 4], function(n) { + * return n % 2 == 1; + * }); + * // => 3 + */ + function findLast(collection, predicate) { + predicate = getIteratee(predicate, 3); + if (isArray(collection)) { + var index = baseFindIndex(collection, predicate, true); + return index > -1 ? collection[index] : undefined; + } + return baseFind(collection, predicate, baseEachRight); + } + + /** + * Creates a flattened array of values by running each element in `collection` + * thru `iteratee` and flattening the mapped results. The iteratee is invoked + * with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [n, n]; + * } + * + * _.flatMap([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMap(collection, iteratee) { + return baseFlatten(map(collection, iteratee), 1); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDeep([1, 2], duplicate); + * // => [1, 1, 2, 2] + */ + function flatMapDeep(collection, iteratee) { + return baseFlatten(map(collection, iteratee), INFINITY); + } + + /** + * This method is like `_.flatMap` except that it recursively flattens the + * mapped results up to `depth` times. + * + * @static + * @memberOf _ + * @since 4.7.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @param {number} [depth=1] The maximum recursion depth. + * @returns {Array} Returns the new flattened array. + * @example + * + * function duplicate(n) { + * return [[[n, n]]]; + * } + * + * _.flatMapDepth([1, 2], duplicate, 2); + * // => [[1, 1], [2, 2]] + */ + function flatMapDepth(collection, iteratee, depth) { + depth = depth === undefined ? 1 : toInteger(depth); + return baseFlatten(map(collection, iteratee), depth); + } + + /** + * Iterates over elements of `collection` invoking `iteratee` for each element. + * The iteratee is invoked with three arguments: (value, index|key, collection). + * Iteratee functions may exit iteration early by explicitly returning `false`. + * + * **Note:** As with other "Collections" methods, objects with a "length" + * property are iterated like arrays. To avoid this behavior use `_.forIn` + * or `_.forOwn` for object iteration. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @alias each + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @example + * + * _([1, 2]).forEach(function(value) { + * console.log(value); + * }); + * // => Logs `1` then `2`. + * + * _.forEach({ 'a': 1, 'b': 2 }, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forEach(collection, iteratee) { + return (typeof iteratee == 'function' && isArray(collection)) + ? arrayEach(collection, iteratee) + : baseEach(collection, getIteratee(iteratee)); + } + + /** + * This method is like `_.forEach` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @alias eachRight + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Array|Object} Returns `collection`. + * @example + * + * _.forEachRight([1, 2], function(value) { + * console.log(value); + * }); + * // => Logs `2` then `1`. + */ + function forEachRight(collection, iteratee) { + return (typeof iteratee == 'function' && isArray(collection)) + ? arrayEachRight(collection, iteratee) + : baseEachRight(collection, getIteratee(iteratee)); + } + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The order of grouped values + * is determined by the order they occur in `collection`. The corresponding + * value of each key is an array of elements responsible for generating the + * key. The iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * _.groupBy([6.1, 4.2, 6.3], Math.floor); + * // => { '4': [4.2], '6': [6.1, 6.3] } + * + * // The `_.property` iteratee shorthand. + * _.groupBy(['one', 'two', 'three'], 'length'); + * // => { '3': ['one', 'two'], '5': ['three'] } + */ + var groupBy = createAggregator(function(result, value, key) { + if (hasOwnProperty.call(result, key)) { + result[key].push(value); + } else { + result[key] = [value]; + } + }); + + /** + * Checks if `value` is in `collection`. If `collection` is a string, it's + * checked for a substring of `value`, otherwise + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * is used for equality comparisons. If `fromIndex` is negative, it's used as + * the offset from the end of `collection`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object|string} collection The collection to search. + * @param {*} value The value to search for. + * @param {number} [fromIndex=0] The index to search from. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {boolean} Returns `true` if `value` is found, else `false`. + * @example + * + * _.includes([1, 2, 3], 1); + * // => true + * + * _.includes([1, 2, 3], 1, 2); + * // => false + * + * _.includes({ 'user': 'fred', 'age': 40 }, 'fred'); + * // => true + * + * _.includes('pebbles', 'eb'); + * // => true + */ + function includes(collection, value, fromIndex, guard) { + collection = isArrayLike(collection) ? collection : values(collection); + fromIndex = (fromIndex && !guard) ? toInteger(fromIndex) : 0; + + var length = collection.length; + if (fromIndex < 0) { + fromIndex = nativeMax(length + fromIndex, 0); + } + return isString(collection) + ? (fromIndex <= length && collection.indexOf(value, fromIndex) > -1) + : (!!length && baseIndexOf(collection, value, fromIndex) > -1); + } + + /** + * Invokes the method at `path` of each element in `collection`, returning + * an array of the results of each invoked method. Any additional arguments + * are provided to each invoked method. If `methodName` is a function, it's + * invoked for and `this` bound to, each element in `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|string} path The path of the method to invoke or + * the function invoked per iteration. + * @param {...*} [args] The arguments to invoke each method with. + * @returns {Array} Returns the array of results. + * @example + * + * _.invokeMap([[5, 1, 7], [3, 2, 1]], 'sort'); + * // => [[1, 5, 7], [1, 2, 3]] + * + * _.invokeMap([123, 456], String.prototype.split, ''); + * // => [['1', '2', '3'], ['4', '5', '6']] + */ + var invokeMap = rest(function(collection, path, args) { + var index = -1, + isFunc = typeof path == 'function', + isProp = isKey(path), + result = isArrayLike(collection) ? Array(collection.length) : []; + + baseEach(collection, function(value) { + var func = isFunc ? path : ((isProp && value != null) ? value[path] : undefined); + result[++index] = func ? apply(func, value, args) : baseInvoke(value, path, args); + }); + return result; + }); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + result[key] = value; + }); + + /** + * Creates an array of values by running each element in `collection` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`. + * + * The guarded methods are: + * `ary`, `chunk`, `curry`, `curryRight`, `drop`, `dropRight`, `every`, + * `fill`, `invert`, `parseInt`, `random`, `range`, `rangeRight`, `repeat`, + * `sampleSize`, `slice`, `some`, `sortBy`, `take`, `takeRight`, `template`, + * `trim`, `trimEnd`, `trimStart`, and `words` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + * @example + * + * function square(n) { + * return n * n; + * } + * + * _.map([4, 8], square); + * // => [16, 64] + * + * _.map({ 'a': 4, 'b': 8 }, square); + * // => [16, 64] (iteration order is not guaranteed) + * + * var users = [ + * { 'user': 'barney' }, + * { 'user': 'fred' } + * ]; + * + * // The `_.property` iteratee shorthand. + * _.map(users, 'user'); + * // => ['barney', 'fred'] + */ + function map(collection, iteratee) { + var func = isArray(collection) ? arrayMap : baseMap; + return func(collection, getIteratee(iteratee, 3)); + } + + /** + * This method is like `_.sortBy` except that it allows specifying the sort + * orders of the iteratees to sort by. If `orders` is unspecified, all values + * are sorted in ascending order. Otherwise, specify an order of "desc" for + * descending or "asc" for ascending sort order of corresponding values. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array[]|Function[]|Object[]|string[]} [iteratees=[_.identity]] + * The iteratees to sort by. + * @param {string[]} [orders] The sort orders of `iteratees`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.reduce`. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 34 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 36 } + * ]; + * + * // Sort by `user` in ascending order and by `age` in descending order. + * _.orderBy(users, ['user', 'age'], ['asc', 'desc']); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + function orderBy(collection, iteratees, orders, guard) { + if (collection == null) { + return []; + } + if (!isArray(iteratees)) { + iteratees = iteratees == null ? [] : [iteratees]; + } + orders = guard ? undefined : orders; + if (!isArray(orders)) { + orders = orders == null ? [] : [orders]; + } + return baseOrderBy(collection, iteratees, orders); + } + + /** + * Creates an array of elements split into two groups, the first of which + * contains elements `predicate` returns truthy for, the second of which + * contains elements `predicate` returns falsey for. The predicate is + * invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the array of grouped elements. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true }, + * { 'user': 'pebbles', 'age': 1, 'active': false } + * ]; + * + * _.partition(users, function(o) { return o.active; }); + * // => objects for [['fred'], ['barney', 'pebbles']] + * + * // The `_.matches` iteratee shorthand. + * _.partition(users, { 'age': 1, 'active': false }); + * // => objects for [['pebbles'], ['barney', 'fred']] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.partition(users, ['active', false]); + * // => objects for [['barney', 'pebbles'], ['fred']] + * + * // The `_.property` iteratee shorthand. + * _.partition(users, 'active'); + * // => objects for [['fred'], ['barney', 'pebbles']] + */ + var partition = createAggregator(function(result, value, key) { + result[key ? 0 : 1].push(value); + }, function() { return [[], []]; }); + + /** + * Reduces `collection` to a value which is the accumulated result of running + * each element in `collection` thru `iteratee`, where each successive + * invocation is supplied the return value of the previous. If `accumulator` + * is not given, the first element of `collection` is used as the initial + * value. The iteratee is invoked with four arguments: + * (accumulator, value, index|key, collection). + * + * Many lodash methods are guarded to work as iteratees for methods like + * `_.reduce`, `_.reduceRight`, and `_.transform`. + * + * The guarded methods are: + * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `orderBy`, + * and `sortBy` + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.reduce([1, 2], function(sum, n) { + * return sum + n; + * }, 0); + * // => 3 + * + * _.reduce({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * return result; + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } (iteration order is not guaranteed) + */ + function reduce(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduce : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEach); + } + + /** + * This method is like `_.reduce` except that it iterates over elements of + * `collection` from right to left. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @returns {*} Returns the accumulated value. + * @example + * + * var array = [[0, 1], [2, 3], [4, 5]]; + * + * _.reduceRight(array, function(flattened, other) { + * return flattened.concat(other); + * }, []); + * // => [4, 5, 2, 3, 0, 1] + */ + function reduceRight(collection, iteratee, accumulator) { + var func = isArray(collection) ? arrayReduceRight : baseReduce, + initAccum = arguments.length < 3; + + return func(collection, getIteratee(iteratee, 4), accumulator, initAccum, baseEachRight); + } + + /** + * The opposite of `_.filter`; this method returns the elements of `collection` + * that `predicate` does **not** return truthy for. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {Array} Returns the new filtered array. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': false }, + * { 'user': 'fred', 'age': 40, 'active': true } + * ]; + * + * _.reject(users, function(o) { return !o.active; }); + * // => objects for ['fred'] + * + * // The `_.matches` iteratee shorthand. + * _.reject(users, { 'age': 40, 'active': true }); + * // => objects for ['barney'] + * + * // The `_.matchesProperty` iteratee shorthand. + * _.reject(users, ['active', false]); + * // => objects for ['fred'] + * + * // The `_.property` iteratee shorthand. + * _.reject(users, 'active'); + * // => objects for ['barney'] + */ + function reject(collection, predicate) { + var func = isArray(collection) ? arrayFilter : baseFilter; + predicate = getIteratee(predicate, 3); + return func(collection, function(value, index, collection) { + return !predicate(value, index, collection); + }); + } + + /** + * Gets a random element from `collection`. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @returns {*} Returns the random element. + * @example + * + * _.sample([1, 2, 3, 4]); + * // => 2 + */ + function sample(collection) { + var array = isArrayLike(collection) ? collection : values(collection), + length = array.length; + + return length > 0 ? array[baseRandom(0, length - 1)] : undefined; + } + + /** + * Gets `n` random elements at unique keys from `collection` up to the + * size of `collection`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to sample. + * @param {number} [n=1] The number of elements to sample. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Array} Returns the random elements. + * @example + * + * _.sampleSize([1, 2, 3], 2); + * // => [3, 1] + * + * _.sampleSize([1, 2, 3], 4); + * // => [2, 3, 1] + */ + function sampleSize(collection, n, guard) { + var index = -1, + result = toArray(collection), + length = result.length, + lastIndex = length - 1; + + if ((guard ? isIterateeCall(collection, n, guard) : n === undefined)) { + n = 1; + } else { + n = baseClamp(toInteger(n), 0, length); + } + while (++index < n) { + var rand = baseRandom(index, lastIndex), + value = result[rand]; + + result[rand] = result[index]; + result[index] = value; + } + result.length = n; + return result; + } + + /** + * Creates an array of shuffled values, using a version of the + * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to shuffle. + * @returns {Array} Returns the new shuffled array. + * @example + * + * _.shuffle([1, 2, 3, 4]); + * // => [4, 1, 3, 2] + */ + function shuffle(collection) { + return sampleSize(collection, MAX_ARRAY_LENGTH); + } + + /** + * Gets the size of `collection` by returning its length for array-like + * values or the number of own enumerable string keyed properties for objects. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @returns {number} Returns the collection size. + * @example + * + * _.size([1, 2, 3]); + * // => 3 + * + * _.size({ 'a': 1, 'b': 2 }); + * // => 2 + * + * _.size('pebbles'); + * // => 7 + */ + function size(collection) { + if (collection == null) { + return 0; + } + if (isArrayLike(collection)) { + var result = collection.length; + return (result && isString(collection)) ? stringSize(collection) : result; + } + if (isObjectLike(collection)) { + var tag = getTag(collection); + if (tag == mapTag || tag == setTag) { + return collection.size; + } + } + return keys(collection).length; + } + + /** + * Checks if `predicate` returns truthy for **any** element of `collection`. + * Iteration is stopped once `predicate` returns truthy. The predicate is + * invoked with three arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {boolean} Returns `true` if any element passes the predicate check, + * else `false`. + * @example + * + * _.some([null, 0, 'yes', false], Boolean); + * // => true + * + * var users = [ + * { 'user': 'barney', 'active': true }, + * { 'user': 'fred', 'active': false } + * ]; + * + * // The `_.matches` iteratee shorthand. + * _.some(users, { 'user': 'barney', 'active': false }); + * // => false + * + * // The `_.matchesProperty` iteratee shorthand. + * _.some(users, ['active', false]); + * // => true + * + * // The `_.property` iteratee shorthand. + * _.some(users, 'active'); + * // => true + */ + function some(collection, predicate, guard) { + var func = isArray(collection) ? arraySome : baseSome; + if (guard && isIterateeCall(collection, predicate, guard)) { + predicate = undefined; + } + return func(collection, getIteratee(predicate, 3)); + } + + /** + * Creates an array of elements, sorted in ascending order by the results of + * running each element in a collection thru each iteratee. This method + * performs a stable sort, that is, it preserves the original sort order of + * equal elements. The iteratees are invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {...(Array|Array[]|Function|Function[]|Object|Object[]|string|string[])} + * [iteratees=[_.identity]] The iteratees to sort by, specified individually + * or in arrays. + * @returns {Array} Returns the new sorted array. + * @example + * + * var users = [ + * { 'user': 'fred', 'age': 48 }, + * { 'user': 'barney', 'age': 36 }, + * { 'user': 'fred', 'age': 40 }, + * { 'user': 'barney', 'age': 34 } + * ]; + * + * _.sortBy(users, function(o) { return o.user; }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + * + * _.sortBy(users, ['user', 'age']); + * // => objects for [['barney', 34], ['barney', 36], ['fred', 40], ['fred', 48]] + * + * _.sortBy(users, 'user', function(o) { + * return Math.floor(o.age / 10); + * }); + * // => objects for [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 40]] + */ + var sortBy = rest(function(collection, iteratees) { + if (collection == null) { + return []; + } + var length = iteratees.length; + if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { + iteratees = []; + } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { + iteratees.length = 1; + } + return baseOrderBy(collection, baseFlatten(iteratees, 1), []); + }); + + /*------------------------------------------------------------------------*/ + + /** + * Gets the timestamp of the number of milliseconds that have elapsed since + * the Unix epoch (1 January 1970 00:00:00 UTC). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @type {Function} + * @category Date + * @returns {number} Returns the timestamp. + * @example + * + * _.defer(function(stamp) { + * console.log(_.now() - stamp); + * }, _.now()); + * // => Logs the number of milliseconds it took for the deferred function to be invoked. + */ + var now = Date.now; + + /*------------------------------------------------------------------------*/ + + /** + * The opposite of `_.before`; this method creates a function that invokes + * `func` once it's called `n` or more times. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {number} n The number of calls before `func` is invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var saves = ['profile', 'settings']; + * + * var done = _.after(saves.length, function() { + * console.log('done saving!'); + * }); + * + * _.forEach(saves, function(type) { + * asyncSave({ 'type': type, 'complete': done }); + * }); + * // => Logs 'done saving!' after the two async saves have completed. + */ + function after(n, func) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n < 1) { + return func.apply(this, arguments); + } + }; + } + + /** + * Creates a function that invokes `func`, with up to `n` arguments, + * ignoring any additional arguments. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @param {number} [n=func.length] The arity cap. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.ary(parseInt, 1)); + * // => [6, 8, 10] + */ + function ary(func, n, guard) { + n = guard ? undefined : n; + n = (func && n == null) ? func.length : n; + return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n); + } + + /** + * Creates a function that invokes `func`, with the `this` binding and arguments + * of the created function, while it's called less than `n` times. Subsequent + * calls to the created function return the result of the last `func` invocation. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {number} n The number of calls at which `func` is no longer invoked. + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * jQuery(element).on('click', _.before(5, addContactToList)); + * // => allows adding up to 4 contacts to the list + */ + function before(n, func) { + var result; + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + n = toInteger(n); + return function() { + if (--n > 0) { + result = func.apply(this, arguments); + } + if (n <= 1) { + func = undefined; + } + return result; + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of `thisArg` + * and `partials` prepended to the arguments it receives. + * + * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for partially applied arguments. + * + * **Note:** Unlike native `Function#bind` this method doesn't set the "length" + * property of bound functions. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to bind. + * @param {*} thisArg The `this` binding of `func`. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var greet = function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * }; + * + * var object = { 'user': 'fred' }; + * + * var bound = _.bind(greet, object, 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * // Bound with placeholders. + * var bound = _.bind(greet, object, _, '!'); + * bound('hi'); + * // => 'hi fred!' + */ + var bind = rest(function(func, thisArg, partials) { + var bitmask = BIND_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getPlaceholder(bind)); + bitmask |= PARTIAL_FLAG; + } + return createWrapper(func, bitmask, thisArg, partials, holders); + }); + + /** + * Creates a function that invokes the method at `object[key]` with `partials` + * prepended to the arguments it receives. + * + * This method differs from `_.bind` by allowing bound functions to reference + * methods that may be redefined or don't yet exist. See + * [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern) + * for more details. + * + * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Function + * @param {Object} object The object to invoke the method on. + * @param {string} key The key of the method. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new bound function. + * @example + * + * var object = { + * 'user': 'fred', + * 'greet': function(greeting, punctuation) { + * return greeting + ' ' + this.user + punctuation; + * } + * }; + * + * var bound = _.bindKey(object, 'greet', 'hi'); + * bound('!'); + * // => 'hi fred!' + * + * object.greet = function(greeting, punctuation) { + * return greeting + 'ya ' + this.user + punctuation; + * }; + * + * bound('!'); + * // => 'hiya fred!' + * + * // Bound with placeholders. + * var bound = _.bindKey(object, 'greet', _, '!'); + * bound('hi'); + * // => 'hiya fred!' + */ + var bindKey = rest(function(object, key, partials) { + var bitmask = BIND_FLAG | BIND_KEY_FLAG; + if (partials.length) { + var holders = replaceHolders(partials, getPlaceholder(bindKey)); + bitmask |= PARTIAL_FLAG; + } + return createWrapper(key, bitmask, object, partials, holders); + }); + + /** + * Creates a function that accepts arguments of `func` and either invokes + * `func` returning its result, if at least `arity` number of arguments have + * been provided, or returns a function that accepts the remaining `func` + * arguments, and so on. The arity of `func` may be specified if `func.length` + * is not sufficient. + * + * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds, + * may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curry(abc); + * + * curried(1)(2)(3); + * // => [1, 2, 3] + * + * curried(1, 2)(3); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(1)(_, 3)(2); + * // => [1, 2, 3] + */ + function curry(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrapper(func, CURRY_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curry.placeholder; + return result; + } + + /** + * This method is like `_.curry` except that arguments are applied to `func` + * in the manner of `_.partialRight` instead of `_.partial`. + * + * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for provided arguments. + * + * **Note:** This method doesn't set the "length" property of curried functions. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to curry. + * @param {number} [arity=func.length] The arity of `func`. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the new curried function. + * @example + * + * var abc = function(a, b, c) { + * return [a, b, c]; + * }; + * + * var curried = _.curryRight(abc); + * + * curried(3)(2)(1); + * // => [1, 2, 3] + * + * curried(2, 3)(1); + * // => [1, 2, 3] + * + * curried(1, 2, 3); + * // => [1, 2, 3] + * + * // Curried with placeholders. + * curried(3)(1, _)(2); + * // => [1, 2, 3] + */ + function curryRight(func, arity, guard) { + arity = guard ? undefined : arity; + var result = createWrapper(func, CURRY_RIGHT_FLAG, undefined, undefined, undefined, undefined, undefined, arity); + result.placeholder = curryRight.placeholder; + return result; + } + + /** + * Creates a debounced function that delays invoking `func` until after `wait` + * milliseconds have elapsed since the last time the debounced function was + * invoked. The debounced function comes with a `cancel` method to cancel + * delayed `func` invocations and a `flush` method to immediately invoke them. + * Provide an options object to indicate whether `func` should be invoked on + * the leading and/or trailing edge of the `wait` timeout. The `func` is invoked + * with the last arguments provided to the debounced function. Subsequent calls + * to the debounced function return the result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked + * on the trailing edge of the timeout only if the debounced function is + * invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.debounce` and `_.throttle`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to debounce. + * @param {number} [wait=0] The number of milliseconds to delay. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=false] + * Specify invoking on the leading edge of the timeout. + * @param {number} [options.maxWait] + * The maximum time `func` is allowed to be delayed before it's invoked. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new debounced function. + * @example + * + * // Avoid costly calculations while the window size is in flux. + * jQuery(window).on('resize', _.debounce(calculateLayout, 150)); + * + * // Invoke `sendMail` when clicked, debouncing subsequent calls. + * jQuery(element).on('click', _.debounce(sendMail, 300, { + * 'leading': true, + * 'trailing': false + * })); + * + * // Ensure `batchLog` is invoked once after 1 second of debounced calls. + * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 }); + * var source = new EventSource('/stream'); + * jQuery(source).on('message', debounced); + * + * // Cancel the trailing debounced invocation. + * jQuery(window).on('popstate', debounced.cancel); + */ + function debounce(func, wait, options) { + var lastArgs, + lastThis, + result, + timerId, + lastCallTime = 0, + lastInvokeTime = 0, + leading = false, + maxWait = false, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + wait = toNumber(wait) || 0; + if (isObject(options)) { + leading = !!options.leading; + maxWait = 'maxWait' in options && nativeMax(toNumber(options.maxWait) || 0, wait); + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + + function invokeFunc(time) { + var args = lastArgs, + thisArg = lastThis; + + lastArgs = lastThis = undefined; + lastInvokeTime = time; + result = func.apply(thisArg, args); + return result; + } + + function leadingEdge(time) { + // Reset any `maxWait` timer. + lastInvokeTime = time; + // Start the timer for the trailing edge. + timerId = setTimeout(timerExpired, wait); + // Invoke the leading edge. + return leading ? invokeFunc(time) : result; + } + + function remainingWait(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime, + result = wait - timeSinceLastCall; + + return maxWait === false ? result : nativeMin(result, maxWait - timeSinceLastInvoke); + } + + function shouldInvoke(time) { + var timeSinceLastCall = time - lastCallTime, + timeSinceLastInvoke = time - lastInvokeTime; + + // Either this is the first call, activity has stopped and we're at the + // trailing edge, the system time has gone backwards and we're treating + // it as the trailing edge, or we've hit the `maxWait` limit. + return (!lastCallTime || (timeSinceLastCall >= wait) || + (timeSinceLastCall < 0) || (maxWait !== false && timeSinceLastInvoke >= maxWait)); + } + + function timerExpired() { + var time = now(); + if (shouldInvoke(time)) { + return trailingEdge(time); + } + // Restart the timer. + timerId = setTimeout(timerExpired, remainingWait(time)); + } + + function trailingEdge(time) { + clearTimeout(timerId); + timerId = undefined; + + // Only invoke if we have `lastArgs` which means `func` has been + // debounced at least once. + if (trailing && lastArgs) { + return invokeFunc(time); + } + lastArgs = lastThis = undefined; + return result; + } + + function cancel() { + if (timerId !== undefined) { + clearTimeout(timerId); + } + lastCallTime = lastInvokeTime = 0; + lastArgs = lastThis = timerId = undefined; + } + + function flush() { + return timerId === undefined ? result : trailingEdge(now()); + } + + function debounced() { + var time = now(), + isInvoking = shouldInvoke(time); + + lastArgs = arguments; + lastThis = this; + lastCallTime = time; + + if (isInvoking) { + if (timerId === undefined) { + return leadingEdge(lastCallTime); + } + // Handle invocations in a tight loop. + clearTimeout(timerId); + timerId = setTimeout(timerExpired, wait); + return invokeFunc(lastCallTime); + } + return result; + } + debounced.cancel = cancel; + debounced.flush = flush; + return debounced; + } + + /** + * Defers invoking the `func` until the current call stack has cleared. Any + * additional arguments are provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to defer. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.defer(function(text) { + * console.log(text); + * }, 'deferred'); + * // => Logs 'deferred' after one or more milliseconds. + */ + var defer = rest(function(func, args) { + return baseDelay(func, 1, args); + }); + + /** + * Invokes `func` after `wait` milliseconds. Any additional arguments are + * provided to `func` when it's invoked. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to delay. + * @param {number} wait The number of milliseconds to delay invocation. + * @param {...*} [args] The arguments to invoke `func` with. + * @returns {number} Returns the timer id. + * @example + * + * _.delay(function(text) { + * console.log(text); + * }, 1000, 'later'); + * // => Logs 'later' after one second. + */ + var delay = rest(function(func, wait, args) { + return baseDelay(func, toNumber(wait) || 0, args); + }); + + /** + * Creates a function that invokes `func` with arguments reversed. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to flip arguments for. + * @returns {Function} Returns the new function. + * @example + * + * var flipped = _.flip(function() { + * return _.toArray(arguments); + * }); + * + * flipped('a', 'b', 'c', 'd'); + * // => ['d', 'c', 'b', 'a'] + */ + function flip(func) { + return createWrapper(func, FLIP_FLAG); + } + + /** + * Creates a function that memoizes the result of `func`. If `resolver` is + * provided, it determines the cache key for storing the result based on the + * arguments provided to the memoized function. By default, the first argument + * provided to the memoized function is used as the map cache key. The `func` + * is invoked with the `this` binding of the memoized function. + * + * **Note:** The cache is exposed as the `cache` property on the memoized + * function. Its creation may be customized by replacing the `_.memoize.Cache` + * constructor with one whose instances implement the + * [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object) + * method interface of `delete`, `get`, `has`, and `set`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to have its output memoized. + * @param {Function} [resolver] The function to resolve the cache key. + * @returns {Function} Returns the new memoizing function. + * @example + * + * var object = { 'a': 1, 'b': 2 }; + * var other = { 'c': 3, 'd': 4 }; + * + * var values = _.memoize(_.values); + * values(object); + * // => [1, 2] + * + * values(other); + * // => [3, 4] + * + * object.a = 2; + * values(object); + * // => [1, 2] + * + * // Modify the result cache. + * values.cache.set(object, ['a', 'b']); + * values(object); + * // => ['a', 'b'] + * + * // Replace `_.memoize.Cache`. + * _.memoize.Cache = WeakMap; + */ + function memoize(func, resolver) { + if (typeof func != 'function' || (resolver && typeof resolver != 'function')) { + throw new TypeError(FUNC_ERROR_TEXT); + } + var memoized = function() { + var args = arguments, + key = resolver ? resolver.apply(this, args) : args[0], + cache = memoized.cache; + + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache); + return memoized; + } + + // Assign cache to `_.memoize`. + memoize.Cache = MapCache; + + /** + * Creates a function that negates the result of the predicate `func`. The + * `func` predicate is invoked with the `this` binding and arguments of the + * created function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} predicate The predicate to negate. + * @returns {Function} Returns the new function. + * @example + * + * function isEven(n) { + * return n % 2 == 0; + * } + * + * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven)); + * // => [1, 3, 5] + */ + function negate(predicate) { + if (typeof predicate != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + return function() { + return !predicate.apply(this, arguments); + }; + } + + /** + * Creates a function that is restricted to invoking `func` once. Repeat calls + * to the function return the value of the first invocation. The `func` is + * invoked with the `this` binding and arguments of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to restrict. + * @returns {Function} Returns the new restricted function. + * @example + * + * var initialize = _.once(createApplication); + * initialize(); + * initialize(); + * // `initialize` invokes `createApplication` once + */ + function once(func) { + return before(2, func); + } + + /** + * Creates a function that invokes `func` with arguments transformed by + * corresponding `transforms`. + * + * @static + * @since 4.0.0 + * @memberOf _ + * @category Function + * @param {Function} func The function to wrap. + * @param {...(Function|Function[])} [transforms] The functions to transform. + * arguments, specified individually or in arrays. + * @returns {Function} Returns the new function. + * @example + * + * function doubled(n) { + * return n * 2; + * } + * + * function square(n) { + * return n * n; + * } + * + * var func = _.overArgs(function(x, y) { + * return [x, y]; + * }, square, doubled); + * + * func(9, 3); + * // => [81, 6] + * + * func(10, 5); + * // => [100, 10] + */ + var overArgs = rest(function(func, transforms) { + transforms = arrayMap(baseFlatten(transforms, 1, isFlattenableIteratee), getIteratee()); + var funcsLength = transforms.length; + return rest(function(args) { + var index = -1, + length = nativeMin(args.length, funcsLength); + + while (++index < length) { + args[index] = transforms[index].call(this, args[index]); + } + return apply(func, this, args); + }); + }); + + /** + * Creates a function that invokes `func` with `partials` prepended to the + * arguments it receives. This method is like `_.bind` except it does **not** + * alter the `this` binding. + * + * The `_.partial.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 0.2.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { + * return greeting + ' ' + name; + * }; + * + * var sayHelloTo = _.partial(greet, 'hello'); + * sayHelloTo('fred'); + * // => 'hello fred' + * + * // Partially applied with placeholders. + * var greetFred = _.partial(greet, _, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + */ + var partial = rest(function(func, partials) { + var holders = replaceHolders(partials, getPlaceholder(partial)); + return createWrapper(func, PARTIAL_FLAG, undefined, partials, holders); + }); + + /** + * This method is like `_.partial` except that partially applied arguments + * are appended to the arguments it receives. + * + * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic + * builds, may be used as a placeholder for partially applied arguments. + * + * **Note:** This method doesn't set the "length" property of partially + * applied functions. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Function + * @param {Function} func The function to partially apply arguments to. + * @param {...*} [partials] The arguments to be partially applied. + * @returns {Function} Returns the new partially applied function. + * @example + * + * var greet = function(greeting, name) { + * return greeting + ' ' + name; + * }; + * + * var greetFred = _.partialRight(greet, 'fred'); + * greetFred('hi'); + * // => 'hi fred' + * + * // Partially applied with placeholders. + * var sayHelloTo = _.partialRight(greet, 'hello', _); + * sayHelloTo('fred'); + * // => 'hello fred' + */ + var partialRight = rest(function(func, partials) { + var holders = replaceHolders(partials, getPlaceholder(partialRight)); + return createWrapper(func, PARTIAL_RIGHT_FLAG, undefined, partials, holders); + }); + + /** + * Creates a function that invokes `func` with arguments arranged according + * to the specified `indexes` where the argument value at the first index is + * provided as the first argument, the argument value at the second index is + * provided as the second argument, and so on. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Function + * @param {Function} func The function to rearrange arguments for. + * @param {...(number|number[])} indexes The arranged argument indexes, + * specified individually or in arrays. + * @returns {Function} Returns the new function. + * @example + * + * var rearged = _.rearg(function(a, b, c) { + * return [a, b, c]; + * }, 2, 0, 1); + * + * rearged('b', 'c', 'a') + * // => ['a', 'b', 'c'] + */ + var rearg = rest(function(func, indexes) { + return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes, 1)); + }); + + /** + * Creates a function that invokes `func` with the `this` binding of the + * created function and arguments from `start` and beyond provided as + * an array. + * + * **Note:** This method is based on the + * [rest parameter](https://mdn.io/rest_parameters). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.rest(function(what, names) { + * return what + ' ' + _.initial(names).join(', ') + + * (_.size(names) > 1 ? ', & ' : '') + _.last(names); + * }); + * + * say('hello', 'fred', 'barney', 'pebbles'); + * // => 'hello fred, barney, & pebbles' + */ + function rest(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + switch (start) { + case 0: return func.call(this, array); + case 1: return func.call(this, args[0], array); + case 2: return func.call(this, args[0], args[1], array); + } + var otherArgs = Array(start + 1); + index = -1; + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); + }; + } + + /** + * Creates a function that invokes `func` with the `this` binding of the + * create function and an array of arguments much like + * [`Function#apply`](http://www.ecma-international.org/ecma-262/6.0/#sec-function.prototype.apply). + * + * **Note:** This method is based on the + * [spread operator](https://mdn.io/spread_operator). + * + * @static + * @memberOf _ + * @since 3.2.0 + * @category Function + * @param {Function} func The function to spread arguments over. + * @param {number} [start=0] The start position of the spread. + * @returns {Function} Returns the new function. + * @example + * + * var say = _.spread(function(who, what) { + * return who + ' says ' + what; + * }); + * + * say(['fred', 'hello']); + * // => 'fred says hello' + * + * var numbers = Promise.all([ + * Promise.resolve(40), + * Promise.resolve(36) + * ]); + * + * numbers.then(_.spread(function(x, y) { + * return x + y; + * })); + * // => a Promise of 76 + */ + function spread(func, start) { + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + start = start === undefined ? 0 : nativeMax(toInteger(start), 0); + return rest(function(args) { + var array = args[start], + otherArgs = args.slice(0, start); + + if (array) { + arrayPush(otherArgs, array); + } + return apply(func, this, otherArgs); + }); + } + + /** + * Creates a throttled function that only invokes `func` at most once per + * every `wait` milliseconds. The throttled function comes with a `cancel` + * method to cancel delayed `func` invocations and a `flush` method to + * immediately invoke them. Provide an options object to indicate whether + * `func` should be invoked on the leading and/or trailing edge of the `wait` + * timeout. The `func` is invoked with the last arguments provided to the + * throttled function. Subsequent calls to the throttled function return the + * result of the last `func` invocation. + * + * **Note:** If `leading` and `trailing` options are `true`, `func` is + * invoked on the trailing edge of the timeout only if the throttled function + * is invoked more than once during the `wait` timeout. + * + * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/) + * for details over the differences between `_.throttle` and `_.debounce`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {Function} func The function to throttle. + * @param {number} [wait=0] The number of milliseconds to throttle invocations to. + * @param {Object} [options={}] The options object. + * @param {boolean} [options.leading=true] + * Specify invoking on the leading edge of the timeout. + * @param {boolean} [options.trailing=true] + * Specify invoking on the trailing edge of the timeout. + * @returns {Function} Returns the new throttled function. + * @example + * + * // Avoid excessively updating the position while scrolling. + * jQuery(window).on('scroll', _.throttle(updatePosition, 100)); + * + * // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes. + * var throttled = _.throttle(renewToken, 300000, { 'trailing': false }); + * jQuery(element).on('click', throttled); + * + * // Cancel the trailing throttled invocation. + * jQuery(window).on('popstate', throttled.cancel); + */ + function throttle(func, wait, options) { + var leading = true, + trailing = true; + + if (typeof func != 'function') { + throw new TypeError(FUNC_ERROR_TEXT); + } + if (isObject(options)) { + leading = 'leading' in options ? !!options.leading : leading; + trailing = 'trailing' in options ? !!options.trailing : trailing; + } + return debounce(func, wait, { + 'leading': leading, + 'maxWait': wait, + 'trailing': trailing + }); + } + + /** + * Creates a function that accepts up to one argument, ignoring any + * additional arguments. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Function + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new function. + * @example + * + * _.map(['6', '8', '10'], _.unary(parseInt)); + * // => [6, 8, 10] + */ + function unary(func) { + return ary(func, 1); + } + + /** + * Creates a function that provides `value` to the wrapper function as its + * first argument. Any additional arguments provided to the function are + * appended to those provided to the wrapper function. The wrapper is invoked + * with the `this` binding of the created function. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Function + * @param {*} value The value to wrap. + * @param {Function} [wrapper=identity] The wrapper function. + * @returns {Function} Returns the new function. + * @example + * + * var p = _.wrap(_.escape, function(func, text) { + * return '

' + func(text) + '

'; + * }); + * + * p('fred, barney, & pebbles'); + * // => '

fred, barney, & pebbles

' + */ + function wrap(value, wrapper) { + wrapper = wrapper == null ? identity : wrapper; + return partial(wrapper, value); + } + + /*------------------------------------------------------------------------*/ + + /** + * Casts `value` as an array if it's not one. + * + * @static + * @memberOf _ + * @since 4.4.0 + * @category Lang + * @param {*} value The value to inspect. + * @returns {Array} Returns the cast array. + * @example + * + * _.castArray(1); + * // => [1] + * + * _.castArray({ 'a': 1 }); + * // => [{ 'a': 1 }] + * + * _.castArray('abc'); + * // => ['abc'] + * + * _.castArray(null); + * // => [null] + * + * _.castArray(undefined); + * // => [undefined] + * + * _.castArray(); + * // => [] + * + * var array = [1, 2, 3]; + * console.log(_.castArray(array) === array); + * // => true + */ + function castArray() { + if (!arguments.length) { + return []; + } + var value = arguments[0]; + return isArray(value) ? value : [value]; + } + + /** + * Creates a shallow clone of `value`. + * + * **Note:** This method is loosely based on the + * [structured clone algorithm](https://mdn.io/Structured_clone_algorithm) + * and supports cloning arrays, array buffers, booleans, date objects, maps, + * numbers, `Object` objects, regexes, sets, strings, symbols, and typed + * arrays. The own enumerable properties of `arguments` objects are cloned + * as plain objects. An empty object is returned for uncloneable values such + * as error objects, functions, DOM nodes, and WeakMaps. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to clone. + * @returns {*} Returns the cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var shallow = _.clone(objects); + * console.log(shallow[0] === objects[0]); + * // => true + */ + function clone(value) { + return baseClone(value, false, true); + } + + /** + * This method is like `_.clone` except that it accepts `customizer` which + * is invoked to produce the cloned value. If `customizer` returns `undefined`, + * cloning is handled by the method instead. The `customizer` is invoked with + * up to four arguments; (value [, index|key, object, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the cloned value. + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(false); + * } + * } + * + * var el = _.cloneWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 0 + */ + function cloneWith(value, customizer) { + return baseClone(value, false, true, customizer); + } + + /** + * This method is like `_.clone` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @returns {*} Returns the deep cloned value. + * @example + * + * var objects = [{ 'a': 1 }, { 'b': 2 }]; + * + * var deep = _.cloneDeep(objects); + * console.log(deep[0] === objects[0]); + * // => false + */ + function cloneDeep(value) { + return baseClone(value, true, true); + } + + /** + * This method is like `_.cloneWith` except that it recursively clones `value`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to recursively clone. + * @param {Function} [customizer] The function to customize cloning. + * @returns {*} Returns the deep cloned value. + * @example + * + * function customizer(value) { + * if (_.isElement(value)) { + * return value.cloneNode(true); + * } + * } + * + * var el = _.cloneDeepWith(document.body, customizer); + * + * console.log(el === document.body); + * // => false + * console.log(el.nodeName); + * // => 'BODY' + * console.log(el.childNodes.length); + * // => 20 + */ + function cloneDeepWith(value, customizer) { + return baseClone(value, true, true, customizer); + } + + /** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ + function eq(value, other) { + return value === other || (value !== value && other !== other); + } + + /** + * Checks if `value` is greater than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than `other`, + * else `false`. + * @example + * + * _.gt(3, 1); + * // => true + * + * _.gt(3, 3); + * // => false + * + * _.gt(1, 3); + * // => false + */ + function gt(value, other) { + return value > other; + } + + /** + * Checks if `value` is greater than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is greater than or equal to + * `other`, else `false`. + * @example + * + * _.gte(3, 1); + * // => true + * + * _.gte(3, 3); + * // => true + * + * _.gte(1, 3); + * // => false + */ + function gte(value, other) { + return value >= other; + } + + /** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ + function isArguments(value) { + // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); + } + + /** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @type {Function} + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ + var isArray = Array.isArray; + + /** + * Checks if `value` is classified as an `ArrayBuffer` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isArrayBuffer(new ArrayBuffer(2)); + * // => true + * + * _.isArrayBuffer(new Array(2)); + * // => false + */ + function isArrayBuffer(value) { + return isObjectLike(value) && objectToString.call(value) == arrayBufferTag; + } + + /** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ + function isArrayLike(value) { + return value != null && isLength(getLength(value)) && !isFunction(value); + } + + /** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + + /** + * Checks if `value` is classified as a boolean primitive or object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isBoolean(false); + * // => true + * + * _.isBoolean(null); + * // => false + */ + function isBoolean(value) { + return value === true || value === false || + (isObjectLike(value) && objectToString.call(value) == boolTag); + } + + /** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ + var isBuffer = !Buffer ? constant(false) : function(value) { + return value instanceof Buffer; + }; + + /** + * Checks if `value` is classified as a `Date` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isDate(new Date); + * // => true + * + * _.isDate('Mon April 23 2012'); + * // => false + */ + function isDate(value) { + return isObjectLike(value) && objectToString.call(value) == dateTag; + } + + /** + * Checks if `value` is likely a DOM element. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a DOM element, + * else `false`. + * @example + * + * _.isElement(document.body); + * // => true + * + * _.isElement(''); + * // => false + */ + function isElement(value) { + return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value); + } + + /** + * Checks if `value` is an empty object, collection, map, or set. + * + * Objects are considered empty if they have no own enumerable string keyed + * properties. + * + * Array-like values such as `arguments` objects, arrays, buffers, strings, or + * jQuery-like collections are considered empty if they have a `length` of `0`. + * Similarly, maps and sets are considered empty if they have a `size` of `0`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is empty, else `false`. + * @example + * + * _.isEmpty(null); + * // => true + * + * _.isEmpty(true); + * // => true + * + * _.isEmpty(1); + * // => true + * + * _.isEmpty([1, 2, 3]); + * // => false + * + * _.isEmpty({ 'a': 1 }); + * // => false + */ + function isEmpty(value) { + if (isArrayLike(value) && + (isArray(value) || isString(value) || isFunction(value.splice) || + isArguments(value) || isBuffer(value))) { + return !value.length; + } + if (isObjectLike(value)) { + var tag = getTag(value); + if (tag == mapTag || tag == setTag) { + return !value.size; + } + } + for (var key in value) { + if (hasOwnProperty.call(value, key)) { + return false; + } + } + return !(nonEnumShadows && keys(value).length); + } + + /** + * Performs a deep comparison between two values to determine if they are + * equivalent. + * + * **Note:** This method supports comparing arrays, array buffers, booleans, + * date objects, error objects, maps, numbers, `Object` objects, regexes, + * sets, strings, symbols, and typed arrays. `Object` objects are compared + * by their own, not inherited, enumerable properties. Functions and DOM + * nodes are **not** supported. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. + * @example + * + * var object = { 'user': 'fred' }; + * var other = { 'user': 'fred' }; + * + * _.isEqual(object, other); + * // => true + * + * object === other; + * // => false + */ + function isEqual(value, other) { + return baseIsEqual(value, other); + } + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, + * else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, customizer) : !!result; + } + + /** + * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`, + * `SyntaxError`, `TypeError`, or `URIError` object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an error object, + * else `false`. + * @example + * + * _.isError(new Error); + * // => true + * + * _.isError(Error); + * // => false + */ + function isError(value) { + if (!isObjectLike(value)) { + return false; + } + return (objectToString.call(value) == errorTag) || + (typeof value.message == 'string' && typeof value.name == 'string'); + } + + /** + * Checks if `value` is a finite primitive number. + * + * **Note:** This method is based on + * [`Number.isFinite`](https://mdn.io/Number/isFinite). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a finite number, + * else `false`. + * @example + * + * _.isFinite(3); + * // => true + * + * _.isFinite(Number.MAX_VALUE); + * // => true + * + * _.isFinite(3.14); + * // => true + * + * _.isFinite(Infinity); + * // => false + */ + function isFinite(value) { + return typeof value == 'number' && nativeIsFinite(value); + } + + /** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ + function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8 which returns 'object' for typed array and weak map constructors, + // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; + } + + /** + * Checks if `value` is an integer. + * + * **Note:** This method is based on + * [`Number.isInteger`](https://mdn.io/Number/isInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an integer, else `false`. + * @example + * + * _.isInteger(3); + * // => true + * + * _.isInteger(Number.MIN_VALUE); + * // => false + * + * _.isInteger(Infinity); + * // => false + * + * _.isInteger('3'); + * // => false + */ + function isInteger(value) { + return typeof value == 'number' && value == toInteger(value); + } + + /** + * Checks if `value` is a valid array-like length. + * + * **Note:** This function is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, + * else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ + function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ + function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); + } + + /** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ + function isObjectLike(value) { + return !!value && typeof value == 'object'; + } + + /** + * Checks if `value` is classified as a `Map` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isMap(new Map); + * // => true + * + * _.isMap(new WeakMap); + * // => false + */ + function isMap(value) { + return isObjectLike(value) && getTag(value) == mapTag; + } + + /** + * Performs a partial deep comparison between `object` and `source` to + * determine if `object` contains equivalent property values. This method is + * equivalent to a `_.matches` function when `source` is partially applied. + * + * **Note:** This method supports comparing the same values as `_.isEqual`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * var object = { 'user': 'fred', 'age': 40 }; + * + * _.isMatch(object, { 'age': 40 }); + * // => true + * + * _.isMatch(object, { 'age': 36 }); + * // => false + */ + function isMatch(object, source) { + return object === source || baseIsMatch(object, source, getMatchData(source)); + } + + /** + * This method is like `_.isMatch` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with five + * arguments: (objValue, srcValue, index|key, object, source). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {Object} object The object to inspect. + * @param {Object} source The object of property values to match. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if `object` is a match, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, srcValue) { + * if (isGreeting(objValue) && isGreeting(srcValue)) { + * return true; + * } + * } + * + * var object = { 'greeting': 'hello' }; + * var source = { 'greeting': 'hi' }; + * + * _.isMatchWith(object, source, customizer); + * // => true + */ + function isMatchWith(object, source, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return baseIsMatch(object, source, getMatchData(source), customizer); + } + + /** + * Checks if `value` is `NaN`. + * + * **Note:** This method is based on + * [`Number.isNaN`](https://mdn.io/Number/isNaN) and is not the same as + * global [`isNaN`](https://mdn.io/isNaN) which returns `true` for + * `undefined` and other non-number values. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + * @example + * + * _.isNaN(NaN); + * // => true + * + * _.isNaN(new Number(NaN)); + * // => true + * + * isNaN(undefined); + * // => true + * + * _.isNaN(undefined); + * // => false + */ + function isNaN(value) { + // An `NaN` primitive is the only value that is not equal to itself. + // Perform the `toStringTag` check first to avoid errors with some + // ActiveX objects in IE. + return isNumber(value) && value != +value; + } + + /** + * Checks if `value` is a native function. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + * @example + * + * _.isNative(Array.prototype.push); + * // => true + * + * _.isNative(_); + * // => false + */ + function isNative(value) { + if (!isObject(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + + /** + * Checks if `value` is `null`. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `null`, else `false`. + * @example + * + * _.isNull(null); + * // => true + * + * _.isNull(void 0); + * // => false + */ + function isNull(value) { + return value === null; + } + + /** + * Checks if `value` is `null` or `undefined`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is nullish, else `false`. + * @example + * + * _.isNil(null); + * // => true + * + * _.isNil(void 0); + * // => true + * + * _.isNil(NaN); + * // => false + */ + function isNil(value) { + return value == null; + } + + /** + * Checks if `value` is classified as a `Number` primitive or object. + * + * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are + * classified as numbers, use the `_.isFinite` method. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isNumber(3); + * // => true + * + * _.isNumber(Number.MIN_VALUE); + * // => true + * + * _.isNumber(Infinity); + * // => true + * + * _.isNumber('3'); + * // => false + */ + function isNumber(value) { + return typeof value == 'number' || + (isObjectLike(value) && objectToString.call(value) == numberTag); + } + + /** + * Checks if `value` is a plain object, that is, an object created by the + * `Object` constructor or one with a `[[Prototype]]` of `null`. + * + * @static + * @memberOf _ + * @since 0.8.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a plain object, + * else `false`. + * @example + * + * function Foo() { + * this.a = 1; + * } + * + * _.isPlainObject(new Foo); + * // => false + * + * _.isPlainObject([1, 2, 3]); + * // => false + * + * _.isPlainObject({ 'x': 0, 'y': 0 }); + * // => true + * + * _.isPlainObject(Object.create(null)); + * // => true + */ + function isPlainObject(value) { + if (!isObjectLike(value) || + objectToString.call(value) != objectTag || isHostObject(value)) { + return false; + } + var proto = getPrototype(value); + if (proto === null) { + return true; + } + var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor; + return (typeof Ctor == 'function' && + Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString); + } + + /** + * Checks if `value` is classified as a `RegExp` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isRegExp(/abc/); + * // => true + * + * _.isRegExp('/abc/'); + * // => false + */ + function isRegExp(value) { + return isObject(value) && objectToString.call(value) == regexpTag; + } + + /** + * Checks if `value` is a safe integer. An integer is safe if it's an IEEE-754 + * double precision number which isn't the result of a rounded unsafe integer. + * + * **Note:** This method is based on + * [`Number.isSafeInteger`](https://mdn.io/Number/isSafeInteger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a safe integer, + * else `false`. + * @example + * + * _.isSafeInteger(3); + * // => true + * + * _.isSafeInteger(Number.MIN_VALUE); + * // => false + * + * _.isSafeInteger(Infinity); + * // => false + * + * _.isSafeInteger('3'); + * // => false + */ + function isSafeInteger(value) { + return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; + } + + /** + * Checks if `value` is classified as a `Set` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSet(new Set); + * // => true + * + * _.isSet(new WeakSet); + * // => false + */ + function isSet(value) { + return isObjectLike(value) && getTag(value) == setTag; + } + + /** + * Checks if `value` is classified as a `String` primitive or object. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isString('abc'); + * // => true + * + * _.isString(1); + * // => false + */ + function isString(value) { + return typeof value == 'string' || + (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); + } + + /** + * Checks if `value` is classified as a `Symbol` primitive or object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isSymbol(Symbol.iterator); + * // => true + * + * _.isSymbol('abc'); + * // => false + */ + function isSymbol(value) { + return typeof value == 'symbol' || + (isObjectLike(value) && objectToString.call(value) == symbolTag); + } + + /** + * Checks if `value` is classified as a typed array. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isTypedArray(new Uint8Array); + * // => true + * + * _.isTypedArray([]); + * // => false + */ + function isTypedArray(value) { + return isObjectLike(value) && + isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + + /** + * Checks if `value` is `undefined`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`. + * @example + * + * _.isUndefined(void 0); + * // => true + * + * _.isUndefined(null); + * // => false + */ + function isUndefined(value) { + return value === undefined; + } + + /** + * Checks if `value` is classified as a `WeakMap` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isWeakMap(new WeakMap); + * // => true + * + * _.isWeakMap(new Map); + * // => false + */ + function isWeakMap(value) { + return isObjectLike(value) && getTag(value) == weakMapTag; + } + + /** + * Checks if `value` is classified as a `WeakSet` object. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is correctly classified, + * else `false`. + * @example + * + * _.isWeakSet(new WeakSet); + * // => true + * + * _.isWeakSet(new Set); + * // => false + */ + function isWeakSet(value) { + return isObjectLike(value) && objectToString.call(value) == weakSetTag; + } + + /** + * Checks if `value` is less than `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than `other`, + * else `false`. + * @example + * + * _.lt(1, 3); + * // => true + * + * _.lt(3, 3); + * // => false + * + * _.lt(3, 1); + * // => false + */ + function lt(value, other) { + return value < other; + } + + /** + * Checks if `value` is less than or equal to `other`. + * + * @static + * @memberOf _ + * @since 3.9.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if `value` is less than or equal to + * `other`, else `false`. + * @example + * + * _.lte(1, 3); + * // => true + * + * _.lte(3, 3); + * // => true + * + * _.lte(3, 1); + * // => false + */ + function lte(value, other) { + return value <= other; + } + + /** + * Converts `value` to an array. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Lang + * @param {*} value The value to convert. + * @returns {Array} Returns the converted array. + * @example + * + * _.toArray({ 'a': 1, 'b': 2 }); + * // => [1, 2] + * + * _.toArray('abc'); + * // => ['a', 'b', 'c'] + * + * _.toArray(1); + * // => [] + * + * _.toArray(null); + * // => [] + */ + function toArray(value) { + if (!value) { + return []; + } + if (isArrayLike(value)) { + return isString(value) ? stringToArray(value) : copyArray(value); + } + if (iteratorSymbol && value[iteratorSymbol]) { + return iteratorToArray(value[iteratorSymbol]()); + } + var tag = getTag(value), + func = tag == mapTag ? mapToArray : (tag == setTag ? setToArray : values); + + return func(value); + } + + /** + * Converts `value` to an integer. + * + * **Note:** This function is loosely based on + * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toInteger(3); + * // => 3 + * + * _.toInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toInteger(Infinity); + * // => 1.7976931348623157e+308 + * + * _.toInteger('3'); + * // => 3 + */ + function toInteger(value) { + if (!value) { + return value === 0 ? value : 0; + } + value = toNumber(value); + if (value === INFINITY || value === -INFINITY) { + var sign = (value < 0 ? -1 : 1); + return sign * MAX_INTEGER; + } + var remainder = value % 1; + return value === value ? (remainder ? value - remainder : value) : 0; + } + + /** + * Converts `value` to an integer suitable for use as the length of an + * array-like object. + * + * **Note:** This method is based on + * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toLength(3); + * // => 3 + * + * _.toLength(Number.MIN_VALUE); + * // => 0 + * + * _.toLength(Infinity); + * // => 4294967295 + * + * _.toLength('3'); + * // => 3 + */ + function toLength(value) { + return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; + } + + /** + * Converts `value` to a number. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {number} Returns the number. + * @example + * + * _.toNumber(3); + * // => 3 + * + * _.toNumber(Number.MIN_VALUE); + * // => 5e-324 + * + * _.toNumber(Infinity); + * // => Infinity + * + * _.toNumber('3'); + * // => 3 + */ + function toNumber(value) { + if (typeof value == 'number') { + return value; + } + if (isSymbol(value)) { + return NAN; + } + if (isObject(value)) { + var other = isFunction(value.valueOf) ? value.valueOf() : value; + value = isObject(other) ? (other + '') : other; + } + if (typeof value != 'string') { + return value === 0 ? value : +value; + } + value = value.replace(reTrim, ''); + var isBinary = reIsBinary.test(value); + return (isBinary || reIsOctal.test(value)) + ? freeParseInt(value.slice(2), isBinary ? 2 : 8) + : (reIsBadHex.test(value) ? NAN : +value); + } + + /** + * Converts `value` to a plain object flattening inherited enumerable string + * keyed properties of `value` to own properties of the plain object. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {Object} Returns the converted plain object. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.assign({ 'a': 1 }, new Foo); + * // => { 'a': 1, 'b': 2 } + * + * _.assign({ 'a': 1 }, _.toPlainObject(new Foo)); + * // => { 'a': 1, 'b': 2, 'c': 3 } + */ + function toPlainObject(value) { + return copyObject(value, keysIn(value)); + } + + /** + * Converts `value` to a safe integer. A safe integer can be compared and + * represented correctly. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to convert. + * @returns {number} Returns the converted integer. + * @example + * + * _.toSafeInteger(3); + * // => 3 + * + * _.toSafeInteger(Number.MIN_VALUE); + * // => 0 + * + * _.toSafeInteger(Infinity); + * // => 9007199254740991 + * + * _.toSafeInteger('3'); + * // => 3 + */ + function toSafeInteger(value) { + return baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER); + } + + /** + * Converts `value` to a string if it's not one. An empty string is returned + * for `null` and `undefined` values. The sign of `-0` is preserved. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to process. + * @returns {string} Returns the string. + * @example + * + * _.toString(null); + * // => '' + * + * _.toString(-0); + * // => '-0' + * + * _.toString([1, 2, 3]); + * // => '1,2,3' + */ + function toString(value) { + // Exit early for strings to avoid a performance hit in some environments. + if (typeof value == 'string') { + return value; + } + if (value == null) { + return ''; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ''; + } + var result = (value + ''); + return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; + } + + /*------------------------------------------------------------------------*/ + + /** + * Assigns own enumerable string keyed properties of source objects to the + * destination object. Source objects are applied from left to right. + * Subsequent sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object` and is loosely based on + * [`Object.assign`](https://mdn.io/Object/assign). + * + * @static + * @memberOf _ + * @since 0.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.c = 3; + * } + * + * function Bar() { + * this.e = 5; + * } + * + * Foo.prototype.d = 4; + * Bar.prototype.f = 6; + * + * _.assign({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'c': 3, 'e': 5 } + */ + var assign = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keys(source), object); + return; + } + for (var key in source) { + if (hasOwnProperty.call(source, key)) { + assignValue(object, key, source[key]); + } + } + }); + + /** + * This method is like `_.assign` except that it iterates over own and + * inherited source properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extend + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.b = 2; + * } + * + * function Bar() { + * this.d = 4; + * } + * + * Foo.prototype.c = 3; + * Bar.prototype.e = 5; + * + * _.assignIn({ 'a': 1 }, new Foo, new Bar); + * // => { 'a': 1, 'b': 2, 'c': 3, 'd': 4, 'e': 5 } + */ + var assignIn = createAssigner(function(object, source) { + if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) { + copyObject(source, keysIn(source), object); + return; + } + for (var key in source) { + assignValue(object, key, source[key]); + } + }); + + /** + * This method is like `_.assignIn` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias extendWith + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignInWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObjectWith(source, keysIn(source), object, customizer); + }); + + /** + * This method is like `_.assign` except that it accepts `customizer` + * which is invoked to produce the assigned values. If `customizer` returns + * `undefined`, assignment is handled by the method instead. The `customizer` + * is invoked with five arguments: (objValue, srcValue, key, object, source). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * return _.isUndefined(objValue) ? srcValue : objValue; + * } + * + * var defaults = _.partialRight(_.assignWith, customizer); + * + * defaults({ 'a': 1 }, { 'b': 2 }, { 'a': 3 }); + * // => { 'a': 1, 'b': 2 } + */ + var assignWith = createAssigner(function(object, source, srcIndex, customizer) { + copyObjectWith(source, keys(source), object, customizer); + }); + + /** + * Creates an array of values corresponding to `paths` of `object`. + * + * @static + * @memberOf _ + * @since 1.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {...(string|string[])} [paths] The property paths of elements to pick, + * specified individually or in arrays. + * @returns {Array} Returns the new array of picked elements. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }, 4] }; + * + * _.at(object, ['a[0].b.c', 'a[1]']); + * // => [3, 4] + * + * _.at(['a', 'b', 'c'], 0, 2); + * // => ['a', 'c'] + */ + var at = rest(function(object, paths) { + return baseAt(object, baseFlatten(paths, 1)); + }); + + /** + * Creates an object that inherits from the `prototype` object. If a + * `properties` object is given, its own enumerable string keyed properties + * are assigned to the created object. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Object + * @param {Object} prototype The object to inherit from. + * @param {Object} [properties] The properties to assign to the object. + * @returns {Object} Returns the new object. + * @example + * + * function Shape() { + * this.x = 0; + * this.y = 0; + * } + * + * function Circle() { + * Shape.call(this); + * } + * + * Circle.prototype = _.create(Shape.prototype, { + * 'constructor': Circle + * }); + * + * var circle = new Circle; + * circle instanceof Circle; + * // => true + * + * circle instanceof Shape; + * // => true + */ + function create(prototype, properties) { + var result = baseCreate(prototype); + return properties ? baseAssign(result, properties) : result; + } + + /** + * Assigns own and inherited enumerable string keyed properties of source + * objects to the destination object for all destination properties that + * resolve to `undefined`. Source objects are applied from left to right. + * Once a property is set, additional values of the same property are ignored. + * + * **Note:** This method mutates `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' }); + * // => { 'user': 'barney', 'age': 36 } + */ + var defaults = rest(function(args) { + args.push(undefined, assignInDefaults); + return apply(assignInWith, undefined, args); + }); + + /** + * This method is like `_.defaults` except that it recursively assigns + * default properties. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.10.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } }); + * // => { 'user': { 'name': 'barney', 'age': 36 } } + * + */ + var defaultsDeep = rest(function(args) { + args.push(undefined, mergeDefaults); + return apply(mergeWith, undefined, args); + }); + + /** + * This method is like `_.find` except that it returns the key of the first + * element `predicate` returns truthy for instead of the element itself. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category Object + * @param {Object} object The object to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findKey(users, function(o) { return o.age < 40; }); + * // => 'barney' (iteration order is not guaranteed) + * + * // The `_.matches` iteratee shorthand. + * _.findKey(users, { 'age': 1, 'active': true }); + * // => 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findKey(users, 'active'); + * // => 'barney' + */ + function findKey(object, predicate) { + return baseFind(object, getIteratee(predicate, 3), baseForOwn, true); + } + + /** + * This method is like `_.findKey` except that it iterates over elements of + * a collection in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to search. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per iteration. + * @returns {string|undefined} Returns the key of the matched element, + * else `undefined`. + * @example + * + * var users = { + * 'barney': { 'age': 36, 'active': true }, + * 'fred': { 'age': 40, 'active': false }, + * 'pebbles': { 'age': 1, 'active': true } + * }; + * + * _.findLastKey(users, function(o) { return o.age < 40; }); + * // => returns 'pebbles' assuming `_.findKey` returns 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.findLastKey(users, { 'age': 36, 'active': true }); + * // => 'barney' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.findLastKey(users, ['active', false]); + * // => 'fred' + * + * // The `_.property` iteratee shorthand. + * _.findLastKey(users, 'active'); + * // => 'pebbles' + */ + function findLastKey(object, predicate) { + return baseFind(object, getIteratee(predicate, 3), baseForOwnRight, true); + } + + /** + * Iterates over own and inherited enumerable string keyed properties of an + * object invoking `iteratee` for each property. The iteratee is invoked with + * three arguments: (value, key, object). Iteratee functions may exit iteration + * early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forIn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a', 'b', then 'c' (iteration order is not guaranteed). + */ + function forIn(object, iteratee) { + return object == null + ? object + : baseFor(object, getIteratee(iteratee), keysIn); + } + + /** + * This method is like `_.forIn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forInRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'c', 'b', then 'a' assuming `_.forIn` logs 'a', 'b', then 'c'. + */ + function forInRight(object, iteratee) { + return object == null + ? object + : baseForRight(object, getIteratee(iteratee), keysIn); + } + + /** + * Iterates over own enumerable string keyed properties of an object invoking + * `iteratee` for each property. The iteratee is invoked with three arguments: + * (value, key, object). Iteratee functions may exit iteration early by + * explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 0.3.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwn(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'a' then 'b' (iteration order is not guaranteed). + */ + function forOwn(object, iteratee) { + return object && baseForOwn(object, getIteratee(iteratee)); + } + + /** + * This method is like `_.forOwn` except that it iterates over properties of + * `object` in the opposite order. + * + * @static + * @memberOf _ + * @since 2.0.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @returns {Object} Returns `object`. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.forOwnRight(new Foo, function(value, key) { + * console.log(key); + * }); + * // => Logs 'b' then 'a' assuming `_.forOwn` logs 'a' then 'b'. + */ + function forOwnRight(object, iteratee) { + return object && baseForOwnRight(object, getIteratee(iteratee)); + } + + /** + * Creates an array of function property names from own enumerable properties + * of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functions(new Foo); + * // => ['a', 'b'] + */ + function functions(object) { + return object == null ? [] : baseFunctions(object, keys(object)); + } + + /** + * Creates an array of function property names from own and inherited + * enumerable properties of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to inspect. + * @returns {Array} Returns the new array of property names. + * @example + * + * function Foo() { + * this.a = _.constant('a'); + * this.b = _.constant('b'); + * } + * + * Foo.prototype.c = _.constant('c'); + * + * _.functionsIn(new Foo); + * // => ['a', 'b', 'c'] + */ + function functionsIn(object) { + return object == null ? [] : baseFunctions(object, keysIn(object)); + } + + /** + * Gets the value at `path` of `object`. If the resolved value is + * `undefined`, the `defaultValue` is used in its place. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to get. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.get(object, 'a[0].b.c'); + * // => 3 + * + * _.get(object, ['a', '0', 'b', 'c']); + * // => 3 + * + * _.get(object, 'a.b.c', 'default'); + * // => 'default' + */ + function get(object, path, defaultValue) { + var result = object == null ? undefined : baseGet(object, path); + return result === undefined ? defaultValue : result; + } + + /** + * Checks if `path` is a direct property of `object`. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = { 'a': { 'b': 2 } }; + * var other = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.has(object, 'a'); + * // => true + * + * _.has(object, 'a.b'); + * // => true + * + * _.has(object, ['a', 'b']); + * // => true + * + * _.has(other, 'a'); + * // => false + */ + function has(object, path) { + return object != null && hasPath(object, path, baseHas); + } + + /** + * Checks if `path` is a direct or inherited property of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path to check. + * @returns {boolean} Returns `true` if `path` exists, else `false`. + * @example + * + * var object = _.create({ 'a': _.create({ 'b': 2 }) }); + * + * _.hasIn(object, 'a'); + * // => true + * + * _.hasIn(object, 'a.b'); + * // => true + * + * _.hasIn(object, ['a', 'b']); + * // => true + * + * _.hasIn(object, 'b'); + * // => false + */ + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + + /** + * Creates an object composed of the inverted keys and values of `object`. + * If `object` contains duplicate values, subsequent values overwrite + * property assignments of previous values. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Object + * @param {Object} object The object to invert. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invert(object); + * // => { '1': 'c', '2': 'b' } + */ + var invert = createInverter(function(result, value, key) { + result[value] = key; + }, constant(identity)); + + /** + * This method is like `_.invert` except that the inverted object is generated + * from the results of running each element of `object` thru `iteratee`. The + * corresponding inverted value of each inverted key is an array of keys + * responsible for generating the inverted value. The iteratee is invoked + * with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.1.0 + * @category Object + * @param {Object} object The object to invert. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The iteratee invoked per element. + * @returns {Object} Returns the new inverted object. + * @example + * + * var object = { 'a': 1, 'b': 2, 'c': 1 }; + * + * _.invertBy(object); + * // => { '1': ['a', 'c'], '2': ['b'] } + * + * _.invertBy(object, function(value) { + * return 'group' + value; + * }); + * // => { 'group1': ['a', 'c'], 'group2': ['b'] } + */ + var invertBy = createInverter(function(result, value, key) { + if (hasOwnProperty.call(result, value)) { + result[value].push(key); + } else { + result[value] = [key]; + } + }, getIteratee); + + /** + * Invokes the method at `path` of `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the method to invoke. + * @param {...*} [args] The arguments to invoke the method with. + * @returns {*} Returns the result of the invoked method. + * @example + * + * var object = { 'a': [{ 'b': { 'c': [1, 2, 3, 4] } }] }; + * + * _.invoke(object, 'a[0].b.c.slice', 1, 3); + * // => [2, 3] + */ + var invoke = rest(baseInvoke); + + /** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ + function keys(object) { + var isProto = isPrototype(object); + if (!(isProto || isArrayLike(object))) { + return baseKeys(object); + } + var indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + for (var key in object) { + if (baseHas(object, key) && + !(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(isProto && key == 'constructor')) { + result.push(key); + } + } + return result; + } + + /** + * Creates an array of the own and inherited enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keysIn(new Foo); + * // => ['a', 'b', 'c'] (iteration order is not guaranteed) + */ + function keysIn(object) { + var index = -1, + isProto = isPrototype(object), + props = baseKeysIn(object), + propsLength = props.length, + indexes = indexKeys(object), + skipIndexes = !!indexes, + result = indexes || [], + length = result.length; + + while (++index < propsLength) { + var key = props[index]; + if (!(skipIndexes && (key == 'length' || isIndex(key, length))) && + !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) { + result.push(key); + } + } + return result; + } + + /** + * The opposite of `_.mapValues`; this method creates an object with the + * same values as `object` and keys generated by running each own enumerable + * string keyed property of `object` thru `iteratee`. The iteratee is invoked + * with three arguments: (value, key, object). + * + * @static + * @memberOf _ + * @since 3.8.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @example + * + * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) { + * return key + value; + * }); + * // => { 'a1': 1, 'b2': 2 } + */ + function mapKeys(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + result[iteratee(value, key, object)] = value; + }); + return result; + } + + /** + * Creates an object with the same keys as `object` and values generated + * by running each own enumerable string keyed property of `object` thru + * `iteratee`. The iteratee is invoked with three arguments: + * (value, key, object). + * + * @static + * @memberOf _ + * @since 2.4.0 + * @category Object + * @param {Object} object The object to iterate over. + * @param {Array|Function|Object|string} [iteratee=_.identity] + * The function invoked per iteration. + * @returns {Object} Returns the new mapped object. + * @example + * + * var users = { + * 'fred': { 'user': 'fred', 'age': 40 }, + * 'pebbles': { 'user': 'pebbles', 'age': 1 } + * }; + * + * _.mapValues(users, function(o) { return o.age; }); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + * + * // The `_.property` iteratee shorthand. + * _.mapValues(users, 'age'); + * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed) + */ + function mapValues(object, iteratee) { + var result = {}; + iteratee = getIteratee(iteratee, 3); + + baseForOwn(object, function(value, key, object) { + result[key] = iteratee(value, key, object); + }); + return result; + } + + /** + * This method is like `_.assign` except that it recursively merges own and + * inherited enumerable string keyed properties of source objects into the + * destination object. Source properties that resolve to `undefined` are + * skipped if a destination value exists. Array and plain object properties + * are merged recursively.Other objects and value types are overridden by + * assignment. Source objects are applied from left to right. Subsequent + * sources overwrite property assignments of previous sources. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 0.5.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} [sources] The source objects. + * @returns {Object} Returns `object`. + * @example + * + * var users = { + * 'data': [{ 'user': 'barney' }, { 'user': 'fred' }] + * }; + * + * var ages = { + * 'data': [{ 'age': 36 }, { 'age': 40 }] + * }; + * + * _.merge(users, ages); + * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] } + */ + var merge = createAssigner(function(object, source, srcIndex) { + baseMerge(object, source, srcIndex); + }); + + /** + * This method is like `_.merge` except that it accepts `customizer` which + * is invoked to produce the merged values of the destination and source + * properties. If `customizer` returns `undefined`, merging is handled by the + * method instead. The `customizer` is invoked with seven arguments: + * (objValue, srcValue, key, object, source, stack). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The destination object. + * @param {...Object} sources The source objects. + * @param {Function} customizer The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * function customizer(objValue, srcValue) { + * if (_.isArray(objValue)) { + * return objValue.concat(srcValue); + * } + * } + * + * var object = { + * 'fruits': ['apple'], + * 'vegetables': ['beet'] + * }; + * + * var other = { + * 'fruits': ['banana'], + * 'vegetables': ['carrot'] + * }; + * + * _.mergeWith(object, other, customizer); + * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] } + */ + var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { + baseMerge(object, source, srcIndex, customizer); + }); + + /** + * The opposite of `_.pick`; this method creates an object composed of the + * own and inherited enumerable string keyed properties of `object` that are + * not omitted. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property identifiers to omit, + * specified individually or in arrays. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omit(object, ['a', 'c']); + * // => { 'b': '2' } + */ + var omit = rest(function(object, props) { + if (object == null) { + return {}; + } + props = arrayMap(baseFlatten(props, 1), baseCastKey); + return basePick(object, baseDifference(getAllKeysIn(object), props)); + }); + + /** + * The opposite of `_.pickBy`; this method creates an object composed of + * the own and inherited enumerable string keyed properties of `object` that + * `predicate` doesn't return truthy for. The predicate is invoked with two + * arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.omitBy(object, _.isNumber); + * // => { 'b': '2' } + */ + function omitBy(object, predicate) { + predicate = getIteratee(predicate); + return basePickBy(object, function(value, key) { + return !predicate(value, key); + }); + } + + /** + * Creates an object composed of the picked `object` properties. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The source object. + * @param {...(string|string[])} [props] The property identifiers to pick, + * specified individually or in arrays. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pick(object, ['a', 'c']); + * // => { 'a': 1, 'c': 3 } + */ + var pick = rest(function(object, props) { + return object == null ? {} : basePick(object, baseFlatten(props, 1)); + }); + + /** + * Creates an object composed of the `object` properties `predicate` returns + * truthy for. The predicate is invoked with two arguments: (value, key). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The source object. + * @param {Array|Function|Object|string} [predicate=_.identity] + * The function invoked per property. + * @returns {Object} Returns the new object. + * @example + * + * var object = { 'a': 1, 'b': '2', 'c': 3 }; + * + * _.pickBy(object, _.isNumber); + * // => { 'a': 1, 'c': 3 } + */ + function pickBy(object, predicate) { + return object == null ? {} : basePickBy(object, getIteratee(predicate)); + } + + /** + * This method is like `_.get` except that if the resolved value is a + * function it's invoked with the `this` binding of its parent object and + * its result is returned. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @param {Array|string} path The path of the property to resolve. + * @param {*} [defaultValue] The value returned for `undefined` resolved values. + * @returns {*} Returns the resolved value. + * @example + * + * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] }; + * + * _.result(object, 'a[0].b.c1'); + * // => 3 + * + * _.result(object, 'a[0].b.c2'); + * // => 4 + * + * _.result(object, 'a[0].b.c3', 'default'); + * // => 'default' + * + * _.result(object, 'a[0].b.c3', _.constant('default')); + * // => 'default' + */ + function result(object, path, defaultValue) { + path = isKey(path, object) ? [path] : baseCastPath(path); + + var index = -1, + length = path.length; + + // Ensure the loop is entered when path is empty. + if (!length) { + object = undefined; + length = 1; + } + while (++index < length) { + var value = object == null ? undefined : object[path[index]]; + if (value === undefined) { + index = length; + value = defaultValue; + } + object = isFunction(value) ? value.call(object) : value; + } + return object; + } + + /** + * Sets the value at `path` of `object`. If a portion of `path` doesn't exist, + * it's created. Arrays are created for missing index properties while objects + * are created for all other missing properties. Use `_.setWith` to customize + * `path` creation. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 3.7.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.set(object, 'a[0].b.c', 4); + * console.log(object.a[0].b.c); + * // => 4 + * + * _.set(object, ['x', '0', 'y', 'z'], 5); + * console.log(object.x[0].y.z); + * // => 5 + */ + function set(object, path, value) { + return object == null ? object : baseSet(object, path, value); + } + + /** + * This method is like `_.set` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {*} value The value to set. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.setWith(object, '[0][1]', 'a', Object); + * // => { '0': { '1': 'a' } } + */ + function setWith(object, path, value, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseSet(object, path, value, customizer); + } + + /** + * Creates an array of own enumerable string keyed-value pairs for `object` + * which can be consumed by `_.fromPairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entries + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairs(new Foo); + * // => [['a', 1], ['b', 2]] (iteration order is not guaranteed) + */ + function toPairs(object) { + return baseToPairs(object, keys(object)); + } + + /** + * Creates an array of own and inherited enumerable string keyed-value pairs + * for `object` which can be consumed by `_.fromPairs`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @alias entriesIn + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the new array of key-value pairs. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.toPairsIn(new Foo); + * // => [['a', 1], ['b', 2], ['c', 1]] (iteration order is not guaranteed) + */ + function toPairsIn(object) { + return baseToPairs(object, keysIn(object)); + } + + /** + * An alternative to `_.reduce`; this method transforms `object` to a new + * `accumulator` object which is the result of running each of its own + * enumerable string keyed properties thru `iteratee`, with each invocation + * potentially mutating the `accumulator` object. The iteratee is invoked + * with four arguments: (accumulator, value, key, object). Iteratee functions + * may exit iteration early by explicitly returning `false`. + * + * @static + * @memberOf _ + * @since 1.3.0 + * @category Object + * @param {Array|Object} object The object to iterate over. + * @param {Function} [iteratee=_.identity] The function invoked per iteration. + * @param {*} [accumulator] The custom accumulator value. + * @returns {*} Returns the accumulated value. + * @example + * + * _.transform([2, 3, 4], function(result, n) { + * result.push(n *= n); + * return n % 2 == 0; + * }, []); + * // => [4, 9] + * + * _.transform({ 'a': 1, 'b': 2, 'c': 1 }, function(result, value, key) { + * (result[value] || (result[value] = [])).push(key); + * }, {}); + * // => { '1': ['a', 'c'], '2': ['b'] } + */ + function transform(object, iteratee, accumulator) { + var isArr = isArray(object) || isTypedArray(object); + iteratee = getIteratee(iteratee, 4); + + if (accumulator == null) { + if (isArr || isObject(object)) { + var Ctor = object.constructor; + if (isArr) { + accumulator = isArray(object) ? new Ctor : []; + } else { + accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; + } + } else { + accumulator = {}; + } + } + (isArr ? arrayEach : baseForOwn)(object, function(value, index, object) { + return iteratee(accumulator, value, index, object); + }); + return accumulator; + } + + /** + * Removes the property at `path` of `object`. + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to unset. + * @returns {boolean} Returns `true` if the property is deleted, else `false`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 7 } }] }; + * _.unset(object, 'a[0].b.c'); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + * + * _.unset(object, ['a', '0', 'b', 'c']); + * // => true + * + * console.log(object); + * // => { 'a': [{ 'b': {} }] }; + */ + function unset(object, path) { + return object == null ? true : baseUnset(object, path); + } + + /** + * This method is like `_.set` except that accepts `updater` to produce the + * value to set. Use `_.updateWith` to customize `path` creation. The `updater` + * is invoked with one argument: (value). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @returns {Object} Returns `object`. + * @example + * + * var object = { 'a': [{ 'b': { 'c': 3 } }] }; + * + * _.update(object, 'a[0].b.c', function(n) { return n * n; }); + * console.log(object.a[0].b.c); + * // => 9 + * + * _.update(object, 'x[0].y.z', function(n) { return n ? n + 1 : 0; }); + * console.log(object.x[0].y.z); + * // => 0 + */ + function update(object, path, updater) { + return object == null ? object : baseUpdate(object, path, baseCastFunction(updater)); + } + + /** + * This method is like `_.update` except that it accepts `customizer` which is + * invoked to produce the objects of `path`. If `customizer` returns `undefined` + * path creation is handled by the method instead. The `customizer` is invoked + * with three arguments: (nsValue, key, nsObject). + * + * **Note:** This method mutates `object`. + * + * @static + * @memberOf _ + * @since 4.6.0 + * @category Object + * @param {Object} object The object to modify. + * @param {Array|string} path The path of the property to set. + * @param {Function} updater The function to produce the updated value. + * @param {Function} [customizer] The function to customize assigned values. + * @returns {Object} Returns `object`. + * @example + * + * var object = {}; + * + * _.updateWith(object, '[0][1]', _.constant('a'), Object); + * // => { '0': { '1': 'a' } } + */ + function updateWith(object, path, updater, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + return object == null ? object : baseUpdate(object, path, baseCastFunction(updater), customizer); + } + + /** + * Creates an array of the own enumerable string keyed property values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.values(new Foo); + * // => [1, 2] (iteration order is not guaranteed) + * + * _.values('hi'); + * // => ['h', 'i'] + */ + function values(object) { + return object ? baseValues(object, keys(object)) : []; + } + + /** + * Creates an array of the own and inherited enumerable string keyed property + * values of `object`. + * + * **Note:** Non-object values are coerced to objects. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property values. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.valuesIn(new Foo); + * // => [1, 2, 3] (iteration order is not guaranteed) + */ + function valuesIn(object) { + return object == null ? [] : baseValues(object, keysIn(object)); + } + + /*------------------------------------------------------------------------*/ + + /** + * Clamps `number` within the inclusive `lower` and `upper` bounds. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Number + * @param {number} number The number to clamp. + * @param {number} [lower] The lower bound. + * @param {number} upper The upper bound. + * @returns {number} Returns the clamped number. + * @example + * + * _.clamp(-10, -5, 5); + * // => -5 + * + * _.clamp(10, -5, 5); + * // => 5 + */ + function clamp(number, lower, upper) { + if (upper === undefined) { + upper = lower; + lower = undefined; + } + if (upper !== undefined) { + upper = toNumber(upper); + upper = upper === upper ? upper : 0; + } + if (lower !== undefined) { + lower = toNumber(lower); + lower = lower === lower ? lower : 0; + } + return baseClamp(toNumber(number), lower, upper); + } + + /** + * Checks if `n` is between `start` and up to but not including, `end`. If + * `end` is not specified, it's set to `start` with `start` then set to `0`. + * If `start` is greater than `end` the params are swapped to support + * negative ranges. + * + * @static + * @memberOf _ + * @since 3.3.0 + * @category Number + * @param {number} number The number to check. + * @param {number} [start=0] The start of the range. + * @param {number} end The end of the range. + * @returns {boolean} Returns `true` if `number` is in the range, else `false`. + * @example + * + * _.inRange(3, 2, 4); + * // => true + * + * _.inRange(4, 8); + * // => true + * + * _.inRange(4, 2); + * // => false + * + * _.inRange(2, 2); + * // => false + * + * _.inRange(1.2, 2); + * // => true + * + * _.inRange(5.2, 4); + * // => false + * + * _.inRange(-3, -2, -6); + * // => true + */ + function inRange(number, start, end) { + start = toNumber(start) || 0; + if (end === undefined) { + end = start; + start = 0; + } else { + end = toNumber(end) || 0; + } + number = toNumber(number); + return baseInRange(number, start, end); + } + + /** + * Produces a random number between the inclusive `lower` and `upper` bounds. + * If only one argument is provided a number between `0` and the given number + * is returned. If `floating` is `true`, or either `lower` or `upper` are + * floats, a floating-point number is returned instead of an integer. + * + * **Note:** JavaScript follows the IEEE-754 standard for resolving + * floating-point values which can produce unexpected results. + * + * @static + * @memberOf _ + * @since 0.7.0 + * @category Number + * @param {number} [lower=0] The lower bound. + * @param {number} [upper=1] The upper bound. + * @param {boolean} [floating] Specify returning a floating-point number. + * @returns {number} Returns the random number. + * @example + * + * _.random(0, 5); + * // => an integer between 0 and 5 + * + * _.random(5); + * // => also an integer between 0 and 5 + * + * _.random(5, true); + * // => a floating-point number between 0 and 5 + * + * _.random(1.2, 5.2); + * // => a floating-point number between 1.2 and 5.2 + */ + function random(lower, upper, floating) { + if (floating && typeof floating != 'boolean' && isIterateeCall(lower, upper, floating)) { + upper = floating = undefined; + } + if (floating === undefined) { + if (typeof upper == 'boolean') { + floating = upper; + upper = undefined; + } + else if (typeof lower == 'boolean') { + floating = lower; + lower = undefined; + } + } + if (lower === undefined && upper === undefined) { + lower = 0; + upper = 1; + } + else { + lower = toNumber(lower) || 0; + if (upper === undefined) { + upper = lower; + lower = 0; + } else { + upper = toNumber(upper) || 0; + } + } + if (lower > upper) { + var temp = lower; + lower = upper; + upper = temp; + } + if (floating || lower % 1 || upper % 1) { + var rand = nativeRandom(); + return nativeMin(lower + (rand * (upper - lower + freeParseFloat('1e-' + ((rand + '').length - 1)))), upper); + } + return baseRandom(lower, upper); + } + + /*------------------------------------------------------------------------*/ + + /** + * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the camel cased string. + * @example + * + * _.camelCase('Foo Bar'); + * // => 'fooBar' + * + * _.camelCase('--foo-bar--'); + * // => 'fooBar' + * + * _.camelCase('__FOO_BAR__'); + * // => 'fooBar' + */ + var camelCase = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + + /** + * Converts the first character of `string` to upper case and the remaining + * to lower case. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to capitalize. + * @returns {string} Returns the capitalized string. + * @example + * + * _.capitalize('FRED'); + * // => 'Fred' + */ + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + + /** + * Deburrs `string` by converting + * [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table) + * to basic latin letters and removing + * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to deburr. + * @returns {string} Returns the deburred string. + * @example + * + * _.deburr('déjà vu'); + * // => 'deja vu' + */ + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, ''); + } + + /** + * Checks if `string` ends with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to search. + * @param {string} [target] The string to search for. + * @param {number} [position=string.length] The position to search from. + * @returns {boolean} Returns `true` if `string` ends with `target`, + * else `false`. + * @example + * + * _.endsWith('abc', 'c'); + * // => true + * + * _.endsWith('abc', 'b'); + * // => false + * + * _.endsWith('abc', 'b', 2); + * // => true + */ + function endsWith(string, target, position) { + string = toString(string); + target = typeof target == 'string' ? target : (target + ''); + + var length = string.length; + position = position === undefined + ? length + : baseClamp(toInteger(position), 0, length); + + position -= target.length; + return position >= 0 && string.indexOf(target, position) == position; + } + + /** + * Converts the characters "&", "<", ">", '"', "'", and "\`" in `string` to + * their corresponding HTML entities. + * + * **Note:** No other characters are escaped. To escape additional + * characters use a third-party library like [_he_](https://mths.be/he). + * + * Though the ">" character is escaped for symmetry, characters like + * ">" and "/" don't need escaping in HTML and have no special meaning + * unless they're part of a tag or unquoted attribute value. See + * [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands) + * (under "semi-related fun fact") for more details. + * + * Backticks are escaped because in IE < 9, they can break out of + * attribute values or HTML comments. See [#59](https://html5sec.org/#59), + * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and + * [#133](https://html5sec.org/#133) of the + * [HTML5 Security Cheatsheet](https://html5sec.org/) for more details. + * + * When working with HTML you should always + * [quote attribute values](http://wonko.com/post/html-escaping) to reduce + * XSS vectors. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escape('fred, barney, & pebbles'); + * // => 'fred, barney, & pebbles' + */ + function escape(string) { + string = toString(string); + return (string && reHasUnescapedHtml.test(string)) + ? string.replace(reUnescapedHtml, escapeHtmlChar) + : string; + } + + /** + * Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+", + * "?", "(", ")", "[", "]", "{", "}", and "|" in `string`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to escape. + * @returns {string} Returns the escaped string. + * @example + * + * _.escapeRegExp('[lodash](https://lodash.com/)'); + * // => '\[lodash\]\(https://lodash\.com/\)' + */ + function escapeRegExp(string) { + string = toString(string); + return (string && reHasRegExpChar.test(string)) + ? string.replace(reRegExpChar, '\\$&') + : string; + } + + /** + * Converts `string` to + * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the kebab cased string. + * @example + * + * _.kebabCase('Foo Bar'); + * // => 'foo-bar' + * + * _.kebabCase('fooBar'); + * // => 'foo-bar' + * + * _.kebabCase('__FOO_BAR__'); + * // => 'foo-bar' + */ + var kebabCase = createCompounder(function(result, word, index) { + return result + (index ? '-' : '') + word.toLowerCase(); + }); + + /** + * Converts `string`, as space separated words, to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the lower cased string. + * @example + * + * _.lowerCase('--Foo-Bar--'); + * // => 'foo bar' + * + * _.lowerCase('fooBar'); + * // => 'foo bar' + * + * _.lowerCase('__FOO_BAR__'); + * // => 'foo bar' + */ + var lowerCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + word.toLowerCase(); + }); + + /** + * Converts the first character of `string` to lower case. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the converted string. + * @example + * + * _.lowerFirst('Fred'); + * // => 'fred' + * + * _.lowerFirst('FRED'); + * // => 'fRED' + */ + var lowerFirst = createCaseFirst('toLowerCase'); + + /** + * Pads `string` on the left and right sides if it's shorter than `length`. + * Padding characters are truncated if they can't be evenly divided by `length`. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.pad('abc', 8); + * // => ' abc ' + * + * _.pad('abc', 8, '_-'); + * // => '_-abc_-_' + * + * _.pad('abc', 3); + * // => 'abc' + */ + function pad(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + if (!length || strLength >= length) { + return string; + } + var mid = (length - strLength) / 2; + return ( + createPadding(nativeFloor(mid), chars) + + string + + createPadding(nativeCeil(mid), chars) + ); + } + + /** + * Pads `string` on the right side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padEnd('abc', 6); + * // => 'abc ' + * + * _.padEnd('abc', 6, '_-'); + * // => 'abc_-_' + * + * _.padEnd('abc', 3); + * // => 'abc' + */ + function padEnd(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (string + createPadding(length - strLength, chars)) + : string; + } + + /** + * Pads `string` on the left side if it's shorter than `length`. Padding + * characters are truncated if they exceed `length`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to pad. + * @param {number} [length=0] The padding length. + * @param {string} [chars=' '] The string used as padding. + * @returns {string} Returns the padded string. + * @example + * + * _.padStart('abc', 6); + * // => ' abc' + * + * _.padStart('abc', 6, '_-'); + * // => '_-_abc' + * + * _.padStart('abc', 3); + * // => 'abc' + */ + function padStart(string, length, chars) { + string = toString(string); + length = toInteger(length); + + var strLength = length ? stringSize(string) : 0; + return (length && strLength < length) + ? (createPadding(length - strLength, chars) + string) + : string; + } + + /** + * Converts `string` to an integer of the specified radix. If `radix` is + * `undefined` or `0`, a `radix` of `10` is used unless `value` is a + * hexadecimal, in which case a `radix` of `16` is used. + * + * **Note:** This method aligns with the + * [ES5 implementation](https://es5.github.io/#x15.1.2.2) of `parseInt`. + * + * @static + * @memberOf _ + * @since 1.1.0 + * @category String + * @param {string} string The string to convert. + * @param {number} [radix=10] The radix to interpret `value` by. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {number} Returns the converted integer. + * @example + * + * _.parseInt('08'); + * // => 8 + * + * _.map(['6', '08', '10'], _.parseInt); + * // => [6, 8, 10] + */ + function parseInt(string, radix, guard) { + // Chrome fails to trim leading whitespace characters. + // See https://bugs.chromium.org/p/v8/issues/detail?id=3109 for more details. + if (guard || radix == null) { + radix = 0; + } else if (radix) { + radix = +radix; + } + string = toString(string).replace(reTrim, ''); + return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10)); + } + + /** + * Repeats the given string `n` times. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to repeat. + * @param {number} [n=1] The number of times to repeat the string. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {string} Returns the repeated string. + * @example + * + * _.repeat('*', 3); + * // => '***' + * + * _.repeat('abc', 2); + * // => 'abcabc' + * + * _.repeat('abc', 0); + * // => '' + */ + function repeat(string, n, guard) { + if ((guard ? isIterateeCall(string, n, guard) : n === undefined)) { + n = 1; + } else { + n = toInteger(n); + } + return baseRepeat(toString(string), n); + } + + /** + * Replaces matches for `pattern` in `string` with `replacement`. + * + * **Note:** This method is based on + * [`String#replace`](https://mdn.io/String/replace). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to modify. + * @param {RegExp|string} pattern The pattern to replace. + * @param {Function|string} replacement The match replacement. + * @returns {string} Returns the modified string. + * @example + * + * _.replace('Hi Fred', 'Fred', 'Barney'); + * // => 'Hi Barney' + */ + function replace() { + var args = arguments, + string = toString(args[0]); + + return args.length < 3 ? string : string.replace(args[1], args[2]); + } + + /** + * Converts `string` to + * [snake case](https://en.wikipedia.org/wiki/Snake_case). + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the snake cased string. + * @example + * + * _.snakeCase('Foo Bar'); + * // => 'foo_bar' + * + * _.snakeCase('fooBar'); + * // => 'foo_bar' + * + * _.snakeCase('--FOO-BAR--'); + * // => 'foo_bar' + */ + var snakeCase = createCompounder(function(result, word, index) { + return result + (index ? '_' : '') + word.toLowerCase(); + }); + + /** + * Splits `string` by `separator`. + * + * **Note:** This method is based on + * [`String#split`](https://mdn.io/String/split). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category String + * @param {string} [string=''] The string to split. + * @param {RegExp|string} separator The separator pattern to split by. + * @param {number} [limit] The length to truncate results to. + * @returns {Array} Returns the new array of string segments. + * @example + * + * _.split('a-b-c', '-', 2); + * // => ['a', 'b'] + */ + function split(string, separator, limit) { + string = toString(string); + if (string && ( + typeof separator == 'string' || + (separator != null && !isRegExp(separator)) + )) { + separator += ''; + if (separator == '' && reHasComplexSymbol.test(string)) { + var strSymbols = stringToArray(string); + return limit === undefined ? strSymbols : strSymbols.slice(0, limit < 0 ? 0 : limit); + } + } + return string.split(separator, limit); + } + + /** + * Converts `string` to + * [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage). + * + * @static + * @memberOf _ + * @since 3.1.0 + * @category String + * @param {string} [string=''] The string to convert. + * @returns {string} Returns the start cased string. + * @example + * + * _.startCase('--foo-bar--'); + * // => 'Foo Bar' + * + * _.startCase('fooBar'); + * // => 'Foo Bar' + * + * _.startCase('__FOO_BAR__'); + * // => 'FOO BAR' + */ + var startCase = createCompounder(function(result, word, index) { + return result + (index ? ' ' : '') + upperFirst(word); + }); + + /** + * Checks if `string` starts with the given target string. + * + * @static + * @memberOf _ + * @since 3.0.0 + * @category String + * @param {string} [string=''] The string to search. + * @param {string} [target] The string to search for. + * @param {number} [position=0] The position to search from. + * @returns {boolean} Returns `true` if `string` starts with `target`, + * else `false`. + * @example + * + * _.startsWith('abc', 'a'); + * // => true + * + * _.startsWith('abc', 'b'); + * // => false + * + * _.startsWith('abc', 'b', 1); + * // => true + */ + function startsWith(string, target, position) { + string = toString(string); + position = baseClamp(toInteger(position), 0, string.length); + return string.lastIndexOf(target, position) == position; + } + + /** + * Creates a compiled template function that can interpolate data properties + * in "interpolate" delimiters, HTML-escape interpolated data properties in + * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data + * properties may be accessed as free variables in the template. If a setting + * object is given, it takes precedence over `_.templateSettings` values. + * + * **Note:** In the development build `_.template` utilizes + * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl) + * for easier debugging. + * + * For more information on precompiling templates see + * [lodash's custom builds documentation](https://lodash.com/custom-builds). + * + * For more information on Chrome extension sandboxes see + * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval). + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category String + * @param {string} [string=''] The template string. + * @param {Object} [options={}] The options object. + * @param {RegExp} [options.escape=_.templateSettings.escape] + * The HTML "escape" delimiter. + * @param {RegExp} [options.evaluate=_.templateSettings.evaluate] + * The "evaluate" delimiter. + * @param {Object} [options.imports=_.templateSettings.imports] + * An object to import into the template as free variables. + * @param {RegExp} [options.interpolate=_.templateSettings.interpolate] + * The "interpolate" delimiter. + * @param {string} [options.sourceURL='lodash.templateSources[n]'] + * The sourceURL of the compiled template. + * @param {string} [options.variable='obj'] + * The data object variable name. + * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`. + * @returns {Function} Returns the compiled template function. + * @example + * + * // Use the "interpolate" delimiter to create a compiled template. + * var compiled = _.template('hello <%= user %>!'); + * compiled({ 'user': 'fred' }); + * // => 'hello fred!' + * + * // Use the HTML "escape" delimiter to escape data property values. + * var compiled = _.template('<%- value %>'); + * compiled({ 'value': '