diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml new file mode 100644 index 00000000..217f7cbe --- /dev/null +++ b/.github/workflows/dotnet.yml @@ -0,0 +1,28 @@ +# This workflow will build a .NET project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net + +name: .NET + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build --no-restore + - name: Test + run: dotnet test --no-build --verbosity normal diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 71badf6b..00000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,67 +0,0 @@ -# Please find the full example project here: -# https://gitlab.com/tobiaskoch/gitlab-ci-example-mono - -# see https://hub.docker.com/_/mono/ -image: mono:4.6.2.7 - -stages: - - build - - test - - deploy - -before_script: - - . /opt/mono-4.6/mono-env - - export GIT_SSL_NO_VERIFY=true - - curl --insecure -sSL https://lua.pschneider.fr/files/Paul/pub/dnx-install.sh | bash - - DNX_USER_HOME=`pwd -P`/dnx . ./dnx/dnvm/dnvm.sh - - cd src/OAuth.AspNet.Token && dnu restore --ignore-failed-sources - - cd ../OAuth.AspNet.AuthServer && dnu restore --ignore-failed-sources - - cd ../Yavsc.Abstract && dnu restore --ignore-failed-sources - - cd ../Yavsc.Server && dnu restore --ignore-failed-sources - - cd ../Yavsc && dnu restore --ignore-failed-sources - - cd ../cli && dnu restore --ignore-failed-sources - - cd ../../test/yavscTests && dnu restore --ignore-failed-sources - - cd ../.. - -after_script: - -debug: - stage: build - artifacts: - paths: - - test/yavscTests/bin - script: - - cd test/yavscTests - - dnu build - -non_reg: - stage: test - artifacts: - paths: - - test/yavscTests/test-results.xml - when: always - script: - - cd test/yavscTests - - cp $yavsc_client_secret_json yavsc-client-secret.json - - ASPNET_ENV=Development dnx test -trait ategory=non_reg -maxthreads 1 -xml test-results.xml - -release: - stage: deploy - only: - - vnext - artifacts: - paths: - - binaries/Debug - script: - - make packages - -deploy_staging: - stage: deploy - script: - - echo "Deploy to staging server" - - make strip_yavscd - - make packages - - isn push -s $ISNSOURCE -k $NUGETSOURCEAPIKEY src/Yavsc.Abstract/bin/*/*.nupkg - environment: - name: staging - url: https://yavscpre.pschneider.fr diff --git a/.nuget/NuGet.Config b/.nuget/NuGet.Config deleted file mode 100644 index 3082130d..00000000 --- a/.nuget/NuGet.Config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/.nuget/packages.config b/.nuget/packages.config deleted file mode 100644 index eaeeed58..00000000 --- a/.nuget/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 2a523d6b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,22 +0,0 @@ -language: csharp -os: linux -mono: -- beta -sudo: false -install: -- curl --insecure -sSL https://lua.pschneider.fr/files/Paul/pub/dnx-install.sh | bash -- DNX_USER_HOME=`pwd -P`/dnx . ./dnx/dnvm/dnvm.sh -- cd src/OAuth.AspNet.Token && dnu restore --ignore-failed-sources -- cd ../OAuth.AspNet.AuthServer && dnu restore --ignore-failed-sources -- cd ../Yavsc.Abstract && dnu restore --ignore-failed-sources -- cd ../Yavsc.Server && dnu restore --ignore-failed-sources -- cd ../Yavsc && dnu restore --ignore-failed-sources -- cd ../test -- make restore -- make -- cd ../.. -- make - -script: -- "dnu build" - diff --git a/global.json b/global.json index 952b7d76..030b02f6 100644 --- a/global.json +++ b/global.json @@ -1,12 +1,6 @@ { - "projects": [ - "src", - "scripts", - "tests" - ], "sdk": { "runtime": "dotnet", - "architecture": "x64" - }, - "packages": "packages" + "version": "8.0.405" + } } diff --git a/omnisharp.json b/omnisharp.json deleted file mode 100644 index 5df81efa..00000000 --- a/omnisharp.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "dotnet": { - "enabled": false - }, - "msbuild": { - "enabled": true - }, - "Dnx": { - "enabled": false - }, - "Script": { - "enabled": false - }, - "fileOptions": { - "systemExcludeSearchPatterns": [ - "**/bin/**/*", - "**/obj/**/*", - "**/node_modules/**/*" - ], - "userExcludeSearchPatterns": [] - } -} diff --git a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Create.cshtml b/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Create.cshtml deleted file mode 100644 index d212ba9f..00000000 --- a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Create.cshtml +++ /dev/null @@ -1,145 +0,0 @@ -@inherits Microsoft.Extensions.CodeGeneration.Templating.RazorTemplateBase -@using Microsoft.Extensions.CodeGeneration.EntityFramework -@@model @Model.ViewDataTypeName - -@{ - if (Model.IsPartialView) - { - } - else if (Model.IsLayoutPageSelected) - { -@:@@{ - @:ViewData["Title"] = @@Model.ViewName; - if (!string.IsNullOrEmpty(Model.LayoutPageFile)) - { - @:Layout = "@Model.LayoutPageFile"; - } -@:} -@: -@:

@@Model.ViewName

-@: - } - else - { -@:@@{ - @:Layout = "null"; -@:} -@: -@: -@: -@: -@: - @: - @:@Model.ViewName -@: -@: -@: - // PushIndent(" "); - } -@:
- @:
- @:

@@Model.ViewDataTypeShortName"]

- @:
- @:
- foreach (var property in Model.ModelMetadata.Properties) - { - if (property.Scaffold && !property.IsAutoGenerated && !property.IsReadOnly) - { - - // If the property is a primary key and Guid, then the Guid is generated in the controller. Hence, this propery is not displayed on the view. - if (property.IsPrimaryKey) - { - continue; - } - - if (property.IsForeignKey) - { - @:
- @: - @:
- @: - @:
- @:
- continue; - } - - bool isCheckbox = property.TypeName.Equals("System.Boolean"); - if (isCheckbox) - { - @:
- @:
- @:
- @: - @: - @:
- @:
- @:
- } - else if (property.IsEnum && !property.IsEnumFlags) - { - @:
- @: - @:
- @: - @: - @:
- @:
- } - else - { - @:
- @: - @:
- @: - @: - @:
- @:
- } - } - } -} -
-
- -
-
-
-
- -
- @Back to List -
- -@{ - if (Model.ReferenceScriptLibraries && (Model.IsLayoutPageSelected || Model.IsPartialView)) - { -@:@@section Scripts { - @: - @: - @: -@:} - } - // The following code closes the tag used in the case of a view using a layout page and the body and html tags in the case of a regular view page - if (!Model.IsPartialView && !Model.IsLayoutPageSelected) - { - if (Model.ReferenceScriptLibraries) - { -@:@@section Scripts { - @: - @: - @: -@:} - //ClearIndent(); - } -@: -@: - } -} -@functions -{ - // Do we need to use this in conjunction with the PrimaryKey check? - bool IsPropertyGuid(PropertyMetadata property) - { - return string.Equals("System.Guid", property.TypeName, StringComparison.OrdinalIgnoreCase); - } -} diff --git a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Delete.cshtml b/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Delete.cshtml deleted file mode 100644 index 1c2dab35..00000000 --- a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Delete.cshtml +++ /dev/null @@ -1,81 +0,0 @@ -@inherits Microsoft.Extensions.CodeGeneration.Templating.RazorTemplateBase -@using Microsoft.Extensions.CodeGeneration.EntityFramework -@@model @Model.ViewDataTypeName - -@{ - if (Model.IsPartialView) - { - } - else if (Model.IsLayoutPageSelected) - { -@:@@{ - @:ViewData["Title"] = @@Model.ViewName; - if (!string.IsNullOrEmpty(Model.LayoutPageFile)) - { - @:Layout = "@Model.LayoutPageFile"; - } -@:} -@: -@:

@@Model.ViewName

-@: - } - else - { -@:@@{ - @:Layout = "null"; -@:} -@: -@: -@: -@: -@: - @: - @:@@@Model.ViewName -@: -@: -@: - // PushIndent(" "); - } -} -

@AreYourSureYouWantToDeleteThis

-
-

@@@Model.ViewDataTypeShortName

-
-
-@{ - foreach (var property in Model.ModelMetadata.Properties) - { - if (property.Scaffold && !property.IsPrimaryKey && !property.IsForeignKey) - { -
- @@Html.DisplayNameFor(model => model.@GetValueExpression(property)) -
-
- @@Html.DisplayFor(model => model.@GetValueExpression(property)) -
- } - } - @:
- @: - @:
- @:
- @: | - @:Back to List - @:
- @:
-@:
- if (!Model.IsPartialView && !Model.IsLayoutPageSelected) - { - //ClearIndent(); -@: -@: - } -} -@functions -{ - string GetValueExpression(PropertyMetadata property) - { - //Todo: Get the association for the property and use that. - return property.PropertyName; - } -} diff --git a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Details.cshtml b/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Details.cshtml deleted file mode 100644 index 87e0bc5c..00000000 --- a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Details.cshtml +++ /dev/null @@ -1,95 +0,0 @@ -@inherits Microsoft.Extensions.CodeGeneration.Templating.RazorTemplateBase -@using Microsoft.Extensions.CodeGeneration.EntityFramework -@@model @Model.ViewDataTypeName - -@{ - if (Model.IsPartialView) - { - } - else if (Model.IsLayoutPageSelected) - { -@:@@{ - @:ViewData["Title"] = @@Model.ViewName; - if (!string.IsNullOrEmpty(Model.LayoutPageFile)) - { - @:Layout = "@Model.LayoutPageFile"; - } -@:} -@: -@:

@@Model.ViewName

-@: - } - else - { -@:@@{ - @:Layout = "null"; -@:} -@: -@: -@: -@: -@: - @: - @:@Model.ViewName -@: -@: -@: - // PushIndent(" "); - } -} -
-

@Model.ViewDataTypeShortName

-
-
-@{ - foreach (var property in Model.ModelMetadata.Properties) - { - if (property.Scaffold && !property.IsPrimaryKey && !property.IsForeignKey) - { -
- @@Html.DisplayNameFor(model => model.@GetValueExpression(property)) -
-
- @@Html.DisplayFor(model => model.@GetValueExpression(property)) -
- } - } -}
-
-

-@{ - string pkName = GetPrimaryKeyName(); - if (pkName != null) - { - @:@Edit | - @:Back to List - } - else - { - @:@@Html.ActionLink(@Edit, "Edit", new { /* id = Model.PrimaryKey */ }) | - @:Back to List - } -}

-@{ - if (!Model.IsPartialView && !Model.IsLayoutPageSelected) - { - //ClearIndent(); -@: -@: - } -} -@functions -{ - string GetPrimaryKeyName() - { - return (Model.ModelMetadata.PrimaryKeys != null && Model.ModelMetadata.PrimaryKeys.Length == 1) - ? Model.ModelMetadata.PrimaryKeys[0].PropertyName - : null; - } - - string GetValueExpression(PropertyMetadata property) - { - //Todo: Get the association for the property and use that. - return property.PropertyName; - } -} diff --git a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Edit.cshtml b/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Edit.cshtml deleted file mode 100644 index 6437586f..00000000 --- a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/Edit.cshtml +++ /dev/null @@ -1,149 +0,0 @@ -@inherits Microsoft.Extensions.CodeGeneration.Templating.RazorTemplateBase -@using Microsoft.Extensions.CodeGeneration.EntityFramework -@@model @Model.ViewDataTypeName - -@{ - if (Model.IsPartialView) - { - } - else if (Model.IsLayoutPageSelected) - { -@:@@{ - @:ViewData["Title"] = @@Model.ViewName; - if (!string.IsNullOrEmpty(Model.LayoutPageFile)) - { - @:Layout = "@Model.LayoutPageFile"; - } -@:} -@: -@:

@@Model.ViewName

-@: - } - else - { -@:@@{ - @:Layout = "null"; -@:} -@: -@: -@: -@: -@: - @: - @:@@Model.ViewName -@: -@: -@: - // PushIndent(" "); - } -@:
- @:
- @:

@Model.ViewDataTypeShortName

- @:
- @:
- foreach (PropertyMetadata property in Model.ModelMetadata.Properties) - { - if (property.Scaffold) - { - if (property.IsPrimaryKey) - { - @: - continue; - } - if (property.IsReadOnly) - { - continue; - } - - if (property.IsForeignKey) - { - @:
- @: - @:
- @: - @: - @:
- @:
- continue; - } - - bool isCheckbox = property.TypeName.Equals("System.Boolean"); - if (isCheckbox) - { - @:
- @:
- @:
- @: - @: - @:
- @:
- @:
- } - else if (property.IsEnum && !property.IsEnumFlags) - { - @:
- @: - @:
- @: - @: - @:
- @:
- } - else - { - @:
- @: - @:
- @: - @: - @:
- @:
- } - } - } -} -
-
- -
-
-
-
- -
- Back to List -
- -@{ - if (Model.ReferenceScriptLibraries && (Model.IsLayoutPageSelected || Model.IsPartialView)) - { -@:@@section Scripts { - @: - @: - @: -@:} - } - // The following code closes the tag used in the case of a view using a layout page and the body and html tags in the case of a regular view page - if (!Model.IsPartialView && !Model.IsLayoutPageSelected) - { - if (Model.ReferenceScriptLibraries) - { -@:@@section Scripts { - @: - @: - @: -@:} - //ClearIndent(); - } -@: -@: - } -} -@functions -{ - string GetAssociationName(PropertyMetadata property) - { - //Todo: Implement properly. - return property.PropertyName; - } -} diff --git a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/List.cshtml b/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/List.cshtml deleted file mode 100644 index a2e66ae2..00000000 --- a/scripts/configure/tools/mvc-code-generators/new-templates/ViewGenerator/List.cshtml +++ /dev/null @@ -1,115 +0,0 @@ -@inherits Microsoft.Extensions.CodeGeneration.Templating.RazorTemplateBase -@using Microsoft.Extensions.CodeGeneration.EntityFramework -@@model @GetEnumerableTypeExpression(Model.ViewDataTypeName) - -@{ - if (Model.IsPartialView) - { - } - else if (Model.IsLayoutPageSelected) - { -@:@@{ - @:ViewData["Title"] = @@Model.ViewName; - if (!string.IsNullOrEmpty(Model.LayoutPageFile)) - { - @:Layout = "@Model.LayoutPageFile"; - } -@:} -@: -@:

@@Model.ViewName

-@: - } - else - { -@:@@{ - @:Layout = "null"; -@:} -@: -@: -@: -@: -@: - @: - @:@@Model.ViewName -@: -@: - // PushIndent(" "); - } -@:

- @:Create New -@:

-@: - @: - IEnumerable properties = Model.ModelMetadata.Properties; - foreach (var property in properties) - { - if (property.Scaffold && !property.IsPrimaryKey && !property.IsForeignKey) - { - - } - } - @: - @: - @: -@:@@foreach (var item in Model) { - @: - foreach (PropertyMetadata property in properties) - { - if (property.Scaffold && !property.IsPrimaryKey && !property.IsForeignKey) - { - - } - } - - string pkName = GetPrimaryKeyName(); - if (pkName != null) - { - @: - } - else - { - - } - @: -@:} - -@:
- @@Html.DisplayNameFor(model => model.@GetValueExpression(property)) -
- @@Html.DisplayFor(modelItem => item.@GetValueExpression(property)) - - @:@Edit | - @:@Details | - @:@Delete - @: - @@Html.ActionLink("Edit", "Edit",new { /* id=item.PrimaryKey */ }) | - @@Html.ActionLink("Details", "Details", new { /* id=item.PrimaryKey */ }) | - @@Html.ActionLink("Delete", "Delete", new { /* id=item.PrimaryKey */ }) -
- if(!Model.IsPartialView && !Model.IsLayoutPageSelected) - { - //ClearIndent(); -@: -@: - } -} -@functions -{ - string GetPrimaryKeyName() - { - return (Model.ModelMetadata.PrimaryKeys != null && Model.ModelMetadata.PrimaryKeys.Length == 1) - ? Model.ModelMetadata.PrimaryKeys[0].PropertyName - : null; - } - - string GetValueExpression(PropertyMetadata property) - { - //Todo: Get the association for the property and use that. - return property.PropertyName; - } - - string GetEnumerableTypeExpression(string typeName) - { - return "IEnumerable<" + typeName + ">"; - } -} diff --git a/scripts/make/Makefile b/scripts/make/Makefile deleted file mode 100644 index 76584c73..00000000 --- a/scripts/make/Makefile +++ /dev/null @@ -1,78 +0,0 @@ -include versioning.mk - - -REPO_ROOT=../../../src - -SUBDIRS=Yavsc Yavsc.Server Yavsc.Abstract OAuth.AspNet.AuthServer OAuth.AspNet.Token cli test - -all: $(SUBDIRS) - -Yavsc.Abstract: - $(MAKE) -C $(REPO_ROOT)/Yavsc.Abstract VERSION=$(VERSION) - -OAuth.AspNet.Token: - $(MAKE) -C $(REPO_ROOT)/OAuth.AspNet.Token VERSION=$(VERSION) - -OAuth.AspNet.AuthServer: OAuth.AspNet.Token - $(MAKE) -C $(REPO_ROOT)/OAuth.AspNet.AuthServer VERSION=$(VERSION) - -Yavsc.Server: Yavsc.Abstract - $(MAKE) -C $(REPO_ROOT)/Yavsc.Server VERSION=$(VERSION) - -Yavsc: Yavsc.Server OAuth.AspNet.AuthServer OAuth.AspNet.Token - make -C $(REPO_ROOT)/Yavsc VERSION=$(VERSION) - -Yavsc-deploy-pkg: Yavsc - make -C $(REPO_ROOT)/Yavsc deploy-pkg - -Yavsc.Server-deploy-pkg: Yavsc.Server - make -C $(REPO_ROOT)/Yavsc.Server deploy-pkg - -Yavsc.Abstract-deploy-pkg: Yavsc.Abstract - make -C $(REPO_ROOT)/Yavsc.Abstract deploy-pkg - -cli-deploy-pkg: cli check - make -C $(REPO_ROOT)/cli deploy-pkg - -cli: Yavsc-deploy-pkg Yavsc.Server-deploy-pkg Yavsc.Abstract-deploy-pkg - make -C $(REPO_ROOT)/cli - -undoLocalYavscNugetDeploy: - rm -rf ../../../packages/Yavsc.Abstract - rm -rf ../../../packages/Yavsc.Server - rm -rf ../../../packages/Yavsc - rm -rf ~/.dnx/packages/Yavsc.Abstract - rm -rf ~/.dnx/packages/Yavsc.Server - rm -rf ~/.dnx/packages/Yavsc - -check: cli - make -C $(REPO_ROOT)/cli check - make -C $(REPO_ROOT)/test - -test: - make -C $(REPO_ROOT)/test - -pushInPre: - make -C $(REPO_ROOT)/Yavsc pushInPre - -pushInProd: - make -C $(REPO_ROOT)/Yavsc pushInProd - -deploy-pkgs: Yavsc-deploy-pkg Yavsc.Server-deploy-pkg Yavsc.Abstract-deploy-pkg cli-deploy-pkg - -memo: - vim ~/TODO.md - -rc-num: - @echo echo 1-alpha1 < $< ^ $^ @ $@ - -clean: - for subdir in $(SUBDIRS) ; do \ - make -C $(REPO_ROOT)/$${subdir} clean ; \ - done - -watch: - make -C $(REPO_ROOT)/Yavsc watch - -.PHONY: all $(SUBDIRS) - diff --git a/scripts/make/dnx.mk b/scripts/make/dnx.mk deleted file mode 100644 index 9a5a8a58..00000000 --- a/scripts/make/dnx.mk +++ /dev/null @@ -1,71 +0,0 @@ -# Common defs -# - -ifndef PRJNAME -PRJNAME := $(shell basename `pwd -P`) -endif -FRAMEWORK=dnx451 -ASPNET_ENV=Development -ASPNET_LOG_LEVEL=Debug -HOSTING=localhost -HOSTADMIN=root -FRAMEWORKALIAS=dnx451 -# nuget package destination, at generation time -BINTARGET=$(PRJNAME).dll -BINTARGETPATH=bin/$(CONFIGURATION)/$(FRAMEWORKALIAS)/$(BINTARGET) -PKGFILENAME=$(PRJNAME).$(VERSION).nupkg -dnu=dnu - -# OBS SUBDIRS=Yavsc.Server Yavsc.Abstract Yavsc cli -# - -# Git commit hash, in order to not publish some uncrontrolled code in production environment -# - -git_status := $(shell git status -s --porcelain |wc -l) - -all: $(BINTARGETPATH) - -fixSystemXML: - @# fixing package id reference case, to System.Xml, from package NJsonSchema.CodeGeneration.CSharp - @sed 's/System.XML/System.Xml/' project.lock.json > project.lock.json.new && mv project.lock.json.new project.lock.json - -restore: - touch project.json - $(dnu) restore --ignore-failed-sources - -project.lock.json: project.json - $(dnu) restore --ignore-failed-sources - -watch: project.lock.json - MONO_OPTIONS=--debug MONO_MANAGED_WATCHER=enabled ASPNET_ENV=$(ASPNET_ENV) ASPNET_LOG_LEVEL=$(ASPNET_LOG_LEVEL) dnx-watch web --configuration=$(CONFIGURATION) - -clean: - rm -rf bin obj - rm project.lock.json - -cleanoutput: - rm -rf bin/$(CONFIGURATION) - rm -rf bin/output - -$(BINTARGETPATH): project.lock.json rc-num.txt-check - $(dnu) build --configuration=$(CONFIGURATION) - -# Default target, from one level sub dirs - -bin/output: - $(dnu) publish - -bin/output/wwwroot/version: bin/output - @echo $(version) > bin/output/wwwroot/version - -pack: $(BINTARGETPATH) ../../version.txt - dnu pack --configuration $(CONFIGURATION) - -push: pack - @echo push to source: $(ISNSOURCE) - isn push -s $(ISNSOURCE) -k $(NUGETSOURCEAPIKEY) src/$(PRJNAME)/bin/$(CONFIGURATION)/$(PRJNAME).*.nupkg - -.PHONY: rc-num.txt-check - -# .DEFAULT_GOAL := $(BINTARGETPATH) diff --git a/scripts/make/msbuild.mk b/scripts/make/msbuild.mk deleted file mode 100644 index d6d260f8..00000000 --- a/scripts/make/msbuild.mk +++ /dev/null @@ -1,16 +0,0 @@ - - -MSBUILD=msbuild -MONO=mono -CONFIGURATION=Debug -BINTYPE=exe -PRJNAME := $(shell basename `pwd -P`) - -rc_num := $(shell cat ../../rc-num.txt) -VERSION=1.0.5-rc$(rc_num) - -BINTARGET=$(PRJNAME).$(BINTYPE) -BINTARGETPATH=bin/$(CONFIGURATION)/$(BINTARGET) -ISNSOURCE=$(HOME)/Nupkgs -PKGFILENAME=$(PRJNAME).$(VERSION).nupkg - diff --git a/scripts/make/versioning.mk b/scripts/make/versioning.mk deleted file mode 100644 index 2adc45d2..00000000 --- a/scripts/make/versioning.mk +++ /dev/null @@ -1,16 +0,0 @@ - -ifndef PRJNAME -PRJNAME := $(shell basename `pwd -P`) -endif -version := $(shell cat ../../version.txt) -MAKE=make -ISNSOURCE=$(HOME)/Nupkgs -VERSION=$(version) -CONFIGURATION=Debug - -version-check: -ifndef version - @echo no version number specification ... please, could you try and run 'echo 1.2.3 > ../../version.txt' ?. -else - @echo 'Got version number : $(version)' -endif diff --git a/scripts/version.sh b/scripts/version.sh deleted file mode 100755 index f6e09210..00000000 --- a/scripts/version.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -version="$1" -major=0 -minor=0 -build=0 - -# break down the version number into it's components -regex="([0-9]+).([0-9]+).([0-9]+)((-[A-Za-z]+)([0-9]+))?" -if [[ $version =~ $regex ]]; then - major="${BASH_REMATCH[1]}" - minor="${BASH_REMATCH[2]}" - build="${BASH_REMATCH[3]}" - patchtype="${BASH_REMATCH[5]}" - patchnum="${BASH_REMATCH[6]}" -fi - -# check paramater to see which number to increment -if [[ "$2" == "feature" ]]; then - minor=$(echo $minor + 1 | bc) - build=0 - patchtype= - patchnum= -elif [[ "$2" == "build" ]]; then - build=$(echo $build + 1 | bc) - patchtype= - patchnum= -elif [[ "$2" == "major" ]]; then - major=$(echo $major+1 | bc) - minor=0 - build=0 - patchtype= - patchnum= -elif [[ "$2" == "patch" ]]; then - patchnum=$(echo $patchnum + 1 | bc) -else - echo "usage: ./version.sh version_number [major/feature/build/patch]" >&2 - - exit -1 -fi - -# echo the new version number -echo "${major}.${minor}.${build}${patchtype}${patchnum}" - diff --git a/src/Api/Api.csproj b/src/Api/Api.csproj new file mode 100644 index 00000000..6e024e9b --- /dev/null +++ b/src/Api/Api.csproj @@ -0,0 +1,12 @@ + + + net8.0 + enable + enable + 1c73094f-959f-4211-b1a1-6a69b236c283 + + + + + + diff --git a/src/Yavsc/ApiControllers/Blogspot/BlogApiController.cs b/src/Api/Controllers/Blogspot/BlogApiController.cs similarity index 91% rename from src/Yavsc/ApiControllers/Blogspot/BlogApiController.cs rename to src/Api/Controllers/Blogspot/BlogApiController.cs index 6df54178..66389352 100644 --- a/src/Yavsc/ApiControllers/Blogspot/BlogApiController.cs +++ b/src/Api/Controllers/Blogspot/BlogApiController.cs @@ -27,7 +27,7 @@ namespace Yavsc.Controllers [HttpGet] public IEnumerable GetBlogspot() { - return _context.Blogspot.Where(b => b.Visible).OrderByDescending(b => b.UserModified); + return _context.BlogSpot.Where(b => b.Visible).OrderByDescending(b => b.UserModified); } // GET: api/BlogApi/5 @@ -39,7 +39,7 @@ namespace Yavsc.Controllers return BadRequest(ModelState); } - BlogPost blog = _context.Blogspot.Single(m => m.Id == id); + BlogPost blog = _context.BlogSpot.Single(m => m.Id == id); if (blog == null) { @@ -93,7 +93,7 @@ namespace Yavsc.Controllers return BadRequest(ModelState); } - _context.Blogspot.Add(blog); + _context.BlogSpot.Add(blog); try { _context.SaveChanges(User.GetUserId()); @@ -122,13 +122,13 @@ namespace Yavsc.Controllers return BadRequest(ModelState); } - BlogPost blog = _context.Blogspot.Single(m => m.Id == id); + BlogPost blog = _context.BlogSpot.Single(m => m.Id == id); if (blog == null) { return NotFound(); } - _context.Blogspot.Remove(blog); + _context.BlogSpot.Remove(blog); _context.SaveChanges(User.GetUserId()); return Ok(blog); @@ -145,7 +145,7 @@ namespace Yavsc.Controllers private bool BlogExists(long id) { - return _context.Blogspot.Count(e => e.Id == id) > 0; + return _context.BlogSpot.Count(e => e.Id == id) > 0; } } } diff --git a/src/Yavsc/ApiControllers/Blogspot/BlogTagsApiController.cs b/src/Api/Controllers/Blogspot/BlogTagsApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Blogspot/BlogTagsApiController.cs rename to src/Api/Controllers/Blogspot/BlogTagsApiController.cs diff --git a/src/Yavsc/ApiControllers/Blogspot/CommentsApiController.cs b/src/Api/Controllers/Blogspot/CommentsApiController.cs similarity index 58% rename from src/Yavsc/ApiControllers/Blogspot/CommentsApiController.cs rename to src/Api/Controllers/Blogspot/CommentsApiController.cs index 879f0b43..41cdd95c 100644 --- a/src/Yavsc/ApiControllers/Blogspot/CommentsApiController.cs +++ b/src/Api/Controllers/Blogspot/CommentsApiController.cs @@ -1,12 +1,15 @@ +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Internal; using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.Blog; namespace Yavsc.Controllers { + [Authorize] [Produces("application/json")] [Route("api/blogcomments")] public class CommentsApiController : Controller @@ -18,14 +21,6 @@ namespace Yavsc.Controllers _context = context; } - // GET: api/CommentsApi - [HttpGet] - public IEnumerable GetComment() - { - return _context.Comment; - } - - // GET: api/CommentsApi/5 [HttpGet("{id}", Name = "GetComment")] public async Task GetComment([FromRoute] long id) { @@ -43,65 +38,46 @@ namespace Yavsc.Controllers return Ok(comment); } - - // PUT: api/CommentsApi/5 - [HttpPut("{id}")] - public async Task PutComment([FromRoute] long id, [FromBody] Comment comment) - { - if (!ModelState.IsValid) - { - return BadRequest(ModelState); - } - - if (id != comment.Id) - { - return BadRequest(); - } - - _context.Entry(comment).State = EntityState.Modified; - - try - { - await _context.SaveChangesAsync(User.GetUserId()); - } - catch (DbUpdateConcurrencyException) - { - if (!CommentExists(id)) - { - return NotFound(); - } - else - { - throw; - } - } - - return new StatusCodeResult(StatusCodes.Status204NoContent); - } - - // POST: api/CommentsApi [HttpPost] - public async Task PostComment([FromBody] Comment comment) + public async Task Post([FromBody] CommentPost post) { if (!ModelState.IsValid) { return new BadRequestObjectResult(ModelState); } - if (!User.IsInRole(Constants.AdminGroupName)) + var article = await _context.BlogSpot.FirstOrDefaultAsync + (p=> p.Id == post.ReceiverId); + + if (article==null) { + ModelState.AddModelError("ReceiverId", "not found"); + return BadRequest(ModelState); + } + if (post.ParentId!=null) { - if (User.GetUserId()!=comment.AuthorId) { - ModelState.AddModelError("Content","Vous ne pouvez pas poster au nom d'un autre."); - return new BadRequestObjectResult(ModelState); + var parentExists = _context.Comment.Any(c => c.Id == post.ParentId); + if (!parentExists) + { + ModelState.AddModelError("ParentId", "not found"); + return BadRequest(ModelState); } } - _context.Comment.Add(comment); + string uid = User.GetUserId(); + Comment c = new Comment{ + ReceiverId = post.ReceiverId, + Content = post.Content, + ParentId = post.ParentId, + AuthorId = uid, + UserModified = uid + }; + + _context.Comment.Add(c); try { - await _context.SaveChangesAsync(User.GetUserId()); + await _context.SaveChangesAsync(uid); } catch (DbUpdateException) { - if (CommentExists(comment.Id)) + if (CommentExists(c.Id)) { return new StatusCodeResult(StatusCodes.Status409Conflict); } @@ -110,12 +86,12 @@ namespace Yavsc.Controllers throw; } } - return CreatedAtRoute("GetComment", new { id = comment.Id }, comment); + return CreatedAtRoute("GetComment", new { id = c.Id }, new { id = c.Id, dateCreated = c.DateCreated }); } // DELETE: api/CommentsApi/5 [HttpDelete("{id}")] - public async Task DeleteComment([FromRoute] long id) + public async Task Delete([FromRoute] long id) { if (!ModelState.IsValid) { @@ -135,7 +111,8 @@ namespace Yavsc.Controllers } private void RemoveRecursive (Comment comment) { - var children = _context.Comment.Where(c=>c.ParentId==comment.Id).ToList(); + var children = _context.Comment.Where + (c=>c.ParentId==comment.Id).ToList(); foreach (var child in children) { RemoveRecursive(child); } diff --git a/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs b/src/Api/Controllers/Blogspot/FileSystemApiController.cs similarity index 99% rename from src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs rename to src/Api/Controllers/Blogspot/FileSystemApiController.cs index 5a7f2251..2dc63d59 100644 --- a/src/Yavsc/ApiControllers/Blogspot/FileSystemApiController.cs +++ b/src/Api/Controllers/Blogspot/FileSystemApiController.cs @@ -9,11 +9,13 @@ namespace Yavsc.ApiControllers using System.Threading.Tasks; using Microsoft.Extensions.Logging; using Yavsc.Helpers; - using Yavsc.Exceptions; using Yavsc.Models.FileSystem; using System.ComponentModel.DataAnnotations; using Yavsc.Attributes.Validation; using System.IO; + using Yavsc.Exceptions; + using Yavsc.Server.Helpers; + using Yavsc.Abstract.Helpers; [Authorize,Route("api/fs")] public partial class FileSystemApiController : Controller diff --git a/src/Yavsc/ApiControllers/Blogspot/FileSystemStream.cs b/src/Api/Controllers/Blogspot/FileSystemStream.cs similarity index 99% rename from src/Yavsc/ApiControllers/Blogspot/FileSystemStream.cs rename to src/Api/Controllers/Blogspot/FileSystemStream.cs index af80fe7d..e6b3c159 100644 --- a/src/Yavsc/ApiControllers/Blogspot/FileSystemStream.cs +++ b/src/Api/Controllers/Blogspot/FileSystemStream.cs @@ -8,6 +8,7 @@ using Yavsc.Models; using Yavsc.Models.Messaging; using Yavsc.Services; using Microsoft.AspNetCore.SignalR; +using Yavsc.Server.Helpers; namespace Yavsc.ApiControllers { diff --git a/src/Yavsc/ApiControllers/Blogspot/MoveFileQuery.cs b/src/Api/Controllers/Blogspot/MoveFileQuery.cs similarity index 100% rename from src/Yavsc/ApiControllers/Blogspot/MoveFileQuery.cs rename to src/Api/Controllers/Blogspot/MoveFileQuery.cs diff --git a/src/Yavsc/ApiControllers/Blogspot/PostTagsApiController.cs b/src/Api/Controllers/Blogspot/PostTagsApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Blogspot/PostTagsApiController.cs rename to src/Api/Controllers/Blogspot/PostTagsApiController.cs diff --git a/src/Yavsc/ApiControllers/Blogspot/TagsApiController.cs b/src/Api/Controllers/Blogspot/TagsApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Blogspot/TagsApiController.cs rename to src/Api/Controllers/Blogspot/TagsApiController.cs diff --git a/src/Yavsc/ApiControllers/Blogspot/TestApiController.cs b/src/Api/Controllers/Blogspot/TestApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Blogspot/TestApiController.cs rename to src/Api/Controllers/Blogspot/TestApiController.cs diff --git a/src/Yavsc/ApiControllers/Business/ActivityApiController.cs b/src/Api/Controllers/Business/ActivityApiController.cs similarity index 99% rename from src/Yavsc/ApiControllers/Business/ActivityApiController.cs rename to src/Api/Controllers/Business/ActivityApiController.cs index c661857a..709fab7a 100644 --- a/src/Yavsc/ApiControllers/Business/ActivityApiController.cs +++ b/src/Api/Controllers/Business/ActivityApiController.cs @@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.EntityFrameworkCore; -using Yavsc.Helpers; +using Yavsc.Api.Helpers; using Yavsc.Models; using Yavsc.Models.Workflow; diff --git a/src/Yavsc/ApiControllers/Business/BillingController.cs b/src/Api/Controllers/Business/BillingController.cs similarity index 99% rename from src/Yavsc/ApiControllers/Business/BillingController.cs rename to src/Api/Controllers/Business/BillingController.cs index 2a27f418..5ab4a332 100644 --- a/src/Yavsc/ApiControllers/Business/BillingController.cs +++ b/src/Api/Controllers/Business/BillingController.cs @@ -12,9 +12,10 @@ namespace Yavsc.ApiControllers using Services; using Models.Messaging; - using ViewModels.Auth; using Microsoft.Extensions.Options; using Microsoft.EntityFrameworkCore; + using Yavsc.ViewModels.Auth; + using Yavsc.Server.Helpers; [Route("api/bill"), Authorize] public class BillingController : Controller diff --git a/src/Yavsc/ApiControllers/Business/BookQueryApiController.cs b/src/Api/Controllers/Business/BookQueryApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Business/BookQueryApiController.cs rename to src/Api/Controllers/Business/BookQueryApiController.cs diff --git a/src/Yavsc/ApiControllers/Business/EstimateApiController.cs b/src/Api/Controllers/Business/EstimateApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Business/EstimateApiController.cs rename to src/Api/Controllers/Business/EstimateApiController.cs diff --git a/src/Yavsc/ApiControllers/Business/EstimateTemplatesApiController.cs b/src/Api/Controllers/Business/EstimateTemplatesApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Business/EstimateTemplatesApiController.cs rename to src/Api/Controllers/Business/EstimateTemplatesApiController.cs diff --git a/src/Yavsc/ApiControllers/Business/FrontOfficeApiController.cs b/src/Api/Controllers/Business/FrontOfficeApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Business/FrontOfficeApiController.cs rename to src/Api/Controllers/Business/FrontOfficeApiController.cs diff --git a/src/Yavsc/ApiControllers/Business/PaymentApiController.cs b/src/Api/Controllers/Business/PaymentApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Business/PaymentApiController.cs rename to src/Api/Controllers/Business/PaymentApiController.cs diff --git a/src/Yavsc/ApiControllers/Business/PerformersApiController.cs b/src/Api/Controllers/Business/PerformersApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Business/PerformersApiController.cs rename to src/Api/Controllers/Business/PerformersApiController.cs diff --git a/src/Yavsc/ApiControllers/Business/ProductApiController.cs b/src/Api/Controllers/Business/ProductApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Business/ProductApiController.cs rename to src/Api/Controllers/Business/ProductApiController.cs diff --git a/src/Yavsc/ApiControllers/DimissClicksApiController.cs b/src/Api/Controllers/DimissClicksApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/DimissClicksApiController.cs rename to src/Api/Controllers/DimissClicksApiController.cs diff --git a/src/Yavsc/ApiControllers/HairCut/BursherProfilesApiController.cs b/src/Api/Controllers/HairCut/BursherProfilesApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/HairCut/BursherProfilesApiController.cs rename to src/Api/Controllers/HairCut/BursherProfilesApiController.cs diff --git a/src/Yavsc/ApiControllers/HairCut/HairCutController.cs b/src/Api/Controllers/HairCut/HairCutController.cs similarity index 100% rename from src/Yavsc/ApiControllers/HairCut/HairCutController.cs rename to src/Api/Controllers/HairCut/HairCutController.cs diff --git a/src/Yavsc/ApiControllers/HyperLinkApiController.cs b/src/Api/Controllers/HyperLinkApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/HyperLinkApiController.cs rename to src/Api/Controllers/HyperLinkApiController.cs diff --git a/src/Yavsc/ApiControllers/IT/GitRefsApiController.cs b/src/Api/Controllers/IT/GitRefsApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/IT/GitRefsApiController.cs rename to src/Api/Controllers/IT/GitRefsApiController.cs diff --git a/src/Yavsc/ApiControllers/MailTemplatingApiController.cs b/src/Api/Controllers/MailTemplatingApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/MailTemplatingApiController.cs rename to src/Api/Controllers/MailTemplatingApiController.cs diff --git a/src/Yavsc/ApiControllers/MailingTemplateApiController.cs b/src/Api/Controllers/MailingTemplateApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/MailingTemplateApiController.cs rename to src/Api/Controllers/MailingTemplateApiController.cs diff --git a/src/Yavsc/ApiControllers/Musical/DjProfileApiController.cs b/src/Api/Controllers/Musical/DjProfileApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Musical/DjProfileApiController.cs rename to src/Api/Controllers/Musical/DjProfileApiController.cs diff --git a/src/Yavsc/ApiControllers/Musical/MusicalPreferencesApiController.cs b/src/Api/Controllers/Musical/MusicalPreferencesApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Musical/MusicalPreferencesApiController.cs rename to src/Api/Controllers/Musical/MusicalPreferencesApiController.cs diff --git a/src/Yavsc/ApiControllers/Musical/MusicalTendenciesApiController.cs b/src/Api/Controllers/Musical/MusicalTendenciesApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Musical/MusicalTendenciesApiController.cs rename to src/Api/Controllers/Musical/MusicalTendenciesApiController.cs diff --git a/src/Yavsc/ApiControllers/Musical/PodcastController.cs b/src/Api/Controllers/Musical/PodcastController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Musical/PodcastController.cs rename to src/Api/Controllers/Musical/PodcastController.cs diff --git a/src/Yavsc/ApiControllers/NativeConfidentialController.cs b/src/Api/Controllers/NativeConfidentialController.cs similarity index 100% rename from src/Yavsc/ApiControllers/NativeConfidentialController.cs rename to src/Api/Controllers/NativeConfidentialController.cs diff --git a/src/Yavsc/ApiControllers/PostRateApiController.cs b/src/Api/Controllers/PostRateApiController.cs similarity index 92% rename from src/Yavsc/ApiControllers/PostRateApiController.cs rename to src/Api/Controllers/PostRateApiController.cs index 25bb4341..a989587d 100644 --- a/src/Yavsc/ApiControllers/PostRateApiController.cs +++ b/src/Api/Controllers/PostRateApiController.cs @@ -27,7 +27,7 @@ namespace Yavsc.Controllers return BadRequest(ModelState); } - Models.Blog.BlogPost blogpost = _context.Blogspot.Single(x=>x.Id == id); + Models.Blog.BlogPost blogpost = _context.BlogSpot.Single(x=>x.Id == id); if (blogpost == null) { @@ -39,7 +39,6 @@ namespace Yavsc.Controllers if (!User.IsInRole(Constants.AdminGroupName)) return BadRequest(); - blogpost.Rate = rate; _context.SaveChanges(User.GetUserId()); return Ok(); diff --git a/src/Yavsc/ApiControllers/ProfileApiController.cs b/src/Api/Controllers/ProfileApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/ProfileApiController.cs rename to src/Api/Controllers/ProfileApiController.cs diff --git a/src/Yavsc/ApiControllers/Relationship/BlackListApiController.cs b/src/Api/Controllers/Relationship/BlackListApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Relationship/BlackListApiController.cs rename to src/Api/Controllers/Relationship/BlackListApiController.cs diff --git a/src/Yavsc/ApiControllers/Relationship/BlogAclApiController.cs b/src/Api/Controllers/Relationship/BlogAclApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Relationship/BlogAclApiController.cs rename to src/Api/Controllers/Relationship/BlogAclApiController.cs diff --git a/src/Yavsc/ApiControllers/Relationship/ChatApiController.cs b/src/Api/Controllers/Relationship/ChatApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Relationship/ChatApiController.cs rename to src/Api/Controllers/Relationship/ChatApiController.cs diff --git a/src/Yavsc/ApiControllers/Relationship/ChatRoomAccessApiController.cs b/src/Api/Controllers/Relationship/ChatRoomAccessApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Relationship/ChatRoomAccessApiController.cs rename to src/Api/Controllers/Relationship/ChatRoomAccessApiController.cs diff --git a/src/Yavsc/ApiControllers/Relationship/ChatRoomApiController.cs b/src/Api/Controllers/Relationship/ChatRoomApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Relationship/ChatRoomApiController.cs rename to src/Api/Controllers/Relationship/ChatRoomApiController.cs diff --git a/src/Yavsc/ApiControllers/Relationship/CircleApiController.cs b/src/Api/Controllers/Relationship/CircleApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Relationship/CircleApiController.cs rename to src/Api/Controllers/Relationship/CircleApiController.cs diff --git a/src/Yavsc/ApiControllers/Relationship/ContactsApiController.cs b/src/Api/Controllers/Relationship/ContactsApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Relationship/ContactsApiController.cs rename to src/Api/Controllers/Relationship/ContactsApiController.cs diff --git a/src/Yavsc/ApiControllers/ServiceApiController.cs b/src/Api/Controllers/ServiceApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/ServiceApiController.cs rename to src/Api/Controllers/ServiceApiController.cs diff --git a/src/Yavsc/ApiControllers/Survey/BugApiController.cs b/src/Api/Controllers/Survey/BugApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/Survey/BugApiController.cs rename to src/Api/Controllers/Survey/BugApiController.cs diff --git a/src/Api/Controllers/accounting/AccountController.cs b/src/Api/Controllers/accounting/AccountController.cs new file mode 100644 index 00000000..c1bb811a --- /dev/null +++ b/src/Api/Controllers/accounting/AccountController.cs @@ -0,0 +1,86 @@ +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; + +using Yavsc.Models; +using Yavsc.Api.Helpers; +using Yavsc.Server.Helpers; + +namespace Yavsc.WebApi.Controllers +{ + [Route("~/api/account")] + [Authorize("ApiScope")] + public class ApiAccountController : Controller + { + readonly ApplicationDbContext _dbContext; + private readonly ILogger _logger; + + public ApiAccountController( + ILoggerFactory loggerFactory, ApplicationDbContext dbContext) + { + _logger = loggerFactory.CreateLogger(nameof(ApiAccountController)); + _dbContext = dbContext; + } + + [HttpGet("me")] + public async Task Me() + { + if (User == null) + return new BadRequestObjectResult( + new { error = "user not found" }); + var uid = User.GetUserId(); + + var userData = await GetUserData(uid); + + var user = new Yavsc.Models.Auth.Me(userData.Id, userData.UserName, userData.Email, + userData.Avatar, + userData.PostalAddress, userData.DedicatedGoogleCalendar); + + var userRoles = _dbContext.UserRoles.Where(u => u.UserId == uid).Select(r => r.RoleId).ToArray(); + + IdentityRole[] roles = _dbContext.Roles.Where(r => userRoles.Contains(r.Id)).ToArray(); + + user.Roles = roles.Select(r => r.Name).ToArray(); + + return Ok(user); + } + + private async Task GetUserData(string uid) + { + return await _dbContext.Users + .Include(u => u.PostalAddress) + .Include(u => u.AccountBalance) + .FirstAsync(u => u.Id == uid); + } + + [HttpGet("myhost")] + public IActionResult MyHost () + { + return Ok(new { host = Request.ForHost() }); + } + + + /// + /// Updates the avatar + /// + /// + [HttpPost("~/api/setavatar")] + public async Task SetAvatar() + { + var root = User.InitPostToFileSystem(null); + var user = await GetUserData(User.GetUserId()); + if (Request.Form.Files.Count!=1) + return new BadRequestResult(); + var info = user.ReceiveAvatar(Request.Form.Files[0]); + await _dbContext.SaveChangesAsync(); + return Ok(info); + } + + [HttpGet("identity")] + public async Task Identity() + { + return Json(User.Claims.Select(c=>new {c.Type, c.Value})); + } + } +} diff --git a/src/Yavsc/ApiControllers/accounting/ApplicationUserApiController.cs b/src/Api/Controllers/accounting/ApplicationUserApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/accounting/ApplicationUserApiController.cs rename to src/Api/Controllers/accounting/ApplicationUserApiController.cs diff --git a/src/Yavsc/ApiControllers/accounting/ProfileApiController.cs b/src/Api/Controllers/accounting/ProfileApiController.cs similarity index 100% rename from src/Yavsc/ApiControllers/accounting/ProfileApiController.cs rename to src/Api/Controllers/accounting/ProfileApiController.cs diff --git a/src/Yavsc/Helpers/RequestHelpers.cs b/src/Api/Helpers/RequestHelpers.cs similarity index 96% rename from src/Yavsc/Helpers/RequestHelpers.cs rename to src/Api/Helpers/RequestHelpers.cs index 96f060c3..2c2fae27 100644 --- a/src/Yavsc/Helpers/RequestHelpers.cs +++ b/src/Api/Helpers/RequestHelpers.cs @@ -8,7 +8,7 @@ using Yavsc.ViewModels; using Yavsc.Models; using System.Linq; -namespace Yavsc.Helpers +namespace Yavsc.Api.Helpers { public static class RequestHelpers { diff --git a/src/Api/Helpers/UserHelpers.cs b/src/Api/Helpers/UserHelpers.cs new file mode 100644 index 00000000..2d480ea1 --- /dev/null +++ b/src/Api/Helpers/UserHelpers.cs @@ -0,0 +1,17 @@ +using System.Security.Claims; +using System.Collections.Generic; +using System.Linq; +using Microsoft.EntityFrameworkCore; +using Yavsc.Models; +using Yavsc.Models.Blog; + +namespace Yavsc.Api.Helpers +{ + public static class UserHelpers + { + public static string GetUserId(this ClaimsPrincipal user) + { + return user.FindFirstValue("http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier"); + } + } +} diff --git a/src/Api/Program.cs b/src/Api/Program.cs new file mode 100644 index 00000000..5ef8afde --- /dev/null +++ b/src/Api/Program.cs @@ -0,0 +1,113 @@ +/* + Copyright (c) 2024 HigginsSoft, Alexander Higgins - https://github.com/alexhiggins732/ + + Copyright (c) 2018, Brock Allen & Dominick Baier. All rights reserved. + + Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. + Source code and license this software can be found + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. +*/ + +using IdentityModel; +using Microsoft.AspNetCore.Identity; +using Microsoft.AspNetCore.Identity.EntityFrameworkCore; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Yavsc.Interface; +using Yavsc.Models; +using Yavsc.Services; + +internal class Program +{ + private static async Task Main(string[] args) + { + Console.Title = "API"; + + var builder = WebApplication.CreateBuilder(args); + + var services = builder.Services; + // builder.Services.AddDistributedMemoryCache(); + + // accepts any access token issued by identity server + // adds an authorization policy for scope 'scope1' + + services + .AddAuthorization(options => + { + options.AddPolicy("ApiScope", policy => + { + policy + .RequireAuthenticatedUser() + .RequireClaim(JwtClaimTypes.Scope, new string[] { "scope2" }); + }); + }) + .AddCors(options => + { + // this defines a CORS policy called "default" + options.AddPolicy("default", policy => + { + policy.WithOrigins("https://localhost:5003") + .AllowAnyHeader() + .AllowAnyMethod(); + }); + }) + .AddControllers(); + + // accepts any access token issued by identity server + var authenticationBuilder = services.AddAuthentication("Bearer") + .AddJwtBearer("Bearer", options => + { + options.IncludeErrorDetails = true; + options.Authority = "https://localhost:5001"; + options.TokenValidationParameters = + new() { ValidateAudience = false }; + }); + + services.AddDbContext(options => + options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"))); + + services.AddTransient() + .AddTransient() + .AddTransient(); + /* + services.AddSingleton(); + services.AddSingleton(); + services.AddTransient(); + services.AddIdentityApiEndpoints(); + services.AddSession(); + */ + using (var app = builder.Build()) + { + if (app.Environment.IsDevelopment()) + app.UseDeveloperExceptionPage(); + + app + .UseRouting() + .UseAuthentication() + .UseAuthorization() + .UseCors("default") + /* .UseEndpoints(endpoints => + { + endpoints.MapDefaultControllerRoute() + .RequireAuthorization(); + })*/ + + ; + // app.MapIdentityApi().RequireAuthorization("ApiScope"); + app.MapDefaultControllerRoute(); + app.MapGet("/identity", (HttpContext context) => + new JsonResult(context?.User?.Claims.Select(c => new { c.Type, c.Value })) + ); + + // app.UseSession(); + await app.RunAsync(); + } + ; + + + + + } +} diff --git a/src/Api/Properties/launchSettings.json b/src/Api/Properties/launchSettings.json new file mode 100644 index 00000000..e27c888f --- /dev/null +++ b/src/Api/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "https://localhost:5001", + "sslPort": 6001 + } + }, + "profiles": { + + "https": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": false, + "applicationUrl": "https://localhost:6001;", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/src/Api/appsettings.json b/src/Api/appsettings.json new file mode 100644 index 00000000..d9d9a9bf --- /dev/null +++ b/src/Api/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +} diff --git a/src/Api/tempkey.jwk b/src/Api/tempkey.jwk new file mode 100644 index 00000000..690a14ae --- /dev/null +++ b/src/Api/tempkey.jwk @@ -0,0 +1 @@ +{"AdditionalData":{},"Alg":"RS256","Crv":null,"D":"V1qxZgyKyWNi8FbeueGjfOae22fnDa0dU8YpTohrjn89bk9B8kvIzFJP9IPYThTLMaKCTFN09A3aVy_zhL5Cv2ebEqkZIpXkPmtvRavAYxoSQWUfN2czMok216KI7csVVk79csLnnO6i3pf0B9OgGwsuEsLR40_X4MTy5iTejZfwEVobN7H6_uylw5dEUjcJlR-RtuXAZz48stOLt8-y9it7rvowv8eHEsAFSaiV-g92rKZdvMdxVqW5dvHkqF4-h1gdp9VvStZYsqfnR8hrObSxom5yWFnpmxZKmaFaFxbF-k9T8YX1izuPzESPyKCUb-GX5_4sLB6vOiUO4drHiQ","DP":"7Vz77Jz00YuT87QDAEHuBl-GInvI2VT1Fg0HsUEUhBN_o1ZwqlgX6U_3yGUgYYvoWQZZQeLTxRiQSzymPxXiikKnmGt97zMypIllEOar284Ddypa4fraXSJwgKR-1UPYGZg1adjN3KDruLok3ahyUcD9375tCXmQ3Cs0QC1_ATs","DQ":"B5qgaCcQGleo-zZqWIjMCtyEyB4JBbPFtKk3uZ5KAV8lO-TQPJkohraRxInOUHoSS1O2hj1bUO1r-C29XJqrkhi2APGs2hu6V11cmAtwwhj5XPTnL_TNx314dK5ECEQ231gxidfod-6PknG20Qim7sacsj5OrJHfp9RnMZ2p4fk","E":"AQAB","K":null,"KeyId":"E7139A7A77AEA502B0482C026DCE5C59","KeyOps":[],"Kid":"E7139A7A77AEA502B0482C026DCE5C59","Kty":"RSA","N":"tL1q9Mon5IGTGYvBg_FmDoxy0HWQ0ceo6iZmDMzAkjYZ06KKdWoR7Up2ZJ7NrBnGpyrb1uR9qAJAAJm19SLKDKSrEUn5QcnTDMqVQLBurtXYw-eY2DL4cO0bbetc5_z8hyKUzikf6jJRRGfDSR2nEfXwUf3riYfYXtNgSmr_CsBwPUcH12JGad0bwsqJy7z9Tg2_pWvNR36Ba5qd_6VmkLQRGQuDTcHzwbagd3bl4Ma1bzxPULBiBENfj6srAxV-6gQhCJr3mIr1ZsJcZsrYuUnnBNgzYCZvkOkmyB68PlrV9C9xQO8aQfla2s42Uc12-UhBbreI0uBP_k8PXXXjXw","Oth":[],"P":"_jaZkNClDqxS8nddu2t6pgP596qJdzMAq11JVWAoDJV_9JRUZH2Qbq2CrDRUjRF9nxR2bVTglfzZ-bho-Iy9PqcWeVekLObiyR30zmUzoWCdUhmi-BRd3FF3uSteNPc7ohtuX4SrbbCoUR4BpcBAgHas8KKj80sIPpoYo10xK-s","Q":"tgKedcJQilsxEzRRbs8_XD4MxnsmrxqvccfvzzHkqqZMNI0CMGA41ddHiWdNcYsyzqIc-vCf6OGabD6Z7mzZXPbYsr1o4rIQXveUy3Ty3fD9YCRKgWbS9gTbXNGBFAglu3iyNl1XUCGc_DF8PImgk99pu9byPoIr6rAPhciaDV0","QI":"2wtLbwL9kODL6HoF5R8CFmf0Fz3gqoEetrq_I7wuK1pL2vmpZlzmURjvERhi5T6lD2L8SC1vY4AJ7NGzAncwn5ozpnos2s0YIxHYUixj5RuTWQLPKqk5r1bEORuju8KwfW6Nzc4K6Rhk3Lb3TXDvKi6BSf1URjLtiI8DUB_enxw","Use":null,"X":null,"X5c":[],"X5t":null,"X5tS256":null,"X5u":null,"Y":null,"KeySize":2048,"HasPrivateKey":true,"CryptoProviderFactory":{"CryptoProviderCache":{},"CustomCryptoProvider":null,"CacheSignatureProviders":true,"SignatureProviderObjectPoolCacheSize":16}} \ No newline at end of file diff --git a/src/Yavsc.Abstract/Attributes/Validation/ValidRemoteUserDirAttribute.cs b/src/Yavsc.Abstract/Attributes/Validation/ValidRemoteUserDirAttribute.cs index 2c59f689..43c44054 100644 --- a/src/Yavsc.Abstract/Attributes/Validation/ValidRemoteUserDirAttribute.cs +++ b/src/Yavsc.Abstract/Attributes/Validation/ValidRemoteUserDirAttribute.cs @@ -1,7 +1,7 @@ using System; using System.ComponentModel.DataAnnotations; -using Yavsc.Helpers; +using Yavsc.Server.Helpers; namespace Yavsc.Attributes.Validation { diff --git a/src/Yavsc.Abstract/Blogspot/IBlog.cs b/src/Yavsc.Abstract/Blogspot/IBlog.cs index 42af2f1a..9cc121a1 100644 --- a/src/Yavsc.Abstract/Blogspot/IBlog.cs +++ b/src/Yavsc.Abstract/Blogspot/IBlog.cs @@ -3,7 +3,7 @@ namespace Yavsc { - public interface IBlogPost : IBaseTrackedEntity, IIdentified, IRating, ITitle + public interface IBlogPost : ITrackedEntity, IIdentified, ITitle { string AuthorId { get; set; } string Content { get; set; } diff --git a/src/Yavsc.Abstract/Constants.cs b/src/Yavsc.Abstract/Constants.cs index 8a37bd29..b6c7bf2e 100644 --- a/src/Yavsc.Abstract/Constants.cs +++ b/src/Yavsc.Abstract/Constants.cs @@ -37,7 +37,7 @@ namespace Yavsc public const string FrontOfficeGroupName = "FrontOffice"; public const string DefaultAvatar = "/images/Users/icon_user.png"; public const string AnonAvatar = "/images/Users/icon_anon_user.png"; - public const string YavscConnectionStringEnvName = "YAVSC_DB_CONNECTION"; + public const string YavscConnectionStringEnvName = "DEFAULTCONNECTION_CONNECTIONSTRING"; // at the end, let 4*4 bytes in peace public const int WebSocketsMaxBufLen = 4096; @@ -54,5 +54,7 @@ namespace Yavsc public const string LivePath = "/live/cast"; public const string StreamingPath = "/api/stream/put"; + + public const string RoleClaimName = "http://schemas.microsoft.com/ws/2008/06/identity/claims/role"; } } diff --git a/src/Yavsc.Abstract/FileSystem/AbstractFileSystemHelpers.cs b/src/Yavsc.Abstract/FileSystem/AbstractFileSystemHelpers.cs index 0b4aefbb..5e571e24 100644 --- a/src/Yavsc.Abstract/FileSystem/AbstractFileSystemHelpers.cs +++ b/src/Yavsc.Abstract/FileSystem/AbstractFileSystemHelpers.cs @@ -4,7 +4,7 @@ using System.Linq; using System.Text; using Yavsc.ViewModels.UserFiles; -namespace Yavsc.Helpers +namespace Yavsc.Server.Helpers { public static class AbstractFileSystemHelpers { diff --git a/src/Yavsc.Abstract/FileSystem/FsOperationInfo.cs b/src/Yavsc.Abstract/FileSystem/FsOperationInfo.cs index ba748fbd..63c69cb4 100644 --- a/src/Yavsc.Abstract/FileSystem/FsOperationInfo.cs +++ b/src/Yavsc.Abstract/FileSystem/FsOperationInfo.cs @@ -1,4 +1,4 @@ -namespace Yavsc.Helpers +namespace Yavsc.Abstract.Helpers { public enum ErrorCode { NotFound, diff --git a/src/Yavsc.Abstract/FileSystem/UserDirectoryInfo.cs b/src/Yavsc.Abstract/FileSystem/UserDirectoryInfo.cs index 77b7e6e4..cced9397 100644 --- a/src/Yavsc.Abstract/FileSystem/UserDirectoryInfo.cs +++ b/src/Yavsc.Abstract/FileSystem/UserDirectoryInfo.cs @@ -2,7 +2,7 @@ using System; using System.IO; using System.Linq; using Yavsc.Abstract.FileSystem; -using Yavsc.Helpers; +using Yavsc.Server.Helpers; namespace Yavsc.ViewModels.UserFiles { diff --git a/src/Yavsc.Abstract/Identity/Security/ICircleAuthorized.cs b/src/Yavsc.Abstract/Identity/Security/ICircleAuthorized.cs index 7efd00ef..eb153ec2 100644 --- a/src/Yavsc.Abstract/Identity/Security/ICircleAuthorized.cs +++ b/src/Yavsc.Abstract/Identity/Security/ICircleAuthorized.cs @@ -3,7 +3,7 @@ namespace Yavsc.Abstract.Identity.Security public interface ICircleAuthorized { long Id { get; set; } - string GetOwnerId (); + string OwnerId { get; } bool AuthorizeCircle(long circleId); ICircleAuthorization [] GetACL(); diff --git a/src/Yavsc.Abstract/Interfaces/IBaseTrackedEntity.cs b/src/Yavsc.Abstract/Interfaces/IBaseTrackedEntity.cs index 64da6cdd..f544f654 100644 --- a/src/Yavsc.Abstract/Interfaces/IBaseTrackedEntity.cs +++ b/src/Yavsc.Abstract/Interfaces/IBaseTrackedEntity.cs @@ -2,7 +2,7 @@ using System; namespace Yavsc { - public interface IBaseTrackedEntity + public interface ITrackedEntity { DateTime DateCreated { get; set; } string UserCreated { get; set; } diff --git a/src/Yavsc.Abstract/Interfaces/Models/IComment.cs b/src/Yavsc.Abstract/Interfaces/Models/IComment.cs new file mode 100644 index 00000000..f700ba29 --- /dev/null +++ b/src/Yavsc.Abstract/Interfaces/Models/IComment.cs @@ -0,0 +1,9 @@ +namespace Yavsc.Interfaces +{ + + public interface IComment + { + string Content { get; set; } + TReceiverId ReceiverId { get; set; } + } +} diff --git a/src/Yavsc.Abstract/Interfaces/Models/ICommentable.cs b/src/Yavsc.Abstract/Interfaces/Models/ICommentable.cs deleted file mode 100644 index 405ef3bd..00000000 --- a/src/Yavsc.Abstract/Interfaces/Models/ICommentable.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Yavsc.Interfaces -{ - public interface IComment : IIdentified - { - T GetReceiverId(); - void SetReceiverId(T rid); - string Content { get; set; } - - } -} \ No newline at end of file diff --git a/src/Yavsc.Abstract/MarkdownParser.y b/src/Yavsc.Abstract/MarkdownParser.y deleted file mode 100644 index 5f282702..00000000 --- a/src/Yavsc.Abstract/MarkdownParser.y +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Yavsc.Abstract/Messaging/Comment.cs b/src/Yavsc.Abstract/Messaging/Comment.cs new file mode 100644 index 00000000..3215abe4 --- /dev/null +++ b/src/Yavsc.Abstract/Messaging/Comment.cs @@ -0,0 +1,9 @@ + +using Yavsc.Interfaces; + +public class CommentPost : IComment + { + public long ReceiverId { get; set; } + public long? ParentId { get; set; } + public string Content { get; set; } + } diff --git a/src/Yavsc.Abstract/Workflow/INominativeQuery.cs b/src/Yavsc.Abstract/Workflow/INominativeQuery.cs index 2d6a1d8d..f0adebdc 100644 --- a/src/Yavsc.Abstract/Workflow/INominativeQuery.cs +++ b/src/Yavsc.Abstract/Workflow/INominativeQuery.cs @@ -2,7 +2,7 @@ using System; namespace Yavsc.Abstract.Workflow { - public interface IDecidableQuery: IBaseTrackedEntity, IQuery + public interface IDecidableQuery: ITrackedEntity, IQuery { bool Decided { get; set; } bool Accepted { get; set; } diff --git a/src/Yavsc.Abstract/Workflow/IQuery.cs b/src/Yavsc.Abstract/Workflow/IQuery.cs index 0997100c..ff9c76ac 100644 --- a/src/Yavsc.Abstract/Workflow/IQuery.cs +++ b/src/Yavsc.Abstract/Workflow/IQuery.cs @@ -3,7 +3,7 @@ namespace Yavsc.Abstract.Workflow using Yavsc; using Yavsc.Billing; - public interface IQuery: IBaseTrackedEntity, IBillable + public interface IQuery: ITrackedEntity, IBillable { QueryStatus Status { get; set; } string PaymentId { get; set; } diff --git a/src/Yavsc.Abstract/Workflow/IRating.cs b/src/Yavsc.Abstract/Workflow/IRating.cs deleted file mode 100644 index bc45f9a9..00000000 --- a/src/Yavsc.Abstract/Workflow/IRating.cs +++ /dev/null @@ -1,37 +0,0 @@ -// -// IIdentified.cs -// -// Author: -// Paul Schneider -// -// Copyright (c) 2015 GNU GPL -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see . - -namespace Yavsc -{ - - /// - /// I rating. - /// - public interface IRating: IIdentified - { - /// - /// Gets or sets the rate. - /// - /// The rate. - int Rate { get; set; } - } -} - diff --git a/src/Yavsc.Abstract/Yavsc.Abstract.csproj b/src/Yavsc.Abstract/Yavsc.Abstract.csproj index 4483fe35..6d0c7e5f 100644 --- a/src/Yavsc.Abstract/Yavsc.Abstract.csproj +++ b/src/Yavsc.Abstract/Yavsc.Abstract.csproj @@ -9,8 +9,5 @@ - - - diff --git a/src/Yavsc.Abstract/app.config b/src/Yavsc.Abstract/app.config deleted file mode 100644 index 8460dd43..00000000 --- a/src/Yavsc.Abstract/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/Yavsc.Abstract/packages.config b/src/Yavsc.Abstract/packages.config deleted file mode 100644 index 569e1bea..00000000 --- a/src/Yavsc.Abstract/packages.config +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/src/Yavsc/Config.cs b/src/Yavsc.Server/Config.cs similarity index 68% rename from src/Yavsc/Config.cs rename to src/Yavsc.Server/Config.cs index 938a9c1a..bc579e5f 100644 --- a/src/Yavsc/Config.cs +++ b/src/Yavsc.Server/Config.cs @@ -1,5 +1,8 @@  -using IdentityServer4.Models; +using IdentityServer8; +using IdentityServer8.Models; +using Microsoft.AspNetCore.Builder; +using Microsoft.Extensions.Configuration; using Yavsc.Settings; namespace Yavsc; @@ -38,13 +41,14 @@ public static class Config { new IdentityResources.OpenId(), new IdentityResources.Profile(), + new IdentityResources.Email() }; public static IEnumerable ApiScopes => new ApiScope[] { - new ApiScope("scope1"), - new ApiScope("scope2"), + new ApiScope("scope1",new string[] {"scope1"}), + new ApiScope("scope2",new string[] {"scope2"}), }; public static IEnumerable Clients => @@ -65,17 +69,29 @@ public static class Config // interactive client using code flow + pkce new Client { - ClientId = "interactive", + ClientId = "mvc", ClientSecrets = { new Secret("49C1A7E1-0C79-4A89-A3D6-A37998FB86B0".Sha256()) }, AllowedGrantTypes = GrantTypes.Code, + AlwaysIncludeUserClaimsInIdToken = true, - RedirectUris = { "https://localhost:5003/signin-oidc" }, - FrontChannelLogoutUri = "https://localhost:5003/signout-oidc", - PostLogoutRedirectUris = { "https://localhost:5003/signout-callback-oidc" }, + RedirectUris = { "https://localhost:5003/signin-oidc", + "http://localhost:5002/signin-oidc" }, + PostLogoutRedirectUris = { + "http://localhost:5002/signout-callback-oidc", + "https://localhost:5003/signout-callback-oidc" }, - AllowOfflineAccess = true, - AllowedScopes = { "openid", "profile", "scope2" } + + AllowedScopes = { + IdentityServerConstants.StandardScopes.OpenId, + IdentityServerConstants.StandardScopes.Profile, + IdentityServerConstants.StandardScopes.Email, + IdentityServerConstants.StandardScopes.OfflineAccess, + "scope2" } + , + AllowedCorsOrigins=new string[]{"*"}, + AllowRememberConsent=true + }, }; diff --git a/src/Yavsc/Exceptions/InvalidActivityModelException.cs b/src/Yavsc.Server/Exceptions/InvalidActivityModelException.cs similarity index 100% rename from src/Yavsc/Exceptions/InvalidActivityModelException.cs rename to src/Yavsc.Server/Exceptions/InvalidActivityModelException.cs diff --git a/src/Yavsc/Exceptions/InvalidPathException.cs b/src/Yavsc.Server/Exceptions/InvalidPathException.cs similarity index 100% rename from src/Yavsc/Exceptions/InvalidPathException.cs rename to src/Yavsc.Server/Exceptions/InvalidPathException.cs diff --git a/src/Yavsc.Server/Helpers/BillingHelpers.cs b/src/Yavsc.Server/Helpers/BillingHelpers.cs index 0a826447..c10a7615 100644 --- a/src/Yavsc.Server/Helpers/BillingHelpers.cs +++ b/src/Yavsc.Server/Helpers/BillingHelpers.cs @@ -1,10 +1,7 @@ -using System.Collections.Generic; using System.Globalization; -using System.IO; -using System.Linq; -using Yavsc.Abstract.FileSystem; using Yavsc.Billing; using Yavsc.Models.Billing; +using Yavsc.Server.Helpers; using Yavsc.Services; namespace Yavsc.Helpers diff --git a/src/Yavsc/Helpers/CompanyInfoHelpers.cs b/src/Yavsc.Server/Helpers/CompanyInfoHelpers.cs similarity index 100% rename from src/Yavsc/Helpers/CompanyInfoHelpers.cs rename to src/Yavsc.Server/Helpers/CompanyInfoHelpers.cs diff --git a/src/Yavsc/Helpers/FileSystemHelpers.cs b/src/Yavsc.Server/Helpers/FileSystemHelpers.cs similarity index 80% rename from src/Yavsc/Helpers/FileSystemHelpers.cs rename to src/Yavsc.Server/Helpers/FileSystemHelpers.cs index 8d6f7385..f0d5782b 100644 --- a/src/Yavsc/Helpers/FileSystemHelpers.cs +++ b/src/Yavsc.Server/Helpers/FileSystemHelpers.cs @@ -1,19 +1,30 @@ -using System.Drawing; -using System.Drawing.Imaging; + using System.Security.Claims; using Microsoft.AspNetCore.Html; using Microsoft.Extensions.FileProviders; -using Yavsc.Exceptions; using Yavsc.Models; using Yavsc.Models.FileSystem; using Yavsc.Models.Streaming; using Yavsc.ViewModels; - -namespace Yavsc.Helpers +using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Processing; +using Microsoft.AspNetCore.Http; +using Yavsc.Exceptions; +using Yavsc.Helpers; +using Yavsc.Abstract.Helpers; +namespace Yavsc.Server.Helpers { public static class FileSystemHelpers { + public static async Task SaveAsAsync(this IFormFile formFile, string path) + { + if (formFile.Length > 0) { + using (Stream fileStream = new FileStream(path, FileMode.Create)) { + await formFile.CopyToAsync(fileStream); + } + } + } public static FileRecievedInfo ReceiveProSignature(this ClaimsPrincipal user, string billingCode, long estimateId, IFormFile formFile, string signtype) { var item = new FileRecievedInfo @@ -28,43 +39,12 @@ namespace Yavsc.Helpers using (var org = formFile.OpenReadStream()) { - Image i = Image.FromStream(org); - using (Bitmap source = new Bitmap(i)) - { - source.Save(destFileName, ImageFormat.Png); - } + using Image image = Image.Load(org); + image.Save(destFileName); } return item; } - /// - /// Create avatars - /// - /// - /// - private static void CreateAvatars(this ApplicationUser user, Bitmap source) - { - var dir = Config.SiteSetup.Avatars; - var name = user.UserName + ".png"; - var smallname = user.UserName + ".s.png"; - var xsmallname = user.UserName + ".xs.png"; - using (Bitmap newBMP = new Bitmap(source, 128, 128)) - { - newBMP.Save(Path.Combine( - dir, name), ImageFormat.Png); - } - using (Bitmap newBMP = new Bitmap(source, 64, 64)) - { - newBMP.Save(Path.Combine( - dir, smallname), ImageFormat.Png); - } - using (Bitmap newBMP = new Bitmap(source, 32, 32)) - { - newBMP.Save(Path.Combine( - dir, xsmallname), ImageFormat.Png); - } - } - public static string GetAvatarUri(this ApplicationUser user) { return $"/{Config.SiteSetup.Avatars}/{user.UserName}.png"; @@ -257,42 +237,15 @@ namespace Yavsc.Helpers { FileName = user.UserName + ".png" }; - - var destFileName = Path.Combine(Config.SiteSetup.Avatars, item.FileName); - - var fi = new FileInfo(destFileName); - if (fi.Exists) item.Overriden = true; - Rectangle cropRect = new Rectangle(); - using (var org = formFile.OpenReadStream()) { - Image i = Image.FromStream(org); - using (Bitmap source = new Bitmap(i)) - { - if (i.Width != i.Height) - { - if (i.Width > i.Height) - { - cropRect.X = (i.Width - i.Height) / 2; - cropRect.Y = 0; - cropRect.Width = i.Height; - cropRect.Height = i.Height; - } - else - { - cropRect.X = 0; - cropRect.Y = (i.Height - i.Width) / 2; - cropRect.Width = i.Width; - cropRect.Height = i.Width; - } - using (var cropped = source.Clone(cropRect, source.PixelFormat)) - { - CreateAvatars(user,cropped); - } - } - - } - + using Image image = Image.Load(org); + image.Mutate(x=>x.Resize(128,128)); + image.Save(Path.Combine(Config.SiteSetup.Avatars,item.FileName)); + image.Mutate(x=>x.Resize(64,64)); + image.Save(Path.Combine(Config.SiteSetup.Avatars,user.UserName + ".s.png")); + image.Mutate(x=>x.Resize(32,32)); + image.Save(Path.Combine(Config.SiteSetup.Avatars,user.UserName + ".xs.png")); } item.DestDir = Config.AvatarsOptions.RequestPath.ToUriComponent(); user.Avatar = $"{item.DestDir}/{item.FileName}"; @@ -315,9 +268,5 @@ namespace Yavsc.Helpers return $"{basename}-{flow.SequenceNumber}{ext}"; } - public static void SaveAs(this IFormFile file, string destFileName) - { - throw new NotImplementedException(); - } } } diff --git a/src/Yavsc/Helpers/HtmlHelpers.cs b/src/Yavsc.Server/Helpers/HtmlHelpers.cs similarity index 95% rename from src/Yavsc/Helpers/HtmlHelpers.cs rename to src/Yavsc.Server/Helpers/HtmlHelpers.cs index 57d77b3e..213ea369 100644 --- a/src/Yavsc/Helpers/HtmlHelpers.cs +++ b/src/Yavsc.Server/Helpers/HtmlHelpers.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Html; +using Microsoft.AspNetCore.Http; using Yavsc.Models.Drawing; namespace Yavsc.Helpers diff --git a/src/Yavsc/Helpers/PayPalHelpers.cs b/src/Yavsc.Server/Helpers/PayPalHelpers.cs similarity index 100% rename from src/Yavsc/Helpers/PayPalHelpers.cs rename to src/Yavsc.Server/Helpers/PayPalHelpers.cs diff --git a/src/Yavsc.Server/Helpers/UserHelpers.cs b/src/Yavsc.Server/Helpers/UserHelpers.cs new file mode 100644 index 00000000..e319239d --- /dev/null +++ b/src/Yavsc.Server/Helpers/UserHelpers.cs @@ -0,0 +1,53 @@ +using System.Security.Claims; +using System.Collections.Generic; +using System.Linq; +using Microsoft.EntityFrameworkCore; +using Yavsc.Models; +using Yavsc.Models.Blog; + +namespace Yavsc.Helpers +{ + public static class UserHelpers + { + public static string GetUserId(this ClaimsPrincipal user) + { + return user.FindFirstValue("sub"); + } + + public static string GetUserName(this ClaimsPrincipal user) + { + return user.FindFirstValue(ClaimTypes.Name); + } + + public static bool IsSignedIn(this ClaimsPrincipal user) + { + return user.Identity.IsAuthenticated; + } + + public static IEnumerable UserPosts(this ApplicationDbContext dbContext, string posterId, string readerId) + { + if (readerId == null) + { + var userPosts = dbContext.BlogSpot.Include( + b => b.Author + ).Where(x => ((x.AuthorId == posterId) && (x.Visible))).ToArray(); + return userPosts; + } + else + { + long[] readerCirclesMemberships = + dbContext.Circle.Include(c => c.Members) + .Where(c => c.Members.Any(m => m.MemberId == readerId)) + .Select(c => c.Id).ToArray(); + return dbContext.BlogSpot.Include( + b => b.Author + ).Include(p => p.ACL).Where(x => x.Author.Id == posterId && + (x.Visible && + (x.ACL.Count == 0 || x.ACL.Any(a => readerCirclesMemberships.Contains(a.CircleId))))); + + + } + + } + } +} diff --git a/src/Yavsc/Helpers/WorkflowHelpers.cs b/src/Yavsc.Server/Helpers/WorkflowHelpers.cs similarity index 100% rename from src/Yavsc/Helpers/WorkflowHelpers.cs rename to src/Yavsc.Server/Helpers/WorkflowHelpers.cs diff --git a/src/Yavsc/Hubs/ChatHub.cs b/src/Yavsc.Server/Hubs/ChatHub.cs similarity index 100% rename from src/Yavsc/Hubs/ChatHub.cs rename to src/Yavsc.Server/Hubs/ChatHub.cs diff --git a/src/Yavsc/Interfaces/IConnexionManager.cs b/src/Yavsc.Server/Interfaces/IConnexionManager.cs similarity index 100% rename from src/Yavsc/Interfaces/IConnexionManager.cs rename to src/Yavsc.Server/Interfaces/IConnexionManager.cs diff --git a/src/Yavsc/Interfaces/IDiskUsageTracker.cs b/src/Yavsc.Server/Interfaces/IDiskUsageTracker.cs similarity index 100% rename from src/Yavsc/Interfaces/IDiskUsageTracker.cs rename to src/Yavsc.Server/Interfaces/IDiskUsageTracker.cs diff --git a/src/Yavsc/Interfaces/ILiveProcessor.cs b/src/Yavsc.Server/Interfaces/ILiveProcessor.cs similarity index 100% rename from src/Yavsc/Interfaces/ILiveProcessor.cs rename to src/Yavsc.Server/Interfaces/ILiveProcessor.cs diff --git a/src/Yavsc/Interfaces/ITrueEmailSender.cs b/src/Yavsc.Server/Interfaces/ITrueEmailSender.cs similarity index 100% rename from src/Yavsc/Interfaces/ITrueEmailSender.cs rename to src/Yavsc.Server/Interfaces/ITrueEmailSender.cs diff --git a/src/Yavsc/Migrations/2016/20160315144017_init.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160315144017_init.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160315144017_init.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160315144017_init.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160315144017_init.cs b/src/Yavsc.Server/Migrations/2016/20160315144017_init.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160315144017_init.cs rename to src/Yavsc.Server/Migrations/2016/20160315144017_init.cs diff --git a/src/Yavsc/Migrations/2016/20160317215718_command.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160317215718_command.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160317215718_command.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160317215718_command.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160317215718_command.cs b/src/Yavsc.Server/Migrations/2016/20160317215718_command.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160317215718_command.cs rename to src/Yavsc.Server/Migrations/2016/20160317215718_command.cs diff --git a/src/Yavsc/Migrations/2016/20160320170252_bank.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160320170252_bank.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160320170252_bank.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160320170252_bank.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160320170252_bank.cs b/src/Yavsc.Server/Migrations/2016/20160320170252_bank.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160320170252_bank.cs rename to src/Yavsc.Server/Migrations/2016/20160320170252_bank.cs diff --git a/src/Yavsc/Migrations/2016/20160322144500_contact.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160322144500_contact.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160322144500_contact.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160322144500_contact.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160322144500_contact.cs b/src/Yavsc.Server/Migrations/2016/20160322144500_contact.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160322144500_contact.cs rename to src/Yavsc.Server/Migrations/2016/20160322144500_contact.cs diff --git a/src/Yavsc/Migrations/2016/20160322152206_balance.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160322152206_balance.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160322152206_balance.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160322152206_balance.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160322152206_balance.cs b/src/Yavsc.Server/Migrations/2016/20160322152206_balance.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160322152206_balance.cs rename to src/Yavsc.Server/Migrations/2016/20160322152206_balance.cs diff --git a/src/Yavsc/Migrations/2016/20160401233357_circle.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160401233357_circle.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160401233357_circle.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160401233357_circle.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160401233357_circle.cs b/src/Yavsc.Server/Migrations/2016/20160401233357_circle.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160401233357_circle.cs rename to src/Yavsc.Server/Migrations/2016/20160401233357_circle.cs diff --git a/src/Yavsc/Migrations/2016/20160402135146_calendar.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160402135146_calendar.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160402135146_calendar.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160402135146_calendar.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160402135146_calendar.cs b/src/Yavsc.Server/Migrations/2016/20160402135146_calendar.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160402135146_calendar.cs rename to src/Yavsc.Server/Migrations/2016/20160402135146_calendar.cs diff --git a/src/Yavsc/Migrations/2016/20160404110708_files.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160404110708_files.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160404110708_files.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160404110708_files.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160404110708_files.cs b/src/Yavsc.Server/Migrations/2016/20160404110708_files.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160404110708_files.cs rename to src/Yavsc.Server/Migrations/2016/20160404110708_files.cs diff --git a/src/Yavsc/Migrations/2016/20160404121446_estimate.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160404121446_estimate.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160404121446_estimate.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160404121446_estimate.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160404121446_estimate.cs b/src/Yavsc.Server/Migrations/2016/20160404121446_estimate.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160404121446_estimate.cs rename to src/Yavsc.Server/Migrations/2016/20160404121446_estimate.cs diff --git a/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160404130359_estimateCommand.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160404130359_estimateCommand.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160404130359_estimateCommand.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160404130359_estimateCommand.cs b/src/Yavsc.Server/Migrations/2016/20160404130359_estimateCommand.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160404130359_estimateCommand.cs rename to src/Yavsc.Server/Migrations/2016/20160404130359_estimateCommand.cs diff --git a/src/Yavsc/Migrations/2016/20160405091432_booking.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160405091432_booking.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160405091432_booking.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160405091432_booking.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160405091432_booking.cs b/src/Yavsc.Server/Migrations/2016/20160405091432_booking.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160405091432_booking.cs rename to src/Yavsc.Server/Migrations/2016/20160405091432_booking.cs diff --git a/src/Yavsc/Migrations/2016/20160407112403_dailycost.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160407112403_dailycost.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160407112403_dailycost.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160407112403_dailycost.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160407112403_dailycost.cs b/src/Yavsc.Server/Migrations/2016/20160407112403_dailycost.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160407112403_dailycost.cs rename to src/Yavsc.Server/Migrations/2016/20160407112403_dailycost.cs diff --git a/src/Yavsc/Migrations/2016/20160418114001_commandCreation.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160418114001_commandCreation.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160418114001_commandCreation.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160418114001_commandCreation.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160418114001_commandCreation.cs b/src/Yavsc.Server/Migrations/2016/20160418114001_commandCreation.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160418114001_commandCreation.cs rename to src/Yavsc.Server/Migrations/2016/20160418114001_commandCreation.cs diff --git a/src/Yavsc/Migrations/2016/20160427123737_perfoffer.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160427123737_perfoffer.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160427123737_perfoffer.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160427123737_perfoffer.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160427123737_perfoffer.cs b/src/Yavsc.Server/Migrations/2016/20160427123737_perfoffer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160427123737_perfoffer.cs rename to src/Yavsc.Server/Migrations/2016/20160427123737_perfoffer.cs diff --git a/src/Yavsc/Migrations/2016/20160506154628_siren.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160506154628_siren.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160506154628_siren.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160506154628_siren.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160506154628_siren.cs b/src/Yavsc.Server/Migrations/2016/20160506154628_siren.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160506154628_siren.cs rename to src/Yavsc.Server/Migrations/2016/20160506154628_siren.cs diff --git a/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160515142434_tokenExpiresIn.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160515142434_tokenExpiresIn.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.cs b/src/Yavsc.Server/Migrations/2016/20160515142434_tokenExpiresIn.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160515142434_tokenExpiresIn.cs rename to src/Yavsc.Server/Migrations/2016/20160515142434_tokenExpiresIn.cs diff --git a/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160529205859_ModeratorGroupName.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160529205859_ModeratorGroupName.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.cs b/src/Yavsc.Server/Migrations/2016/20160529205859_ModeratorGroupName.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160529205859_ModeratorGroupName.cs rename to src/Yavsc.Server/Migrations/2016/20160529205859_ModeratorGroupName.cs diff --git a/src/Yavsc/Migrations/2016/20160610153353_client.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160610153353_client.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160610153353_client.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160610153353_client.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160610153353_client.cs b/src/Yavsc.Server/Migrations/2016/20160610153353_client.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160610153353_client.cs rename to src/Yavsc.Server/Migrations/2016/20160610153353_client.cs diff --git a/src/Yavsc/Migrations/2016/20160613142037_devices.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160613142037_devices.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160613142037_devices.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160613142037_devices.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160613142037_devices.cs b/src/Yavsc.Server/Migrations/2016/20160613142037_devices.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160613142037_devices.cs rename to src/Yavsc.Server/Migrations/2016/20160613142037_devices.cs diff --git a/src/Yavsc/Migrations/2016/20160614010545_bookquery.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160614010545_bookquery.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160614010545_bookquery.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160614010545_bookquery.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160614010545_bookquery.cs b/src/Yavsc.Server/Migrations/2016/20160614010545_bookquery.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160614010545_bookquery.cs rename to src/Yavsc.Server/Migrations/2016/20160614010545_bookquery.cs diff --git a/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160702195348_GCMinfos.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160702195348_GCMinfos.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160702195348_GCMinfos.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160702195348_GCMinfos.cs b/src/Yavsc.Server/Migrations/2016/20160702195348_GCMinfos.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160702195348_GCMinfos.cs rename to src/Yavsc.Server/Migrations/2016/20160702195348_GCMinfos.cs diff --git a/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160723164231_GCMRedDate.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160723164231_GCMRedDate.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.cs b/src/Yavsc.Server/Migrations/2016/20160723164231_GCMRedDate.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160723164231_GCMRedDate.cs rename to src/Yavsc.Server/Migrations/2016/20160723164231_GCMRedDate.cs diff --git a/src/Yavsc/Migrations/2016/20160725145306_estimates.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160725145306_estimates.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160725145306_estimates.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160725145306_estimates.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160725145306_estimates.cs b/src/Yavsc.Server/Migrations/2016/20160725145306_estimates.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160725145306_estimates.cs rename to src/Yavsc.Server/Migrations/2016/20160725145306_estimates.cs diff --git a/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160726131331_performerIdTypo.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160726131331_performerIdTypo.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.cs b/src/Yavsc.Server/Migrations/2016/20160726131331_performerIdTypo.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160726131331_performerIdTypo.cs rename to src/Yavsc.Server/Migrations/2016/20160726131331_performerIdTypo.cs diff --git a/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160726133002_otherOrtho.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160726133002_otherOrtho.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160726133002_otherOrtho.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160726133002_otherOrtho.cs b/src/Yavsc.Server/Migrations/2016/20160726133002_otherOrtho.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160726133002_otherOrtho.cs rename to src/Yavsc.Server/Migrations/2016/20160726133002_otherOrtho.cs diff --git a/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160726161530_ExceptionsSIREN.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160726161530_ExceptionsSIREN.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.cs b/src/Yavsc.Server/Migrations/2016/20160726161530_ExceptionsSIREN.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160726161530_ExceptionsSIREN.cs rename to src/Yavsc.Server/Migrations/2016/20160726161530_ExceptionsSIREN.cs diff --git a/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160802143258_bcontentornot.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160802143258_bcontentornot.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160802143258_bcontentornot.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160802143258_bcontentornot.cs b/src/Yavsc.Server/Migrations/2016/20160802143258_bcontentornot.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160802143258_bcontentornot.cs rename to src/Yavsc.Server/Migrations/2016/20160802143258_bcontentornot.cs diff --git a/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160802145351_camelCaseBlog.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160802145351_camelCaseBlog.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.cs b/src/Yavsc.Server/Migrations/2016/20160802145351_camelCaseBlog.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160802145351_camelCaseBlog.cs rename to src/Yavsc.Server/Migrations/2016/20160802145351_camelCaseBlog.cs diff --git a/src/Yavsc/Migrations/2016/20160901145646_products.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160901145646_products.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160901145646_products.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160901145646_products.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160901145646_products.cs b/src/Yavsc.Server/Migrations/2016/20160901145646_products.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160901145646_products.cs rename to src/Yavsc.Server/Migrations/2016/20160901145646_products.cs diff --git a/src/Yavsc/Migrations/2016/20160905095708_tags.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160905095708_tags.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160905095708_tags.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160905095708_tags.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160905095708_tags.cs b/src/Yavsc.Server/Migrations/2016/20160905095708_tags.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160905095708_tags.cs rename to src/Yavsc.Server/Migrations/2016/20160905095708_tags.cs diff --git a/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160916075415_estimateFreeFromCatalog.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160916075415_estimateFreeFromCatalog.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.cs b/src/Yavsc.Server/Migrations/2016/20160916075415_estimateFreeFromCatalog.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160916075415_estimateFreeFromCatalog.cs rename to src/Yavsc.Server/Migrations/2016/20160916075415_estimateFreeFromCatalog.cs diff --git a/src/Yavsc/Migrations/2016/20160917010249_yaev.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160917010249_yaev.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160917010249_yaev.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160917010249_yaev.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160917010249_yaev.cs b/src/Yavsc.Server/Migrations/2016/20160917010249_yaev.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160917010249_yaev.cs rename to src/Yavsc.Server/Migrations/2016/20160917010249_yaev.cs diff --git a/src/Yavsc/Migrations/2016/20160920215459_avatar.Designer.cs b/src/Yavsc.Server/Migrations/2016/20160920215459_avatar.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160920215459_avatar.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20160920215459_avatar.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20160920215459_avatar.cs b/src/Yavsc.Server/Migrations/2016/20160920215459_avatar.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20160920215459_avatar.cs rename to src/Yavsc.Server/Migrations/2016/20160920215459_avatar.cs diff --git a/src/Yavsc/Migrations/2016/20161010102616_recontact.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161010102616_recontact.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161010102616_recontact.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161010102616_recontact.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161010102616_recontact.cs b/src/Yavsc.Server/Migrations/2016/20161010102616_recontact.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161010102616_recontact.cs rename to src/Yavsc.Server/Migrations/2016/20161010102616_recontact.cs diff --git a/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161020143022_estimateClientApprouval.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161020143022_estimateClientApprouval.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.cs b/src/Yavsc.Server/Migrations/2016/20161020143022_estimateClientApprouval.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161020143022_estimateClientApprouval.cs rename to src/Yavsc.Server/Migrations/2016/20161020143022_estimateClientApprouval.cs diff --git a/src/Yavsc/Migrations/2016/20161020212947_userAddress.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161020212947_userAddress.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161020212947_userAddress.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161020212947_userAddress.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161020212947_userAddress.cs b/src/Yavsc.Server/Migrations/2016/20161020212947_userAddress.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161020212947_userAddress.cs rename to src/Yavsc.Server/Migrations/2016/20161020212947_userAddress.cs diff --git a/src/Yavsc/Migrations/2016/20161021153306_estimateLines.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161021153306_estimateLines.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161021153306_estimateLines.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161021153306_estimateLines.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161021153306_estimateLines.cs b/src/Yavsc.Server/Migrations/2016/20161021153306_estimateLines.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161021153306_estimateLines.cs rename to src/Yavsc.Server/Migrations/2016/20161021153306_estimateLines.cs diff --git a/src/Yavsc/Migrations/2016/20161101234703_chatConnection.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161101234703_chatConnection.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161101234703_chatConnection.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161101234703_chatConnection.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161101234703_chatConnection.cs b/src/Yavsc.Server/Migrations/2016/20161101234703_chatConnection.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161101234703_chatConnection.cs rename to src/Yavsc.Server/Migrations/2016/20161101234703_chatConnection.cs diff --git a/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161102132129_fixCxOwner.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161102132129_fixCxOwner.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.cs b/src/Yavsc.Server/Migrations/2016/20161102132129_fixCxOwner.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161102132129_fixCxOwner.cs rename to src/Yavsc.Server/Migrations/2016/20161102132129_fixCxOwner.cs diff --git a/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161102133253_fix2CxOwner.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161102133253_fix2CxOwner.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.cs b/src/Yavsc.Server/Migrations/2016/20161102133253_fix2CxOwner.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161102133253_fix2CxOwner.cs rename to src/Yavsc.Server/Migrations/2016/20161102133253_fix2CxOwner.cs diff --git a/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161104090806_bankUserProfile.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161104090806_bankUserProfile.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.cs b/src/Yavsc.Server/Migrations/2016/20161104090806_bankUserProfile.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161104090806_bankUserProfile.cs rename to src/Yavsc.Server/Migrations/2016/20161104090806_bankUserProfile.cs diff --git a/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161104164949_dropEstimateStatus.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161104164949_dropEstimateStatus.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.cs b/src/Yavsc.Server/Migrations/2016/20161104164949_dropEstimateStatus.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161104164949_dropEstimateStatus.cs rename to src/Yavsc.Server/Migrations/2016/20161104164949_dropEstimateStatus.cs diff --git a/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161123235323_estimatesignatures.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161123235323_estimatesignatures.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.cs b/src/Yavsc.Server/Migrations/2016/20161123235323_estimatesignatures.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161123235323_estimatesignatures.cs rename to src/Yavsc.Server/Migrations/2016/20161123235323_estimatesignatures.cs diff --git a/src/Yavsc/Migrations/2016/20161130084909_diskQuota.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161130084909_diskQuota.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161130084909_diskQuota.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161130084909_diskQuota.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161130084909_diskQuota.cs b/src/Yavsc.Server/Migrations/2016/20161130084909_diskQuota.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161130084909_diskQuota.cs rename to src/Yavsc.Server/Migrations/2016/20161130084909_diskQuota.cs diff --git a/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161209121035_bookQueryReason.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161209121035_bookQueryReason.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.cs b/src/Yavsc.Server/Migrations/2016/20161209121035_bookQueryReason.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161209121035_bookQueryReason.cs rename to src/Yavsc.Server/Migrations/2016/20161209121035_bookQueryReason.cs diff --git a/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.Designer.cs b/src/Yavsc.Server/Migrations/2016/20161231163016_musicalPreferences.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.Designer.cs rename to src/Yavsc.Server/Migrations/2016/20161231163016_musicalPreferences.Designer.cs diff --git a/src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.cs b/src/Yavsc.Server/Migrations/2016/20161231163016_musicalPreferences.cs similarity index 100% rename from src/Yavsc/Migrations/2016/20161231163016_musicalPreferences.cs rename to src/Yavsc.Server/Migrations/2016/20161231163016_musicalPreferences.cs diff --git a/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170102140332_musicalTendencies.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170102140332_musicalTendencies.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.cs b/src/Yavsc.Server/Migrations/2017/20170102140332_musicalTendencies.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170102140332_musicalTendencies.cs rename to src/Yavsc.Server/Migrations/2017/20170102140332_musicalTendencies.cs diff --git a/src/Yavsc/Migrations/2017/20170102152745_locationTypes.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170102152745_locationTypes.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170102152745_locationTypes.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170102152745_locationTypes.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170102152745_locationTypes.cs b/src/Yavsc.Server/Migrations/2017/20170102152745_locationTypes.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170102152745_locationTypes.cs rename to src/Yavsc.Server/Migrations/2017/20170102152745_locationTypes.cs diff --git a/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170106092028_WFActivityParentAndProfiles.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170106092028_WFActivityParentAndProfiles.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.cs b/src/Yavsc.Server/Migrations/2017/20170106092028_WFActivityParentAndProfiles.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106092028_WFActivityParentAndProfiles.cs rename to src/Yavsc.Server/Migrations/2017/20170106092028_WFActivityParentAndProfiles.cs diff --git a/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170106113614_ownerProfile.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106113614_ownerProfile.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170106113614_ownerProfile.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170106113614_ownerProfile.cs b/src/Yavsc.Server/Migrations/2017/20170106113614_ownerProfile.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106113614_ownerProfile.cs rename to src/Yavsc.Server/Migrations/2017/20170106113614_ownerProfile.cs diff --git a/src/Yavsc/Migrations/2017/20170106122307_Instruments.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170106122307_Instruments.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106122307_Instruments.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170106122307_Instruments.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170106122307_Instruments.cs b/src/Yavsc.Server/Migrations/2017/20170106122307_Instruments.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106122307_Instruments.cs rename to src/Yavsc.Server/Migrations/2017/20170106122307_Instruments.cs diff --git a/src/Yavsc/Migrations/2017/20170106124548_instrumentation.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170106124548_instrumentation.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106124548_instrumentation.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170106124548_instrumentation.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170106124548_instrumentation.cs b/src/Yavsc.Server/Migrations/2017/20170106124548_instrumentation.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106124548_instrumentation.cs rename to src/Yavsc.Server/Migrations/2017/20170106124548_instrumentation.cs diff --git a/src/Yavsc/Migrations/2017/20170106144035_activityRate.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170106144035_activityRate.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106144035_activityRate.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170106144035_activityRate.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170106144035_activityRate.cs b/src/Yavsc.Server/Migrations/2017/20170106144035_activityRate.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106144035_activityRate.cs rename to src/Yavsc.Server/Migrations/2017/20170106144035_activityRate.cs diff --git a/src/Yavsc/Migrations/2017/20170106235954_weight.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170106235954_weight.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106235954_weight.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170106235954_weight.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170106235954_weight.cs b/src/Yavsc.Server/Migrations/2017/20170106235954_weight.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170106235954_weight.cs rename to src/Yavsc.Server/Migrations/2017/20170106235954_weight.cs diff --git a/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170107004233_userActivitiesValidity.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170107004233_userActivitiesValidity.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.cs b/src/Yavsc.Server/Migrations/2017/20170107004233_userActivitiesValidity.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170107004233_userActivitiesValidity.cs rename to src/Yavsc.Server/Migrations/2017/20170107004233_userActivitiesValidity.cs diff --git a/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170113022807_SettingsClassName.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170113022807_SettingsClassName.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.cs b/src/Yavsc.Server/Migrations/2017/20170113022807_SettingsClassName.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170113022807_SettingsClassName.cs rename to src/Yavsc.Server/Migrations/2017/20170113022807_SettingsClassName.cs diff --git a/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170113150714_instrumentationReloaded.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170113150714_instrumentationReloaded.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.cs b/src/Yavsc.Server/Migrations/2017/20170113150714_instrumentationReloaded.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170113150714_instrumentationReloaded.cs rename to src/Yavsc.Server/Migrations/2017/20170113150714_instrumentationReloaded.cs diff --git a/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170116002541_bookQueryActivityCode.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170116002541_bookQueryActivityCode.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.cs b/src/Yavsc.Server/Migrations/2017/20170116002541_bookQueryActivityCode.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170116002541_bookQueryActivityCode.cs rename to src/Yavsc.Server/Migrations/2017/20170116002541_bookQueryActivityCode.cs diff --git a/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170116154735_refactPrproAllowGeo.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170116154735_refactPrproAllowGeo.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.cs b/src/Yavsc.Server/Migrations/2017/20170116154735_refactPrproAllowGeo.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170116154735_refactPrproAllowGeo.cs rename to src/Yavsc.Server/Migrations/2017/20170116154735_refactPrproAllowGeo.cs diff --git a/src/Yavsc/Migrations/2017/20170117134339_entityTracking.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170117134339_entityTracking.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170117134339_entityTracking.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170117134339_entityTracking.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170117134339_entityTracking.cs b/src/Yavsc.Server/Migrations/2017/20170117134339_entityTracking.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170117134339_entityTracking.cs rename to src/Yavsc.Server/Migrations/2017/20170117134339_entityTracking.cs diff --git a/src/Yavsc/Migrations/2017/20170120095258_blogAcl.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170120095258_blogAcl.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170120095258_blogAcl.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170120095258_blogAcl.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170120095258_blogAcl.cs b/src/Yavsc.Server/Migrations/2017/20170120095258_blogAcl.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170120095258_blogAcl.cs rename to src/Yavsc.Server/Migrations/2017/20170120095258_blogAcl.cs diff --git a/src/Yavsc/Migrations/2017/20170120122324_queryTraking.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170120122324_queryTraking.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170120122324_queryTraking.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170120122324_queryTraking.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170120122324_queryTraking.cs b/src/Yavsc.Server/Migrations/2017/20170120122324_queryTraking.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170120122324_queryTraking.cs rename to src/Yavsc.Server/Migrations/2017/20170120122324_queryTraking.cs diff --git a/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170122160343_circlesMemberRefact.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170122160343_circlesMemberRefact.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.cs b/src/Yavsc.Server/Migrations/2017/20170122160343_circlesMemberRefact.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170122160343_circlesMemberRefact.cs rename to src/Yavsc.Server/Migrations/2017/20170122160343_circlesMemberRefact.cs diff --git a/src/Yavsc/Migrations/2017/20170124090324_commandForms.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170124090324_commandForms.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170124090324_commandForms.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170124090324_commandForms.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170124090324_commandForms.cs b/src/Yavsc.Server/Migrations/2017/20170124090324_commandForms.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170124090324_commandForms.cs rename to src/Yavsc.Server/Migrations/2017/20170124090324_commandForms.cs diff --git a/src/Yavsc/Migrations/2017/20170126152454_trackActivity.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170126152454_trackActivity.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170126152454_trackActivity.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170126152454_trackActivity.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170126152454_trackActivity.cs b/src/Yavsc.Server/Migrations/2017/20170126152454_trackActivity.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170126152454_trackActivity.cs rename to src/Yavsc.Server/Migrations/2017/20170126152454_trackActivity.cs diff --git a/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170126152651_renameActViewNameToAction.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170126152651_renameActViewNameToAction.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.cs b/src/Yavsc.Server/Migrations/2017/20170126152651_renameActViewNameToAction.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170126152651_renameActViewNameToAction.cs rename to src/Yavsc.Server/Migrations/2017/20170126152651_renameActViewNameToAction.cs diff --git a/src/Yavsc/Migrations/2017/20170201002133_blacklisted.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170201002133_blacklisted.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170201002133_blacklisted.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170201002133_blacklisted.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170201002133_blacklisted.cs b/src/Yavsc.Server/Migrations/2017/20170201002133_blacklisted.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170201002133_blacklisted.cs rename to src/Yavsc.Server/Migrations/2017/20170201002133_blacklisted.cs diff --git a/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170201162847_defaultAvatar.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170201162847_defaultAvatar.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.cs b/src/Yavsc.Server/Migrations/2017/20170201162847_defaultAvatar.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170201162847_defaultAvatar.cs rename to src/Yavsc.Server/Migrations/2017/20170201162847_defaultAvatar.cs diff --git a/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170202102936_defaultDiskQuota.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170202102936_defaultDiskQuota.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.cs b/src/Yavsc.Server/Migrations/2017/20170202102936_defaultDiskQuota.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170202102936_defaultDiskQuota.cs rename to src/Yavsc.Server/Migrations/2017/20170202102936_defaultDiskQuota.cs diff --git a/src/Yavsc/Migrations/2017/20170212005346_haircut.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170212005346_haircut.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170212005346_haircut.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170212005346_haircut.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170212005346_haircut.cs b/src/Yavsc.Server/Migrations/2017/20170212005346_haircut.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170212005346_haircut.cs rename to src/Yavsc.Server/Migrations/2017/20170212005346_haircut.cs diff --git a/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170217221646_bookQueryStatus.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170217221646_bookQueryStatus.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.cs b/src/Yavsc.Server/Migrations/2017/20170217221646_bookQueryStatus.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170217221646_bookQueryStatus.cs rename to src/Yavsc.Server/Migrations/2017/20170217221646_bookQueryStatus.cs diff --git a/src/Yavsc/Migrations/2017/20170220102125_notifications.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170220102125_notifications.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170220102125_notifications.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170220102125_notifications.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170220102125_notifications.cs b/src/Yavsc.Server/Migrations/2017/20170220102125_notifications.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170220102125_notifications.cs rename to src/Yavsc.Server/Migrations/2017/20170220102125_notifications.cs diff --git a/src/Yavsc/Migrations/2017/20170220125518_dimissclick.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170220125518_dimissclick.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170220125518_dimissclick.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170220125518_dimissclick.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170220125518_dimissclick.cs b/src/Yavsc.Server/Migrations/2017/20170220125518_dimissclick.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170220125518_dimissclick.cs rename to src/Yavsc.Server/Migrations/2017/20170220125518_dimissclick.cs diff --git a/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170220144141_hiddenActivity.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170220144141_hiddenActivity.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.cs b/src/Yavsc.Server/Migrations/2017/20170220144141_hiddenActivity.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170220144141_hiddenActivity.cs rename to src/Yavsc.Server/Migrations/2017/20170220144141_hiddenActivity.cs diff --git a/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170227151759_hairPrestations.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170227151759_hairPrestations.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170227151759_hairPrestations.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170227151759_hairPrestations.cs b/src/Yavsc.Server/Migrations/2017/20170227151759_hairPrestations.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170227151759_hairPrestations.cs rename to src/Yavsc.Server/Migrations/2017/20170227151759_hairPrestations.cs diff --git a/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170228115359_brusherProfile.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170228115359_brusherProfile.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170228115359_brusherProfile.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170228115359_brusherProfile.cs b/src/Yavsc.Server/Migrations/2017/20170228115359_brusherProfile.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170228115359_brusherProfile.cs rename to src/Yavsc.Server/Migrations/2017/20170228115359_brusherProfile.cs diff --git a/src/Yavsc/Migrations/2017/20170228145057_actionName.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170228145057_actionName.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170228145057_actionName.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170228145057_actionName.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170228145057_actionName.cs b/src/Yavsc.Server/Migrations/2017/20170228145057_actionName.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170228145057_actionName.cs rename to src/Yavsc.Server/Migrations/2017/20170228145057_actionName.cs diff --git a/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170301124608_brusherActiondistance.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170301124608_brusherActiondistance.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.cs b/src/Yavsc.Server/Migrations/2017/20170301124608_brusherActiondistance.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170301124608_brusherActiondistance.cs rename to src/Yavsc.Server/Migrations/2017/20170301124608_brusherActiondistance.cs diff --git a/src/Yavsc/Migrations/2017/20170301132531_manbrushing.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170301132531_manbrushing.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170301132531_manbrushing.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170301132531_manbrushing.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170301132531_manbrushing.cs b/src/Yavsc.Server/Migrations/2017/20170301132531_manbrushing.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170301132531_manbrushing.cs rename to src/Yavsc.Server/Migrations/2017/20170301132531_manbrushing.cs diff --git a/src/Yavsc/Migrations/2017/20170301211317_folding.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170301211317_folding.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170301211317_folding.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170301211317_folding.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170301211317_folding.cs b/src/Yavsc.Server/Migrations/2017/20170301211317_folding.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170301211317_folding.cs rename to src/Yavsc.Server/Migrations/2017/20170301211317_folding.cs diff --git a/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170302122929_brusherProfileDiscount.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170302122929_brusherProfileDiscount.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.cs b/src/Yavsc.Server/Migrations/2017/20170302122929_brusherProfileDiscount.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170302122929_brusherProfileDiscount.cs rename to src/Yavsc.Server/Migrations/2017/20170302122929_brusherProfileDiscount.cs diff --git a/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170303000800_estimateRequireCommandType.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170303000800_estimateRequireCommandType.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.cs b/src/Yavsc.Server/Migrations/2017/20170303000800_estimateRequireCommandType.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170303000800_estimateRequireCommandType.cs rename to src/Yavsc.Server/Migrations/2017/20170303000800_estimateRequireCommandType.cs diff --git a/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170317213255_cxRequiresUserName.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170317213255_cxRequiresUserName.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.cs b/src/Yavsc.Server/Migrations/2017/20170317213255_cxRequiresUserName.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170317213255_cxRequiresUserName.cs rename to src/Yavsc.Server/Migrations/2017/20170317213255_cxRequiresUserName.cs diff --git a/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170329075249_avatarMayBeNull.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170329075249_avatarMayBeNull.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.cs b/src/Yavsc.Server/Migrations/2017/20170329075249_avatarMayBeNull.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170329075249_avatarMayBeNull.cs rename to src/Yavsc.Server/Migrations/2017/20170329075249_avatarMayBeNull.cs diff --git a/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.cs b/src/Yavsc.Server/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.cs rename to src/Yavsc.Server/Migrations/2017/20170331214327_rdvqueryAndNoLocationNorDate.cs diff --git a/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.cs b/src/Yavsc.Server/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.cs rename to src/Yavsc.Server/Migrations/2017/20170408055642_haircutqueryAdditionalInfo.cs diff --git a/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170409004555_haircutCommandTaints.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170409004555_haircutCommandTaints.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.cs b/src/Yavsc.Server/Migrations/2017/20170409004555_haircutCommandTaints.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170409004555_haircutCommandTaints.cs rename to src/Yavsc.Server/Migrations/2017/20170409004555_haircutCommandTaints.cs diff --git a/src/Yavsc/Migrations/2017/20170507200834_paypal.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170507200834_paypal.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170507200834_paypal.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170507200834_paypal.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170507200834_paypal.cs b/src/Yavsc.Server/Migrations/2017/20170507200834_paypal.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170507200834_paypal.cs rename to src/Yavsc.Server/Migrations/2017/20170507200834_paypal.cs diff --git a/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170510121057_hairCutPaypalPayment.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170510121057_hairCutPaypalPayment.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.cs b/src/Yavsc.Server/Migrations/2017/20170510121057_hairCutPaypalPayment.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170510121057_hairCutPaypalPayment.cs rename to src/Yavsc.Server/Migrations/2017/20170510121057_hairCutPaypalPayment.cs diff --git a/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170512102508_hairCutBill.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170512102508_hairCutBill.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170512102508_hairCutBill.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170512102508_hairCutBill.cs b/src/Yavsc.Server/Migrations/2017/20170512102508_hairCutBill.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170512102508_hairCutBill.cs rename to src/Yavsc.Server/Migrations/2017/20170512102508_hairCutBill.cs diff --git a/src/Yavsc/Migrations/2017/20170513213829_paypalids.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170513213829_paypalids.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170513213829_paypalids.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170513213829_paypalids.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170513213829_paypalids.cs b/src/Yavsc.Server/Migrations/2017/20170513213829_paypalids.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170513213829_paypalids.cs rename to src/Yavsc.Server/Migrations/2017/20170513213829_paypalids.cs diff --git a/src/Yavsc/Migrations/2017/20170514123122_links.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170514123122_links.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170514123122_links.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170514123122_links.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170514123122_links.cs b/src/Yavsc.Server/Migrations/2017/20170514123122_links.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170514123122_links.cs rename to src/Yavsc.Server/Migrations/2017/20170514123122_links.cs diff --git a/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170516181745_paymentConsent.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170516181745_paymentConsent.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170516181745_paymentConsent.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170516181745_paymentConsent.cs b/src/Yavsc.Server/Migrations/2017/20170516181745_paymentConsent.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170516181745_paymentConsent.cs rename to src/Yavsc.Server/Migrations/2017/20170516181745_paymentConsent.cs diff --git a/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170517001340_notificatioinTarget.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170517001340_notificatioinTarget.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.cs b/src/Yavsc.Server/Migrations/2017/20170517001340_notificatioinTarget.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170517001340_notificatioinTarget.cs rename to src/Yavsc.Server/Migrations/2017/20170517001340_notificatioinTarget.cs diff --git a/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170524210924_paypalToDeprecated.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170524210924_paypalToDeprecated.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.cs b/src/Yavsc.Server/Migrations/2017/20170524210924_paypalToDeprecated.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170524210924_paypalToDeprecated.cs rename to src/Yavsc.Server/Migrations/2017/20170524210924_paypalToDeprecated.cs diff --git a/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170526020220_rdvPayment.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170526020220_rdvPayment.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170526020220_rdvPayment.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170526020220_rdvPayment.cs b/src/Yavsc.Server/Migrations/2017/20170526020220_rdvPayment.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170526020220_rdvPayment.cs rename to src/Yavsc.Server/Migrations/2017/20170526020220_rdvPayment.cs diff --git a/src/Yavsc/Migrations/2017/20170601115553_period.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170601115553_period.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170601115553_period.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170601115553_period.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170601115553_period.cs b/src/Yavsc.Server/Migrations/2017/20170601115553_period.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170601115553_period.cs rename to src/Yavsc.Server/Migrations/2017/20170601115553_period.cs diff --git a/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.Designer.cs b/src/Yavsc.Server/Migrations/2017/20170611141231_BrusherCalendarModel.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20170611141231_BrusherCalendarModel.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.cs b/src/Yavsc.Server/Migrations/2017/20170611141231_BrusherCalendarModel.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20170611141231_BrusherCalendarModel.cs rename to src/Yavsc.Server/Migrations/2017/20170611141231_BrusherCalendarModel.cs diff --git a/src/Yavsc/Migrations/2017/20171002023107_Features.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171002023107_Features.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171002023107_Features.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171002023107_Features.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171002023107_Features.cs b/src/Yavsc.Server/Migrations/2017/20171002023107_Features.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171002023107_Features.cs rename to src/Yavsc.Server/Migrations/2017/20171002023107_Features.cs diff --git a/src/Yavsc/Migrations/2017/20171002023835_bugs.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171002023835_bugs.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171002023835_bugs.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171002023835_bugs.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171002023835_bugs.cs b/src/Yavsc.Server/Migrations/2017/20171002023835_bugs.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171002023835_bugs.cs rename to src/Yavsc.Server/Migrations/2017/20171002023835_bugs.cs diff --git a/src/Yavsc/Migrations/2017/20171003195221_BlogRename.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171003195221_BlogRename.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171003195221_BlogRename.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171003195221_BlogRename.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171003195221_BlogRename.cs b/src/Yavsc.Server/Migrations/2017/20171003195221_BlogRename.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171003195221_BlogRename.cs rename to src/Yavsc.Server/Migrations/2017/20171003195221_BlogRename.cs diff --git a/src/Yavsc/Migrations/2017/20171003203721_BlogComment.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171003203721_BlogComment.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171003203721_BlogComment.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171003203721_BlogComment.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171003203721_BlogComment.cs b/src/Yavsc.Server/Migrations/2017/20171003203721_BlogComment.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171003203721_BlogComment.cs rename to src/Yavsc.Server/Migrations/2017/20171003203721_BlogComment.cs diff --git a/src/Yavsc/Migrations/2017/20171008184908_annouce.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171008184908_annouce.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171008184908_annouce.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171008184908_annouce.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171008184908_annouce.cs b/src/Yavsc.Server/Migrations/2017/20171008184908_annouce.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171008184908_annouce.cs rename to src/Yavsc.Server/Migrations/2017/20171008184908_annouce.cs diff --git a/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171008190234_announceAnwer.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171008190234_announceAnwer.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171008190234_announceAnwer.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171008190234_announceAnwer.cs b/src/Yavsc.Server/Migrations/2017/20171008190234_announceAnwer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171008190234_announceAnwer.cs rename to src/Yavsc.Server/Migrations/2017/20171008190234_announceAnwer.cs diff --git a/src/Yavsc/Migrations/2017/20171016090837_bugDescription.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171016090837_bugDescription.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171016090837_bugDescription.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171016090837_bugDescription.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171016090837_bugDescription.cs b/src/Yavsc.Server/Migrations/2017/20171016090837_bugDescription.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171016090837_bugDescription.cs rename to src/Yavsc.Server/Migrations/2017/20171016090837_bugDescription.cs diff --git a/src/Yavsc/Migrations/2017/20171019130120_subComment.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171019130120_subComment.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171019130120_subComment.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171019130120_subComment.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171019130120_subComment.cs b/src/Yavsc.Server/Migrations/2017/20171019130120_subComment.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171019130120_subComment.cs rename to src/Yavsc.Server/Migrations/2017/20171019130120_subComment.cs diff --git a/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171020090944_commentAuthor.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171020090944_commentAuthor.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171020090944_commentAuthor.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171020090944_commentAuthor.cs b/src/Yavsc.Server/Migrations/2017/20171020090944_commentAuthor.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171020090944_commentAuthor.cs rename to src/Yavsc.Server/Migrations/2017/20171020090944_commentAuthor.cs diff --git a/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.Designer.cs b/src/Yavsc.Server/Migrations/2017/20171020173835_commentAuthorId.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.Designer.cs rename to src/Yavsc.Server/Migrations/2017/20171020173835_commentAuthorId.Designer.cs diff --git a/src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.cs b/src/Yavsc.Server/Migrations/2017/20171020173835_commentAuthorId.cs similarity index 100% rename from src/Yavsc/Migrations/2017/20171020173835_commentAuthorId.cs rename to src/Yavsc.Server/Migrations/2017/20171020173835_commentAuthorId.cs diff --git a/src/Yavsc/Migrations/2018/20180102153009_chatRooms.Designer.cs b/src/Yavsc.Server/Migrations/2018/20180102153009_chatRooms.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180102153009_chatRooms.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20180102153009_chatRooms.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20180102153009_chatRooms.cs b/src/Yavsc.Server/Migrations/2018/20180102153009_chatRooms.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180102153009_chatRooms.cs rename to src/Yavsc.Server/Migrations/2018/20180102153009_chatRooms.cs diff --git a/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.Designer.cs b/src/Yavsc.Server/Migrations/2018/20180209144114_rejectQuery.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180209144114_rejectQuery.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20180209144114_rejectQuery.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20180209144114_rejectQuery.cs b/src/Yavsc.Server/Migrations/2018/20180209144114_rejectQuery.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180209144114_rejectQuery.cs rename to src/Yavsc.Server/Migrations/2018/20180209144114_rejectQuery.cs diff --git a/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.Designer.cs b/src/Yavsc.Server/Migrations/2018/20180420213912_mailingTemplates.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20180420213912_mailingTemplates.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.cs b/src/Yavsc.Server/Migrations/2018/20180420213912_mailingTemplates.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180420213912_mailingTemplates.cs rename to src/Yavsc.Server/Migrations/2018/20180420213912_mailingTemplates.cs diff --git a/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.Designer.cs b/src/Yavsc.Server/Migrations/2018/20180503100246_userAllowMonthlyEmail.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20180503100246_userAllowMonthlyEmail.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.cs b/src/Yavsc.Server/Migrations/2018/20180503100246_userAllowMonthlyEmail.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180503100246_userAllowMonthlyEmail.cs rename to src/Yavsc.Server/Migrations/2018/20180503100246_userAllowMonthlyEmail.cs diff --git a/src/Yavsc/Migrations/2018/20180625113528_Git.Designer.cs b/src/Yavsc.Server/Migrations/2018/20180625113528_Git.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180625113528_Git.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20180625113528_Git.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20180625113528_Git.cs b/src/Yavsc.Server/Migrations/2018/20180625113528_Git.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180625113528_Git.cs rename to src/Yavsc.Server/Migrations/2018/20180625113528_Git.cs diff --git a/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.Designer.cs b/src/Yavsc.Server/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.cs b/src/Yavsc.Server/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.cs rename to src/Yavsc.Server/Migrations/2018/20180703224638_wrongProjectConfigForeignKey.cs diff --git a/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.Designer.cs b/src/Yavsc.Server/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.cs b/src/Yavsc.Server/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.cs rename to src/Yavsc.Server/Migrations/2018/20180703231814_wrongProjectConfigForeignKeyBis.cs diff --git a/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.Designer.cs b/src/Yavsc.Server/Migrations/2018/20180805122812_gitprojectref.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180805122812_gitprojectref.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20180805122812_gitprojectref.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20180805122812_gitprojectref.cs b/src/Yavsc.Server/Migrations/2018/20180805122812_gitprojectref.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20180805122812_gitprojectref.cs rename to src/Yavsc.Server/Migrations/2018/20180805122812_gitprojectref.cs diff --git a/src/Yavsc/Migrations/2018/20181212103501_blogLang.Designer.cs b/src/Yavsc.Server/Migrations/2018/20181212103501_blogLang.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20181212103501_blogLang.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20181212103501_blogLang.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20181212103501_blogLang.cs b/src/Yavsc.Server/Migrations/2018/20181212103501_blogLang.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20181212103501_blogLang.cs rename to src/Yavsc.Server/Migrations/2018/20181212103501_blogLang.cs diff --git a/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.Designer.cs b/src/Yavsc.Server/Migrations/2018/20181218152420_BlogTradModel.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20181218152420_BlogTradModel.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.cs b/src/Yavsc.Server/Migrations/2018/20181218152420_BlogTradModel.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20181218152420_BlogTradModel.cs rename to src/Yavsc.Server/Migrations/2018/20181218152420_BlogTradModel.cs diff --git a/src/Yavsc/Migrations/2018/20181231153224_bugTitles.Designer.cs b/src/Yavsc.Server/Migrations/2018/20181231153224_bugTitles.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20181231153224_bugTitles.Designer.cs rename to src/Yavsc.Server/Migrations/2018/20181231153224_bugTitles.Designer.cs diff --git a/src/Yavsc/Migrations/2018/20181231153224_bugTitles.cs b/src/Yavsc.Server/Migrations/2018/20181231153224_bugTitles.cs similarity index 100% rename from src/Yavsc/Migrations/2018/20181231153224_bugTitles.cs rename to src/Yavsc.Server/Migrations/2018/20181231153224_bugTitles.cs diff --git a/src/Yavsc/Migrations/2019/20190730164137_publicCircle.Designer.cs b/src/Yavsc.Server/Migrations/2019/20190730164137_publicCircle.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190730164137_publicCircle.Designer.cs rename to src/Yavsc.Server/Migrations/2019/20190730164137_publicCircle.Designer.cs diff --git a/src/Yavsc/Migrations/2019/20190730164137_publicCircle.cs b/src/Yavsc.Server/Migrations/2019/20190730164137_publicCircle.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190730164137_publicCircle.cs rename to src/Yavsc.Server/Migrations/2019/20190730164137_publicCircle.cs diff --git a/src/Yavsc/Migrations/2019/20190803204448_fileCircle.Designer.cs b/src/Yavsc.Server/Migrations/2019/20190803204448_fileCircle.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190803204448_fileCircle.Designer.cs rename to src/Yavsc.Server/Migrations/2019/20190803204448_fileCircle.Designer.cs diff --git a/src/Yavsc/Migrations/2019/20190803204448_fileCircle.cs b/src/Yavsc.Server/Migrations/2019/20190803204448_fileCircle.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190803204448_fileCircle.cs rename to src/Yavsc.Server/Migrations/2019/20190803204448_fileCircle.cs diff --git a/src/Yavsc/Migrations/2019/20190804232432_circleAnnotations.Designer.cs b/src/Yavsc.Server/Migrations/2019/20190804232432_circleAnnotations.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190804232432_circleAnnotations.Designer.cs rename to src/Yavsc.Server/Migrations/2019/20190804232432_circleAnnotations.Designer.cs diff --git a/src/Yavsc/Migrations/2019/20190804232432_circleAnnotations.cs b/src/Yavsc.Server/Migrations/2019/20190804232432_circleAnnotations.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190804232432_circleAnnotations.cs rename to src/Yavsc.Server/Migrations/2019/20190804232432_circleAnnotations.cs diff --git a/src/Yavsc/Migrations/2019/20190819220343_intrumentRatingConstraint.Designer.cs b/src/Yavsc.Server/Migrations/2019/20190819220343_intrumentRatingConstraint.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190819220343_intrumentRatingConstraint.Designer.cs rename to src/Yavsc.Server/Migrations/2019/20190819220343_intrumentRatingConstraint.Designer.cs diff --git a/src/Yavsc/Migrations/2019/20190819220343_intrumentRatingConstraint.cs b/src/Yavsc.Server/Migrations/2019/20190819220343_intrumentRatingConstraint.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190819220343_intrumentRatingConstraint.cs rename to src/Yavsc.Server/Migrations/2019/20190819220343_intrumentRatingConstraint.cs diff --git a/src/Yavsc/Migrations/2019/20190819221632_instRateWInst.Designer.cs b/src/Yavsc.Server/Migrations/2019/20190819221632_instRateWInst.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190819221632_instRateWInst.Designer.cs rename to src/Yavsc.Server/Migrations/2019/20190819221632_instRateWInst.Designer.cs diff --git a/src/Yavsc/Migrations/2019/20190819221632_instRateWInst.cs b/src/Yavsc.Server/Migrations/2019/20190819221632_instRateWInst.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190819221632_instRateWInst.cs rename to src/Yavsc.Server/Migrations/2019/20190819221632_instRateWInst.cs diff --git a/src/Yavsc/Migrations/2019/20190826132314_bugDescriptionLength.Designer.cs b/src/Yavsc.Server/Migrations/2019/20190826132314_bugDescriptionLength.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190826132314_bugDescriptionLength.Designer.cs rename to src/Yavsc.Server/Migrations/2019/20190826132314_bugDescriptionLength.Designer.cs diff --git a/src/Yavsc/Migrations/2019/20190826132314_bugDescriptionLength.cs b/src/Yavsc.Server/Migrations/2019/20190826132314_bugDescriptionLength.cs similarity index 100% rename from src/Yavsc/Migrations/2019/20190826132314_bugDescriptionLength.cs rename to src/Yavsc.Server/Migrations/2019/20190826132314_bugDescriptionLength.cs diff --git a/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.Designer.cs b/src/Yavsc.Server/Migrations/2019/T1/20190103110008_liveSetup.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.Designer.cs rename to src/Yavsc.Server/Migrations/2019/T1/20190103110008_liveSetup.Designer.cs diff --git a/src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.cs b/src/Yavsc.Server/Migrations/2019/T1/20190103110008_liveSetup.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T1/20190103110008_liveSetup.cs rename to src/Yavsc.Server/Migrations/2019/T1/20190103110008_liveSetup.cs diff --git a/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.Designer.cs b/src/Yavsc.Server/Migrations/2019/T1/20190126133339_banTarget.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.Designer.cs rename to src/Yavsc.Server/Migrations/2019/T1/20190126133339_banTarget.Designer.cs diff --git a/src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.cs b/src/Yavsc.Server/Migrations/2019/T1/20190126133339_banTarget.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T1/20190126133339_banTarget.cs rename to src/Yavsc.Server/Migrations/2019/T1/20190126133339_banTarget.cs diff --git a/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.Designer.cs b/src/Yavsc.Server/Migrations/2019/T1/20190127105601_banReason.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T1/20190127105601_banReason.Designer.cs rename to src/Yavsc.Server/Migrations/2019/T1/20190127105601_banReason.Designer.cs diff --git a/src/Yavsc/Migrations/2019/T1/20190127105601_banReason.cs b/src/Yavsc.Server/Migrations/2019/T1/20190127105601_banReason.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T1/20190127105601_banReason.cs rename to src/Yavsc.Server/Migrations/2019/T1/20190127105601_banReason.cs diff --git a/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.Designer.cs b/src/Yavsc.Server/Migrations/2019/T1/20190204162909_liveFlowSeqnum.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.Designer.cs rename to src/Yavsc.Server/Migrations/2019/T1/20190204162909_liveFlowSeqnum.Designer.cs diff --git a/src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.cs b/src/Yavsc.Server/Migrations/2019/T1/20190204162909_liveFlowSeqnum.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T1/20190204162909_liveFlowSeqnum.cs rename to src/Yavsc.Server/Migrations/2019/T1/20190204162909_liveFlowSeqnum.cs diff --git a/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.Designer.cs b/src/Yavsc.Server/Migrations/2019/T2/20190507142752_chatAccess.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.Designer.cs rename to src/Yavsc.Server/Migrations/2019/T2/20190507142752_chatAccess.Designer.cs diff --git a/src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.cs b/src/Yavsc.Server/Migrations/2019/T2/20190507142752_chatAccess.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T2/20190507142752_chatAccess.cs rename to src/Yavsc.Server/Migrations/2019/T2/20190507142752_chatAccess.cs diff --git a/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.Designer.cs b/src/Yavsc.Server/Migrations/2019/T2/20190508004238_dropGCM.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.Designer.cs rename to src/Yavsc.Server/Migrations/2019/T2/20190508004238_dropGCM.Designer.cs diff --git a/src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.cs b/src/Yavsc.Server/Migrations/2019/T2/20190508004238_dropGCM.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T2/20190508004238_dropGCM.cs rename to src/Yavsc.Server/Migrations/2019/T2/20190508004238_dropGCM.cs diff --git a/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.Designer.cs b/src/Yavsc.Server/Migrations/2019/T2/20190510021107_chanDates.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.Designer.cs rename to src/Yavsc.Server/Migrations/2019/T2/20190510021107_chanDates.Designer.cs diff --git a/src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.cs b/src/Yavsc.Server/Migrations/2019/T2/20190510021107_chanDates.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T2/20190510021107_chanDates.cs rename to src/Yavsc.Server/Migrations/2019/T2/20190510021107_chanDates.cs diff --git a/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.Designer.cs b/src/Yavsc.Server/Migrations/2019/T2/20190622172941_userTrack.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.Designer.cs rename to src/Yavsc.Server/Migrations/2019/T2/20190622172941_userTrack.Designer.cs diff --git a/src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.cs b/src/Yavsc.Server/Migrations/2019/T2/20190622172941_userTrack.cs similarity index 100% rename from src/Yavsc/Migrations/2019/T2/20190622172941_userTrack.cs rename to src/Yavsc.Server/Migrations/2019/T2/20190622172941_userTrack.cs diff --git a/src/Yavsc/Migrations/2021/20210530122042_template-key.Designer.cs b/src/Yavsc.Server/Migrations/2021/20210530122042_template-key.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2021/20210530122042_template-key.Designer.cs rename to src/Yavsc.Server/Migrations/2021/20210530122042_template-key.Designer.cs diff --git a/src/Yavsc/Migrations/2021/20210530122042_template-key.cs b/src/Yavsc.Server/Migrations/2021/20210530122042_template-key.cs similarity index 100% rename from src/Yavsc/Migrations/2021/20210530122042_template-key.cs rename to src/Yavsc.Server/Migrations/2021/20210530122042_template-key.cs diff --git a/src/Yavsc/Migrations/2021/20210530213408_mailling-not-mailling-lists.Designer.cs b/src/Yavsc.Server/Migrations/2021/20210530213408_mailling-not-mailling-lists.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2021/20210530213408_mailling-not-mailling-lists.Designer.cs rename to src/Yavsc.Server/Migrations/2021/20210530213408_mailling-not-mailling-lists.Designer.cs diff --git a/src/Yavsc/Migrations/2021/20210530213408_mailling-not-mailling-lists.cs b/src/Yavsc.Server/Migrations/2021/20210530213408_mailling-not-mailling-lists.cs similarity index 100% rename from src/Yavsc/Migrations/2021/20210530213408_mailling-not-mailling-lists.cs rename to src/Yavsc.Server/Migrations/2021/20210530213408_mailling-not-mailling-lists.cs diff --git a/src/Yavsc/Migrations/2021/20210603172023_no-more-circle-autorisation-to-file.Designer.cs b/src/Yavsc.Server/Migrations/2021/20210603172023_no-more-circle-autorisation-to-file.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/2021/20210603172023_no-more-circle-autorisation-to-file.Designer.cs rename to src/Yavsc.Server/Migrations/2021/20210603172023_no-more-circle-autorisation-to-file.Designer.cs diff --git a/src/Yavsc/Migrations/2021/20210603172023_no-more-circle-autorisation-to-file.cs b/src/Yavsc.Server/Migrations/2021/20210603172023_no-more-circle-autorisation-to-file.cs similarity index 100% rename from src/Yavsc/Migrations/2021/20210603172023_no-more-circle-autorisation-to-file.cs rename to src/Yavsc.Server/Migrations/2021/20210603172023_no-more-circle-autorisation-to-file.cs diff --git a/src/Yavsc/Migrations/20230326173049_net7.Designer.cs b/src/Yavsc.Server/Migrations/20230326173049_net7.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/20230326173049_net7.Designer.cs rename to src/Yavsc.Server/Migrations/20230326173049_net7.Designer.cs diff --git a/src/Yavsc/Migrations/20230326173049_net7.cs b/src/Yavsc.Server/Migrations/20230326173049_net7.cs similarity index 100% rename from src/Yavsc/Migrations/20230326173049_net7.cs rename to src/Yavsc.Server/Migrations/20230326173049_net7.cs diff --git a/src/Yavsc/Migrations/20230405203545_userreload.Designer.cs b/src/Yavsc.Server/Migrations/20230405203545_userreload.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/20230405203545_userreload.Designer.cs rename to src/Yavsc.Server/Migrations/20230405203545_userreload.Designer.cs diff --git a/src/Yavsc/Migrations/20230405203545_userreload.cs b/src/Yavsc.Server/Migrations/20230405203545_userreload.cs similarity index 100% rename from src/Yavsc/Migrations/20230405203545_userreload.cs rename to src/Yavsc.Server/Migrations/20230405203545_userreload.cs diff --git a/src/Yavsc/Migrations/20230405210700_nullableFullname.Designer.cs b/src/Yavsc.Server/Migrations/20230405210700_nullableFullname.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/20230405210700_nullableFullname.Designer.cs rename to src/Yavsc.Server/Migrations/20230405210700_nullableFullname.Designer.cs diff --git a/src/Yavsc/Migrations/20230405210700_nullableFullname.cs b/src/Yavsc.Server/Migrations/20230405210700_nullableFullname.cs similarity index 100% rename from src/Yavsc/Migrations/20230405210700_nullableFullname.cs rename to src/Yavsc.Server/Migrations/20230405210700_nullableFullname.cs diff --git a/src/Yavsc/Migrations/20241106133541_dismiss.Designer.cs b/src/Yavsc.Server/Migrations/20241106133541_dismiss.Designer.cs similarity index 100% rename from src/Yavsc/Migrations/20241106133541_dismiss.Designer.cs rename to src/Yavsc.Server/Migrations/20241106133541_dismiss.Designer.cs diff --git a/src/Yavsc/Migrations/20241106133541_dismiss.cs b/src/Yavsc.Server/Migrations/20241106133541_dismiss.cs similarity index 100% rename from src/Yavsc/Migrations/20241106133541_dismiss.cs rename to src/Yavsc.Server/Migrations/20241106133541_dismiss.cs diff --git a/src/Yavsc.Server/Migrations/20241214154207_commentReceiver.Designer.cs b/src/Yavsc.Server/Migrations/20241214154207_commentReceiver.Designer.cs new file mode 100644 index 00000000..bdca338d --- /dev/null +++ b/src/Yavsc.Server/Migrations/20241214154207_commentReceiver.Designer.cs @@ -0,0 +1,3519 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Yavsc.Models; + +#nullable disable + +namespace Yavsc.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20241214154207_commentReceiver")] + partial class commentReceiver + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.2") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Yavsc.Abstract.Identity.ClientProviderInfo", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Avatar") + .IsRequired() + .HasColumnType("text"); + + b.Property("BillingAddressId") + .HasColumnType("bigint"); + + b.Property("EMail") + .IsRequired() + .HasColumnType("text"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("ClientProviderInfo"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.Property("TargetId") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("TargetId"); + + b.ToTable("Ban"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.HasIndex("UserId"); + + b.ToTable("BlackListed"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => + { + b.Property("CircleId") + .HasColumnType("bigint"); + + b.Property("BlogPostId") + .HasColumnType("bigint"); + + b.HasKey("CircleId", "BlogPostId"); + + b.HasIndex("BlogPostId"); + + b.ToTable("CircleAuthorizationToBlogPost"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("ContactCredits") + .HasColumnType("bigint"); + + b.Property("Credits") + .HasColumnType("numeric"); + + b.HasKey("UserId"); + + b.ToTable("BankStatus"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("AllowMonthlyEmail") + .HasColumnType("boolean"); + + b.Property("Avatar") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasDefaultValue("/images/Users/icon_user.png"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("DedicatedGoogleCalendar") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DiskQuota") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(524288000L); + + b.Property("DiskUsage") + .HasColumnType("bigint"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("FullName") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("MaxFileSize") + .HasColumnType("bigint"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("PostalAddressId") + .HasColumnType("bigint"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasAlternateKey("Email"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.HasIndex("PostalAddressId"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("AccessTokenLifetime") + .HasColumnType("integer"); + + b.Property("Active") + .HasColumnType("boolean"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LogoutRedirectUri") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RedirectUri") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RefreshTokenLifeTime") + .HasColumnType("integer"); + + b.Property("Secret") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Applications"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.OAuth2Tokens", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("AccessToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("Expiration") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresIn") + .IsRequired() + .HasColumnType("text"); + + b.Property("RefreshToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("TokenType") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("OAuth2Tokens"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ExpiresUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("IssuedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ProtectedTicket") + .IsRequired() + .HasColumnType("text"); + + b.Property("Subject") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.ToTable("RefreshTokens"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Scope", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.ToTable("Scopes"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BalanceId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ExecDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Impact") + .HasColumnType("numeric"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("BalanceId"); + + b.ToTable("BankBook"); + }); + + modelBuilder.Entity("Yavsc.Models.Bank.BankIdentity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AccountNumber") + .IsRequired() + .HasColumnType("text"); + + b.Property("BIC") + .IsRequired() + .HasColumnType("text"); + + b.Property("BankCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("BankedKey") + .HasColumnType("integer"); + + b.Property("IBAN") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WicketCode") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("BankIdentity"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("integer"); + + b.Property("Currency") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("EstimateId") + .HasColumnType("bigint"); + + b.Property("EstimateTemplateId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("UnitaryCost") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.HasIndex("EstimateId"); + + b.HasIndex("EstimateTemplateId"); + + b.ToTable("CommandLine"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AttachedFilesString") + .IsRequired() + .HasColumnType("text"); + + b.Property("AttachedGraphicsString") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CommandId") + .HasColumnType("bigint"); + + b.Property("CommandType") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProviderValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.HasIndex("CommandId"); + + b.HasIndex("OwnerId"); + + b.ToTable("Estimates"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EstimateTemplates"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b => + { + b.Property("SIREN") + .HasColumnType("text"); + + b.HasKey("SIREN"); + + b.ToTable("ExceptionsSIREN"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuthorId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(56224) + .HasColumnType("character varying(56224)"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Photo") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("Visible") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.ToTable("Blogspot"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogTag", b => + { + b.Property("PostId") + .HasColumnType("bigint"); + + b.Property("TagId") + .HasColumnType("bigint"); + + b.HasKey("PostId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("BlogTag"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuthorId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Content") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("PostId") + .HasColumnType("bigint"); + + b.Property("ReceiverId") + .HasColumnType("bigint"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("Visible") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.HasIndex("ParentId"); + + b.HasIndex("PostId"); + + b.ToTable("Comment"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => + { + b.Property("OwnerId") + .HasColumnType("text"); + + b.HasKey("OwnerId"); + + b.ToTable("Schedule"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.ScheduledEvent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("PeriodEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("PeriodStart") + .HasColumnType("timestamp with time zone"); + + b.Property("Reccurence") + .HasColumnType("integer"); + + b.Property("ScheduleOwnerId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ScheduleOwnerId"); + + b.HasIndex("PeriodStart", "PeriodEnd"); + + b.ToTable("ScheduledEvent"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatConnection", b => + { + b.Property("ConnectionId") + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Connected") + .HasColumnType("boolean"); + + b.Property("UserAgent") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("ConnectionId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("ChatConnection"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => + { + b.Property("Name") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LatestJoinPart") + .HasColumnType("timestamp with time zone"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Name"); + + b.HasIndex("OwnerId"); + + b.ToTable("ChatRoom"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b => + { + b.Property("ChannelName") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Level") + .HasColumnType("integer"); + + b.HasKey("ChannelName", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("ChatRoomAccess"); + }); + + modelBuilder.Entity("Yavsc.Models.Cratie.Option", b => + { + b.Property("Code") + .HasColumnType("text"); + + b.Property("CodeScrutin") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code", "CodeScrutin"); + + b.ToTable("Option"); + }); + + modelBuilder.Entity("Yavsc.Models.Drawing.Color", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Blue") + .HasColumnType("smallint"); + + b.Property("Green") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Red") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.ToTable("Color"); + }); + + modelBuilder.Entity("Yavsc.Models.Forms.Form", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Summary") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Form"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("ActionDistance") + .HasColumnType("integer"); + + b.Property("CarePrice") + .HasColumnType("numeric"); + + b.Property("FlatFeeDiscount") + .HasColumnType("numeric"); + + b.Property("HalfBalayagePrice") + .HasColumnType("numeric"); + + b.Property("HalfBrushingPrice") + .HasColumnType("numeric"); + + b.Property("HalfColorPrice") + .HasColumnType("numeric"); + + b.Property("HalfDefrisPrice") + .HasColumnType("numeric"); + + b.Property("HalfFoldingPrice") + .HasColumnType("numeric"); + + b.Property("HalfMechPrice") + .HasColumnType("numeric"); + + b.Property("HalfMultiColorPrice") + .HasColumnType("numeric"); + + b.Property("HalfPermanentPrice") + .HasColumnType("numeric"); + + b.Property("KidCutPrice") + .HasColumnType("numeric"); + + b.Property("LongBalayagePrice") + .HasColumnType("numeric"); + + b.Property("LongBrushingPrice") + .HasColumnType("numeric"); + + b.Property("LongColorPrice") + .HasColumnType("numeric"); + + b.Property("LongDefrisPrice") + .HasColumnType("numeric"); + + b.Property("LongFoldingPrice") + .HasColumnType("numeric"); + + b.Property("LongMechPrice") + .HasColumnType("numeric"); + + b.Property("LongMultiColorPrice") + .HasColumnType("numeric"); + + b.Property("LongPermanentPrice") + .HasColumnType("numeric"); + + b.Property("ManBrushPrice") + .HasColumnType("numeric"); + + b.Property("ManCutPrice") + .HasColumnType("numeric"); + + b.Property("ScheduleOwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShampooPrice") + .HasColumnType("numeric"); + + b.Property("ShortBalayagePrice") + .HasColumnType("numeric"); + + b.Property("ShortBrushingPrice") + .HasColumnType("numeric"); + + b.Property("ShortColorPrice") + .HasColumnType("numeric"); + + b.Property("ShortDefrisPrice") + .HasColumnType("numeric"); + + b.Property("ShortFoldingPrice") + .HasColumnType("numeric"); + + b.Property("ShortMechPrice") + .HasColumnType("numeric"); + + b.Property("ShortMultiColorPrice") + .HasColumnType("numeric"); + + b.Property("ShortPermanentPrice") + .HasColumnType("numeric"); + + b.Property("WomenHalfCutPrice") + .HasColumnType("numeric"); + + b.Property("WomenLongCutPrice") + .HasColumnType("numeric"); + + b.Property("WomenShortCutPrice") + .HasColumnType("numeric"); + + b.HasKey("UserId"); + + b.HasIndex("ScheduleOwnerId"); + + b.ToTable("BrusherProfile"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("AdditionalInfo") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("SelectedProfileUserId") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.HasIndex("PrestationId"); + + b.HasIndex("SelectedProfileUserId"); + + b.ToTable("HairCutQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("HairMultiCutQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Cares") + .HasColumnType("boolean"); + + b.Property("Cut") + .HasColumnType("boolean"); + + b.Property("Dressing") + .HasColumnType("integer"); + + b.Property("Gender") + .HasColumnType("integer"); + + b.Property("Length") + .HasColumnType("integer"); + + b.Property("Shampoo") + .HasColumnType("boolean"); + + b.Property("Tech") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("HairPrestation"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestationCollectionItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.Property("QueryId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("PrestationId"); + + b.HasIndex("QueryId"); + + b.ToTable("HairPrestationCollectionItem"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Brand") + .IsRequired() + .HasColumnType("text"); + + b.Property("ColorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ColorId"); + + b.ToTable("HairTaint"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaintInstance", b => + { + b.Property("TaintId") + .HasColumnType("bigint"); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.HasKey("TaintId", "PrestationId"); + + b.HasIndex("PrestationId"); + + b.ToTable("HairTaintInstance"); + }); + + modelBuilder.Entity("Yavsc.Models.IT.Evolution.Feature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Feature"); + }); + + modelBuilder.Entity("Yavsc.Models.IT.Fixing.Bug", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("FeatureId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FeatureId"); + + b.ToTable("Bug"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b => + { + b.Property("DeviceId") + .HasColumnType("text"); + + b.Property("DeclarationDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("LOCALTIMESTAMP"); + + b.Property("DeviceOwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("LatestActivityUpdate") + .HasColumnType("timestamp with time zone"); + + b.Property("Model") + .IsRequired() + .HasColumnType("text"); + + b.Property("Platform") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("DeviceId"); + + b.HasIndex("DeviceOwnerId"); + + b.ToTable("DeviceDeclaration"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Depth") + .HasColumnType("numeric"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Height") + .HasColumnType("numeric"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Price") + .HasColumnType("numeric"); + + b.Property("Public") + .HasColumnType("boolean"); + + b.Property("Weight") + .HasColumnType("numeric"); + + b.Property("Width") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.ToTable("Products"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContextId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Public") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("ContextId"); + + b.ToTable("Services"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("For") + .HasColumnType("smallint"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Sender") + .IsRequired() + .HasColumnType("text"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("Announce"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.DismissClicked", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "NotificationId"); + + b.HasIndex("NotificationId"); + + b.ToTable("DismissClicked"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Target") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("body") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("click_action") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("color") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("icon") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasDefaultValue("exclam"); + + b.Property("sound") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("tag") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("title") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.ToTable("Notification"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Instrument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.ToTable("Instrument"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.InstrumentRating", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("InstrumentId") + .HasColumnType("bigint"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasAlternateKey("InstrumentId", "OwnerId"); + + b.HasIndex("OwnerId"); + + b.ToTable("InstrumentRating"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => + { + b.Property("OwnerProfileId") + .HasColumnType("text"); + + b.Property("DjSettingsUserId") + .HasColumnType("text"); + + b.Property("GeneralSettingsUserId") + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("TendencyId") + .HasColumnType("bigint"); + + b.HasKey("OwnerProfileId"); + + b.HasIndex("DjSettingsUserId"); + + b.HasIndex("GeneralSettingsUserId"); + + b.ToTable("MusicalPreference"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalTendency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.ToTable("MusicalTendency"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.DjSettings", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("SoundCloudId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("DjSettings"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.GeneralSettings", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("GeneralSettings"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => + { + b.Property("InstrumentId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("InstrumentId", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("Instrumentation"); + }); + + modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => + { + b.Property("CreationToken") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ExecutorId") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrderReference") + .IsRequired() + .HasColumnType("text"); + + b.Property("PaypalPayerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("CreationToken"); + + b.HasIndex("ExecutorId"); + + b.ToTable("PayPalPayment"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Public") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Circle"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => + { + b.Property("MemberId") + .HasColumnType("text"); + + b.Property("CircleId") + .HasColumnType("bigint"); + + b.HasKey("MemberId", "CircleId"); + + b.HasIndex("CircleId"); + + b.ToTable("CircleMembers"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => + { + b.Property("OwnerId") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("EMail") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("OwnerId", "UserId"); + + b.HasIndex("AddressId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Contact"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b => + { + b.Property("HRef") + .HasColumnType("text"); + + b.Property("Method") + .HasColumnType("text"); + + b.Property("BrusherProfileUserId") + .HasColumnType("text"); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("text"); + + b.Property("PayPalPaymentCreationToken") + .HasColumnType("text"); + + b.Property("Rel") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("HRef", "Method"); + + b.HasIndex("BrusherProfileUserId"); + + b.HasIndex("PayPalPaymentCreationToken"); + + b.ToTable("HyperLink"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("Latitude") + .HasColumnType("double precision"); + + b.Property("Longitude") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.ToTable("Locations"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.PostalAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("City") + .IsRequired() + .HasColumnType("text"); + + b.Property("Country") + .IsRequired() + .HasColumnType("text"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("Province") + .IsRequired() + .HasColumnType("text"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.Property("Street1") + .IsRequired() + .HasColumnType("text"); + + b.Property("Street2") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PostalAddress"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Tags"); + }); + + modelBuilder.Entity("Yavsc.Models.Skill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SiteSkills"); + }); + + modelBuilder.Entity("Yavsc.Models.Streaming.LiveFlow", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DifferedFileName") + .IsRequired() + .HasColumnType("text"); + + b.Property("MediaType") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Pitch") + .IsRequired() + .HasColumnType("text"); + + b.Property("SequenceNumber") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("LiveFlow"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.Property("Code") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Hidden") + .HasColumnType("boolean"); + + b.Property("ModeratorGroupName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentCode") + .HasColumnType("text"); + + b.Property("Photo") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("SettingsClassName") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.HasIndex("ParentCode"); + + b.ToTable("Activities"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("FormationSettingsUserId") + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkingForId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FormationSettingsUserId"); + + b.HasIndex("PerformerId"); + + b.HasIndex("WorkingForId"); + + b.ToTable("CoWorking"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ActionName") + .IsRequired() + .HasColumnType("text"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.ToTable("CommandForm"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Property("PerformerId") + .HasColumnType("text"); + + b.Property("AcceptNotifications") + .HasColumnType("boolean"); + + b.Property("AcceptPublicContact") + .HasColumnType("boolean"); + + b.Property("Active") + .HasColumnType("boolean"); + + b.Property("MaxDailyCost") + .HasColumnType("integer"); + + b.Property("MinDailyCost") + .HasColumnType("integer"); + + b.Property("OrganizationAddressId") + .HasColumnType("bigint"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("SIREN") + .IsRequired() + .HasColumnType("text"); + + b.Property("UseGeoLocalizationToReduceDistanceWithClients") + .HasColumnType("boolean"); + + b.Property("WebSite") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("PerformerId"); + + b.HasIndex("OrganizationAddressId"); + + b.ToTable("Performers"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("FormationSettings"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("LocationType") + .HasColumnType("integer"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("RdvQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => + { + b.Property("DoesCode") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Weight") + .HasColumnType("integer"); + + b.HasKey("DoesCode", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UserActivities"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.Calendar.Period", b => + { + b.Property("Start") + .HasColumnType("timestamp with time zone"); + + b.Property("End") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Start", "End"); + + b.ToTable("Period"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.EMailing.MailingTemplate", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Body") + .IsRequired() + .HasMaxLength(65536) + .HasColumnType("character varying(65536)"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplyToAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("ToSend") + .HasColumnType("integer"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("MailingTemplate"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("GitId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("GitId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("Project"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProjectId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProjectId"); + + b.ToTable("ProjectBuildConfiguration"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Branch") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Path") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("GitRepositoryReference"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Yavsc.Models.Access.Ban", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "TargetUser") + .WithMany() + .HasForeignKey("TargetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TargetUser"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany("BlackList") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => + { + b.HasOne("Yavsc.Models.Blog.BlogPost", "Target") + .WithMany("ACL") + .HasForeignKey("BlogPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Circle", "Allowed") + .WithMany() + .HasForeignKey("CircleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Allowed"); + + b.Navigation("Target"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithOne("AccountBalance") + .HasForeignKey("Yavsc.Models.AccountBalance", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.HasOne("Yavsc.Models.Relationship.Location", "PostalAddress") + .WithMany() + .HasForeignKey("PostalAddressId"); + + b.Navigation("PostalAddress"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.HasOne("Yavsc.Models.AccountBalance", "Balance") + .WithMany() + .HasForeignKey("BalanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Balance"); + }); + + modelBuilder.Entity("Yavsc.Models.Bank.BankIdentity", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany("BankInfo") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.HasOne("Yavsc.Models.Billing.Estimate", null) + .WithMany("Bill") + .HasForeignKey("EstimateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Billing.EstimateTemplate", null) + .WithMany("Bill") + .HasForeignKey("EstimateTemplateId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.RdvQuery", "Query") + .WithMany() + .HasForeignKey("CommandId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Owner"); + + b.Navigation("Query"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Author") + .WithMany("Posts") + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogTag", b => + { + b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") + .WithMany("Tags") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Tag", "Tag") + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Post"); + + b.Navigation("Tag"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Author") + .WithMany() + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Blog.Comment", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + + b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") + .WithMany("Comments") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("Parent"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.ScheduledEvent", b => + { + b.HasOne("Yavsc.Models.Calendar.Schedule", null) + .WithMany("Events") + .HasForeignKey("ScheduleOwnerId"); + + b.HasOne("Yavsc.Server.Models.Calendar.Period", "Period") + .WithMany() + .HasForeignKey("PeriodStart", "PeriodEnd") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Period"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatConnection", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany("Connections") + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany("Rooms") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b => + { + b.HasOne("Yavsc.Models.Chat.ChatRoom", "Room") + .WithMany("Moderation") + .HasForeignKey("ChannelName") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany("RoomAccess") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Room"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.HasOne("Yavsc.Models.Calendar.Schedule", "Schedule") + .WithMany() + .HasForeignKey("ScheduleOwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "BaseProfile") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("BaseProfile"); + + b.Navigation("Schedule"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId"); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany() + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.BrusherProfile", "SelectedProfile") + .WithMany() + .HasForeignKey("SelectedProfileUserId"); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Prestation"); + + b.Navigation("Regularisation"); + + b.Navigation("SelectedProfile"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularisation"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestationCollectionItem", b => + { + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany() + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairMultiCutQuery", "Query") + .WithMany("Prestations") + .HasForeignKey("QueryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Prestation"); + + b.Navigation("Query"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.HasOne("Yavsc.Models.Drawing.Color", "Color") + .WithMany() + .HasForeignKey("ColorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Color"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaintInstance", b => + { + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany("Taints") + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairTaint", "Taint") + .WithMany() + .HasForeignKey("TaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Prestation"); + + b.Navigation("Taint"); + }); + + modelBuilder.Entity("Yavsc.Models.IT.Fixing.Bug", b => + { + b.HasOne("Yavsc.Models.IT.Evolution.Feature", "False") + .WithMany() + .HasForeignKey("FeatureId"); + + b.Navigation("False"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "DeviceOwner") + .WithMany("DeviceDeclaration") + .HasForeignKey("DeviceOwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DeviceOwner"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany("Services") + .HasForeignKey("ContextId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Context"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.DismissClicked", b => + { + b.HasOne("Yavsc.Models.Messaging.Notification", "Notified") + .WithMany() + .HasForeignKey("NotificationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Notified"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.InstrumentRating", b => + { + b.HasOne("Yavsc.Models.Musical.Instrument", "Instrument") + .WithMany() + .HasForeignKey("InstrumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Profile") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Instrument"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => + { + b.HasOne("Yavsc.Models.Musical.Profiles.DjSettings", null) + .WithMany("SoundColor") + .HasForeignKey("DjSettingsUserId"); + + b.HasOne("Yavsc.Models.Musical.Profiles.GeneralSettings", null) + .WithMany("SoundColor") + .HasForeignKey("GeneralSettingsUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => + { + b.HasOne("Yavsc.Models.Musical.Instrument", "Tool") + .WithMany() + .HasForeignKey("InstrumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tool"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Executor") + .WithMany() + .HasForeignKey("ExecutorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Executor"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany("Circles") + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => + { + b.HasOne("Yavsc.Models.Relationship.Circle", "Circle") + .WithMany("Members") + .HasForeignKey("CircleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Member") + .WithMany("Membership") + .HasForeignKey("MemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Circle"); + + b.Navigation("Member"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => + { + b.HasOne("Yavsc.Models.Relationship.PostalAddress", "PostalAddress") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany("Book") + .HasForeignKey("ApplicationUserId"); + + b.Navigation("PostalAddress"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b => + { + b.HasOne("Yavsc.Models.Haircut.BrusherProfile", null) + .WithMany("Links") + .HasForeignKey("BrusherProfileUserId"); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", null) + .WithMany("Links") + .HasForeignKey("PayPalPaymentCreationToken"); + }); + + modelBuilder.Entity("Yavsc.Models.Streaming.LiveFlow", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Parent") + .WithMany("Children") + .HasForeignKey("ParentCode"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => + { + b.HasOne("Yavsc.Models.Workflow.Profiles.FormationSettings", null) + .WithMany("CoWorking") + .HasForeignKey("FormationSettingsUserId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Performer") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "WorkingFor") + .WithMany() + .HasForeignKey("WorkingForId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Performer"); + + b.Navigation("WorkingFor"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany("Forms") + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Context"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.HasOne("Yavsc.Models.Relationship.Location", "OrganizationAddress") + .WithMany() + .HasForeignKey("OrganizationAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Performer") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrganizationAddress"); + + b.Navigation("Performer"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularisation"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Does") + .WithMany() + .HasForeignKey("DoesCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "User") + .WithMany("Activity") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Does"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", "Repository") + .WithMany() + .HasForeignKey("GitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularisation"); + + b.Navigation("Repository"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => + { + b.HasOne("Yavsc.Server.Models.IT.Project", "TargetProject") + .WithMany("Configurations") + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TargetProject"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Navigation("AccountBalance") + .IsRequired(); + + b.Navigation("BankInfo"); + + b.Navigation("BlackList"); + + b.Navigation("Book"); + + b.Navigation("Circles"); + + b.Navigation("Connections"); + + b.Navigation("DeviceDeclaration"); + + b.Navigation("Membership"); + + b.Navigation("Posts"); + + b.Navigation("RoomAccess"); + + b.Navigation("Rooms"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Navigation("Bill"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => + { + b.Navigation("Bill"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => + { + b.Navigation("ACL"); + + b.Navigation("Comments"); + + b.Navigation("Tags"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => + { + b.Navigation("Events"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => + { + b.Navigation("Moderation"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.Navigation("Links"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.Navigation("Prestations"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => + { + b.Navigation("Taints"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.DjSettings", b => + { + b.Navigation("SoundColor"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.GeneralSettings", b => + { + b.Navigation("SoundColor"); + }); + + modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => + { + b.Navigation("Links"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.Navigation("Members"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.Navigation("Children"); + + b.Navigation("Forms"); + + b.Navigation("Services"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Navigation("Activity"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => + { + b.Navigation("CoWorking"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.Navigation("Configurations"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Yavsc.Server/Migrations/20241214154207_commentReceiver.cs b/src/Yavsc.Server/Migrations/20241214154207_commentReceiver.cs new file mode 100644 index 00000000..d8c249d8 --- /dev/null +++ b/src/Yavsc.Server/Migrations/20241214154207_commentReceiver.cs @@ -0,0 +1,125 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Yavsc.Migrations +{ + /// + public partial class commentReceiver : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "BlogTrad"); + + migrationBuilder.DropColumn( + name: "Lang", + table: "Blogspot"); + + migrationBuilder.RenameColumn( + name: "PostId", + table: "Comment", + newName: "ReceiverId" + ); + + migrationBuilder.AlterColumn( + name: "Title", + table: "Blogspot", + type: "character varying(1024)", + maxLength: 1024, + nullable: false, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "Photo", + table: "Blogspot", + type: "character varying(1024)", + maxLength: 1024, + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.AlterColumn( + name: "Content", + table: "Blogspot", + type: "character varying(56224)", + maxLength: 56224, + nullable: false, + oldClrType: typeof(string), + oldType: "text"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "ReceiverId", + table: "Comment", + newName: "PostId"); + + migrationBuilder.AlterColumn( + name: "Title", + table: "Blogspot", + type: "text", + nullable: false, + oldClrType: typeof(string), + oldType: "character varying(1024)", + oldMaxLength: 1024); + + migrationBuilder.AlterColumn( + name: "Photo", + table: "Blogspot", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "character varying(1024)", + oldMaxLength: 1024, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Content", + table: "Blogspot", + type: "text", + nullable: false, + oldClrType: typeof(string), + oldType: "character varying(56224)", + oldMaxLength: 56224); + + migrationBuilder.AddColumn( + name: "Lang", + table: "Blogspot", + type: "text", + nullable: false, + defaultValue: ""); + + migrationBuilder.CreateTable( + name: "BlogTrad", + columns: table => new + { + PostId = table.Column(type: "bigint", nullable: false), + Lang = table.Column(type: "text", nullable: false), + TraducerId = table.Column(type: "text", nullable: false), + Body = table.Column(type: "text", nullable: false), + Title = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BlogTrad", x => new { x.PostId, x.Lang }); + table.ForeignKey( + name: "FK_BlogTrad_AspNetUsers_TraducerId", + column: x => x.TraducerId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_BlogTrad_TraducerId", + table: "BlogTrad", + column: "TraducerId"); + } + } +} diff --git a/src/Yavsc.Server/Migrations/20241214201053_commentParent.Designer.cs b/src/Yavsc.Server/Migrations/20241214201053_commentParent.Designer.cs new file mode 100644 index 00000000..bbe6e68b --- /dev/null +++ b/src/Yavsc.Server/Migrations/20241214201053_commentParent.Designer.cs @@ -0,0 +1,3516 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Yavsc.Models; + +#nullable disable + +namespace Yavsc.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20241214201053_commentParent")] + partial class commentParent + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.2") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Yavsc.Abstract.Identity.ClientProviderInfo", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Avatar") + .IsRequired() + .HasColumnType("text"); + + b.Property("BillingAddressId") + .HasColumnType("bigint"); + + b.Property("EMail") + .IsRequired() + .HasColumnType("text"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("ClientProviderInfo"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.Property("TargetId") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("TargetId"); + + b.ToTable("Ban"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.HasIndex("UserId"); + + b.ToTable("BlackListed"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => + { + b.Property("CircleId") + .HasColumnType("bigint"); + + b.Property("BlogPostId") + .HasColumnType("bigint"); + + b.HasKey("CircleId", "BlogPostId"); + + b.HasIndex("BlogPostId"); + + b.ToTable("CircleAuthorizationToBlogPost"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("ContactCredits") + .HasColumnType("bigint"); + + b.Property("Credits") + .HasColumnType("numeric"); + + b.HasKey("UserId"); + + b.ToTable("BankStatus"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("AllowMonthlyEmail") + .HasColumnType("boolean"); + + b.Property("Avatar") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasDefaultValue("/images/Users/icon_user.png"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("DedicatedGoogleCalendar") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DiskQuota") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(524288000L); + + b.Property("DiskUsage") + .HasColumnType("bigint"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("FullName") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("MaxFileSize") + .HasColumnType("bigint"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("PostalAddressId") + .HasColumnType("bigint"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasAlternateKey("Email"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.HasIndex("PostalAddressId"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("AccessTokenLifetime") + .HasColumnType("integer"); + + b.Property("Active") + .HasColumnType("boolean"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LogoutRedirectUri") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RedirectUri") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RefreshTokenLifeTime") + .HasColumnType("integer"); + + b.Property("Secret") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Applications"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.OAuth2Tokens", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("AccessToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("Expiration") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresIn") + .IsRequired() + .HasColumnType("text"); + + b.Property("RefreshToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("TokenType") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("OAuth2Tokens"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ExpiresUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("IssuedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ProtectedTicket") + .IsRequired() + .HasColumnType("text"); + + b.Property("Subject") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.ToTable("RefreshTokens"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Scope", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.ToTable("Scopes"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BalanceId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ExecDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Impact") + .HasColumnType("numeric"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("BalanceId"); + + b.ToTable("BankBook"); + }); + + modelBuilder.Entity("Yavsc.Models.Bank.BankIdentity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AccountNumber") + .IsRequired() + .HasColumnType("text"); + + b.Property("BIC") + .IsRequired() + .HasColumnType("text"); + + b.Property("BankCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("BankedKey") + .HasColumnType("integer"); + + b.Property("IBAN") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WicketCode") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("BankIdentity"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("integer"); + + b.Property("Currency") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("EstimateId") + .HasColumnType("bigint"); + + b.Property("EstimateTemplateId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("UnitaryCost") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.HasIndex("EstimateId"); + + b.HasIndex("EstimateTemplateId"); + + b.ToTable("CommandLine"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AttachedFilesString") + .IsRequired() + .HasColumnType("text"); + + b.Property("AttachedGraphicsString") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CommandId") + .HasColumnType("bigint"); + + b.Property("CommandType") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProviderValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.HasIndex("CommandId"); + + b.HasIndex("OwnerId"); + + b.ToTable("Estimates"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EstimateTemplates"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b => + { + b.Property("SIREN") + .HasColumnType("text"); + + b.HasKey("SIREN"); + + b.ToTable("ExceptionsSIREN"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuthorId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(56224) + .HasColumnType("character varying(56224)"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Photo") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("Visible") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.ToTable("Blogspot"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogTag", b => + { + b.Property("PostId") + .HasColumnType("bigint"); + + b.Property("TagId") + .HasColumnType("bigint"); + + b.HasKey("PostId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("BlogTag"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuthorId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Content") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("ReceiverId") + .HasColumnType("bigint"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("Visible") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.HasIndex("ParentId"); + + b.HasIndex("ReceiverId"); + + b.ToTable("Comment"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => + { + b.Property("OwnerId") + .HasColumnType("text"); + + b.HasKey("OwnerId"); + + b.ToTable("Schedule"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.ScheduledEvent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("PeriodEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("PeriodStart") + .HasColumnType("timestamp with time zone"); + + b.Property("Reccurence") + .HasColumnType("integer"); + + b.Property("ScheduleOwnerId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ScheduleOwnerId"); + + b.HasIndex("PeriodStart", "PeriodEnd"); + + b.ToTable("ScheduledEvent"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatConnection", b => + { + b.Property("ConnectionId") + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Connected") + .HasColumnType("boolean"); + + b.Property("UserAgent") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("ConnectionId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("ChatConnection"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => + { + b.Property("Name") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LatestJoinPart") + .HasColumnType("timestamp with time zone"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Name"); + + b.HasIndex("OwnerId"); + + b.ToTable("ChatRoom"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b => + { + b.Property("ChannelName") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Level") + .HasColumnType("integer"); + + b.HasKey("ChannelName", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("ChatRoomAccess"); + }); + + modelBuilder.Entity("Yavsc.Models.Cratie.Option", b => + { + b.Property("Code") + .HasColumnType("text"); + + b.Property("CodeScrutin") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code", "CodeScrutin"); + + b.ToTable("Option"); + }); + + modelBuilder.Entity("Yavsc.Models.Drawing.Color", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Blue") + .HasColumnType("smallint"); + + b.Property("Green") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Red") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.ToTable("Color"); + }); + + modelBuilder.Entity("Yavsc.Models.Forms.Form", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Summary") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Form"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("ActionDistance") + .HasColumnType("integer"); + + b.Property("CarePrice") + .HasColumnType("numeric"); + + b.Property("FlatFeeDiscount") + .HasColumnType("numeric"); + + b.Property("HalfBalayagePrice") + .HasColumnType("numeric"); + + b.Property("HalfBrushingPrice") + .HasColumnType("numeric"); + + b.Property("HalfColorPrice") + .HasColumnType("numeric"); + + b.Property("HalfDefrisPrice") + .HasColumnType("numeric"); + + b.Property("HalfFoldingPrice") + .HasColumnType("numeric"); + + b.Property("HalfMechPrice") + .HasColumnType("numeric"); + + b.Property("HalfMultiColorPrice") + .HasColumnType("numeric"); + + b.Property("HalfPermanentPrice") + .HasColumnType("numeric"); + + b.Property("KidCutPrice") + .HasColumnType("numeric"); + + b.Property("LongBalayagePrice") + .HasColumnType("numeric"); + + b.Property("LongBrushingPrice") + .HasColumnType("numeric"); + + b.Property("LongColorPrice") + .HasColumnType("numeric"); + + b.Property("LongDefrisPrice") + .HasColumnType("numeric"); + + b.Property("LongFoldingPrice") + .HasColumnType("numeric"); + + b.Property("LongMechPrice") + .HasColumnType("numeric"); + + b.Property("LongMultiColorPrice") + .HasColumnType("numeric"); + + b.Property("LongPermanentPrice") + .HasColumnType("numeric"); + + b.Property("ManBrushPrice") + .HasColumnType("numeric"); + + b.Property("ManCutPrice") + .HasColumnType("numeric"); + + b.Property("ScheduleOwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShampooPrice") + .HasColumnType("numeric"); + + b.Property("ShortBalayagePrice") + .HasColumnType("numeric"); + + b.Property("ShortBrushingPrice") + .HasColumnType("numeric"); + + b.Property("ShortColorPrice") + .HasColumnType("numeric"); + + b.Property("ShortDefrisPrice") + .HasColumnType("numeric"); + + b.Property("ShortFoldingPrice") + .HasColumnType("numeric"); + + b.Property("ShortMechPrice") + .HasColumnType("numeric"); + + b.Property("ShortMultiColorPrice") + .HasColumnType("numeric"); + + b.Property("ShortPermanentPrice") + .HasColumnType("numeric"); + + b.Property("WomenHalfCutPrice") + .HasColumnType("numeric"); + + b.Property("WomenLongCutPrice") + .HasColumnType("numeric"); + + b.Property("WomenShortCutPrice") + .HasColumnType("numeric"); + + b.HasKey("UserId"); + + b.HasIndex("ScheduleOwnerId"); + + b.ToTable("BrusherProfile"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("AdditionalInfo") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("SelectedProfileUserId") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.HasIndex("PrestationId"); + + b.HasIndex("SelectedProfileUserId"); + + b.ToTable("HairCutQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("HairMultiCutQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Cares") + .HasColumnType("boolean"); + + b.Property("Cut") + .HasColumnType("boolean"); + + b.Property("Dressing") + .HasColumnType("integer"); + + b.Property("Gender") + .HasColumnType("integer"); + + b.Property("Length") + .HasColumnType("integer"); + + b.Property("Shampoo") + .HasColumnType("boolean"); + + b.Property("Tech") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("HairPrestation"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestationCollectionItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.Property("QueryId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("PrestationId"); + + b.HasIndex("QueryId"); + + b.ToTable("HairPrestationCollectionItem"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Brand") + .IsRequired() + .HasColumnType("text"); + + b.Property("ColorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ColorId"); + + b.ToTable("HairTaint"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaintInstance", b => + { + b.Property("TaintId") + .HasColumnType("bigint"); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.HasKey("TaintId", "PrestationId"); + + b.HasIndex("PrestationId"); + + b.ToTable("HairTaintInstance"); + }); + + modelBuilder.Entity("Yavsc.Models.IT.Evolution.Feature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Feature"); + }); + + modelBuilder.Entity("Yavsc.Models.IT.Fixing.Bug", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("FeatureId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FeatureId"); + + b.ToTable("Bug"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b => + { + b.Property("DeviceId") + .HasColumnType("text"); + + b.Property("DeclarationDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("LOCALTIMESTAMP"); + + b.Property("DeviceOwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("LatestActivityUpdate") + .HasColumnType("timestamp with time zone"); + + b.Property("Model") + .IsRequired() + .HasColumnType("text"); + + b.Property("Platform") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("DeviceId"); + + b.HasIndex("DeviceOwnerId"); + + b.ToTable("DeviceDeclaration"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Depth") + .HasColumnType("numeric"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Height") + .HasColumnType("numeric"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Price") + .HasColumnType("numeric"); + + b.Property("Public") + .HasColumnType("boolean"); + + b.Property("Weight") + .HasColumnType("numeric"); + + b.Property("Width") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.ToTable("Products"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContextId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Public") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("ContextId"); + + b.ToTable("Services"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("For") + .HasColumnType("smallint"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Sender") + .IsRequired() + .HasColumnType("text"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("Announce"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.DismissClicked", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "NotificationId"); + + b.HasIndex("NotificationId"); + + b.ToTable("DismissClicked"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Target") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("body") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("click_action") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("color") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("icon") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasDefaultValue("exclam"); + + b.Property("sound") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("tag") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("title") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.ToTable("Notification"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Instrument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.ToTable("Instrument"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.InstrumentRating", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("InstrumentId") + .HasColumnType("bigint"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasAlternateKey("InstrumentId", "OwnerId"); + + b.HasIndex("OwnerId"); + + b.ToTable("InstrumentRating"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => + { + b.Property("OwnerProfileId") + .HasColumnType("text"); + + b.Property("DjSettingsUserId") + .HasColumnType("text"); + + b.Property("GeneralSettingsUserId") + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("TendencyId") + .HasColumnType("bigint"); + + b.HasKey("OwnerProfileId"); + + b.HasIndex("DjSettingsUserId"); + + b.HasIndex("GeneralSettingsUserId"); + + b.ToTable("MusicalPreference"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalTendency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.ToTable("MusicalTendency"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.DjSettings", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("SoundCloudId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("DjSettings"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.GeneralSettings", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("GeneralSettings"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => + { + b.Property("InstrumentId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("InstrumentId", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("Instrumentation"); + }); + + modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => + { + b.Property("CreationToken") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ExecutorId") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrderReference") + .IsRequired() + .HasColumnType("text"); + + b.Property("PaypalPayerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("CreationToken"); + + b.HasIndex("ExecutorId"); + + b.ToTable("PayPalPayment"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Public") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Circle"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => + { + b.Property("MemberId") + .HasColumnType("text"); + + b.Property("CircleId") + .HasColumnType("bigint"); + + b.HasKey("MemberId", "CircleId"); + + b.HasIndex("CircleId"); + + b.ToTable("CircleMembers"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => + { + b.Property("OwnerId") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("EMail") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("OwnerId", "UserId"); + + b.HasIndex("AddressId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Contact"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b => + { + b.Property("HRef") + .HasColumnType("text"); + + b.Property("Method") + .HasColumnType("text"); + + b.Property("BrusherProfileUserId") + .HasColumnType("text"); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("text"); + + b.Property("PayPalPaymentCreationToken") + .HasColumnType("text"); + + b.Property("Rel") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("HRef", "Method"); + + b.HasIndex("BrusherProfileUserId"); + + b.HasIndex("PayPalPaymentCreationToken"); + + b.ToTable("HyperLink"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("Latitude") + .HasColumnType("double precision"); + + b.Property("Longitude") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.ToTable("Locations"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.PostalAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("City") + .IsRequired() + .HasColumnType("text"); + + b.Property("Country") + .IsRequired() + .HasColumnType("text"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("Province") + .IsRequired() + .HasColumnType("text"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.Property("Street1") + .IsRequired() + .HasColumnType("text"); + + b.Property("Street2") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PostalAddress"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Tags"); + }); + + modelBuilder.Entity("Yavsc.Models.Skill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SiteSkills"); + }); + + modelBuilder.Entity("Yavsc.Models.Streaming.LiveFlow", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DifferedFileName") + .IsRequired() + .HasColumnType("text"); + + b.Property("MediaType") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Pitch") + .IsRequired() + .HasColumnType("text"); + + b.Property("SequenceNumber") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("LiveFlow"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.Property("Code") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Hidden") + .HasColumnType("boolean"); + + b.Property("ModeratorGroupName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentCode") + .HasColumnType("text"); + + b.Property("Photo") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("SettingsClassName") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.HasIndex("ParentCode"); + + b.ToTable("Activities"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("FormationSettingsUserId") + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkingForId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FormationSettingsUserId"); + + b.HasIndex("PerformerId"); + + b.HasIndex("WorkingForId"); + + b.ToTable("CoWorking"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ActionName") + .IsRequired() + .HasColumnType("text"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.ToTable("CommandForm"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Property("PerformerId") + .HasColumnType("text"); + + b.Property("AcceptNotifications") + .HasColumnType("boolean"); + + b.Property("AcceptPublicContact") + .HasColumnType("boolean"); + + b.Property("Active") + .HasColumnType("boolean"); + + b.Property("MaxDailyCost") + .HasColumnType("integer"); + + b.Property("MinDailyCost") + .HasColumnType("integer"); + + b.Property("OrganizationAddressId") + .HasColumnType("bigint"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("SIREN") + .IsRequired() + .HasColumnType("text"); + + b.Property("UseGeoLocalizationToReduceDistanceWithClients") + .HasColumnType("boolean"); + + b.Property("WebSite") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("PerformerId"); + + b.HasIndex("OrganizationAddressId"); + + b.ToTable("Performers"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("FormationSettings"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("LocationType") + .HasColumnType("integer"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("RdvQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => + { + b.Property("DoesCode") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Weight") + .HasColumnType("integer"); + + b.HasKey("DoesCode", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UserActivities"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.Calendar.Period", b => + { + b.Property("Start") + .HasColumnType("timestamp with time zone"); + + b.Property("End") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Start", "End"); + + b.ToTable("Period"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.EMailing.MailingTemplate", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Body") + .IsRequired() + .HasMaxLength(65536) + .HasColumnType("character varying(65536)"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplyToAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("ToSend") + .HasColumnType("integer"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("MailingTemplate"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("GitId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("GitId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("Project"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProjectId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProjectId"); + + b.ToTable("ProjectBuildConfiguration"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Branch") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Path") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("GitRepositoryReference"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Yavsc.Models.Access.Ban", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "TargetUser") + .WithMany() + .HasForeignKey("TargetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TargetUser"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany("BlackList") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => + { + b.HasOne("Yavsc.Models.Blog.BlogPost", "Target") + .WithMany("ACL") + .HasForeignKey("BlogPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Circle", "Allowed") + .WithMany() + .HasForeignKey("CircleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Allowed"); + + b.Navigation("Target"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithOne("AccountBalance") + .HasForeignKey("Yavsc.Models.AccountBalance", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.HasOne("Yavsc.Models.Relationship.Location", "PostalAddress") + .WithMany() + .HasForeignKey("PostalAddressId"); + + b.Navigation("PostalAddress"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.HasOne("Yavsc.Models.AccountBalance", "Balance") + .WithMany() + .HasForeignKey("BalanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Balance"); + }); + + modelBuilder.Entity("Yavsc.Models.Bank.BankIdentity", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany("BankInfo") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.HasOne("Yavsc.Models.Billing.Estimate", null) + .WithMany("Bill") + .HasForeignKey("EstimateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Billing.EstimateTemplate", null) + .WithMany("Bill") + .HasForeignKey("EstimateTemplateId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.RdvQuery", "Query") + .WithMany() + .HasForeignKey("CommandId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Owner"); + + b.Navigation("Query"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Author") + .WithMany("Posts") + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogTag", b => + { + b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") + .WithMany("Tags") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Tag", "Tag") + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Post"); + + b.Navigation("Tag"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Author") + .WithMany() + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Blog.Comment", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + + b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") + .WithMany("Comments") + .HasForeignKey("ReceiverId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("Parent"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.ScheduledEvent", b => + { + b.HasOne("Yavsc.Models.Calendar.Schedule", null) + .WithMany("Events") + .HasForeignKey("ScheduleOwnerId"); + + b.HasOne("Yavsc.Server.Models.Calendar.Period", "Period") + .WithMany() + .HasForeignKey("PeriodStart", "PeriodEnd") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Period"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatConnection", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany("Connections") + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany("Rooms") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b => + { + b.HasOne("Yavsc.Models.Chat.ChatRoom", "Room") + .WithMany("Moderation") + .HasForeignKey("ChannelName") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany("RoomAccess") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Room"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.HasOne("Yavsc.Models.Calendar.Schedule", "Schedule") + .WithMany() + .HasForeignKey("ScheduleOwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "BaseProfile") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("BaseProfile"); + + b.Navigation("Schedule"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId"); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany() + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.BrusherProfile", "SelectedProfile") + .WithMany() + .HasForeignKey("SelectedProfileUserId"); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Prestation"); + + b.Navigation("Regularisation"); + + b.Navigation("SelectedProfile"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularisation"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestationCollectionItem", b => + { + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany() + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairMultiCutQuery", "Query") + .WithMany("Prestations") + .HasForeignKey("QueryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Prestation"); + + b.Navigation("Query"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.HasOne("Yavsc.Models.Drawing.Color", "Color") + .WithMany() + .HasForeignKey("ColorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Color"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaintInstance", b => + { + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany("Taints") + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairTaint", "Taint") + .WithMany() + .HasForeignKey("TaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Prestation"); + + b.Navigation("Taint"); + }); + + modelBuilder.Entity("Yavsc.Models.IT.Fixing.Bug", b => + { + b.HasOne("Yavsc.Models.IT.Evolution.Feature", "False") + .WithMany() + .HasForeignKey("FeatureId"); + + b.Navigation("False"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "DeviceOwner") + .WithMany("DeviceDeclaration") + .HasForeignKey("DeviceOwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DeviceOwner"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany("Services") + .HasForeignKey("ContextId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Context"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.DismissClicked", b => + { + b.HasOne("Yavsc.Models.Messaging.Notification", "Notified") + .WithMany() + .HasForeignKey("NotificationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Notified"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.InstrumentRating", b => + { + b.HasOne("Yavsc.Models.Musical.Instrument", "Instrument") + .WithMany() + .HasForeignKey("InstrumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Profile") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Instrument"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => + { + b.HasOne("Yavsc.Models.Musical.Profiles.DjSettings", null) + .WithMany("SoundColor") + .HasForeignKey("DjSettingsUserId"); + + b.HasOne("Yavsc.Models.Musical.Profiles.GeneralSettings", null) + .WithMany("SoundColor") + .HasForeignKey("GeneralSettingsUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => + { + b.HasOne("Yavsc.Models.Musical.Instrument", "Tool") + .WithMany() + .HasForeignKey("InstrumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tool"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Executor") + .WithMany() + .HasForeignKey("ExecutorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Executor"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany("Circles") + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => + { + b.HasOne("Yavsc.Models.Relationship.Circle", "Circle") + .WithMany("Members") + .HasForeignKey("CircleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Member") + .WithMany("Membership") + .HasForeignKey("MemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Circle"); + + b.Navigation("Member"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => + { + b.HasOne("Yavsc.Models.Relationship.PostalAddress", "PostalAddress") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany("Book") + .HasForeignKey("ApplicationUserId"); + + b.Navigation("PostalAddress"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b => + { + b.HasOne("Yavsc.Models.Haircut.BrusherProfile", null) + .WithMany("Links") + .HasForeignKey("BrusherProfileUserId"); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", null) + .WithMany("Links") + .HasForeignKey("PayPalPaymentCreationToken"); + }); + + modelBuilder.Entity("Yavsc.Models.Streaming.LiveFlow", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Parent") + .WithMany("Children") + .HasForeignKey("ParentCode"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => + { + b.HasOne("Yavsc.Models.Workflow.Profiles.FormationSettings", null) + .WithMany("CoWorking") + .HasForeignKey("FormationSettingsUserId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Performer") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "WorkingFor") + .WithMany() + .HasForeignKey("WorkingForId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Performer"); + + b.Navigation("WorkingFor"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany("Forms") + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Context"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.HasOne("Yavsc.Models.Relationship.Location", "OrganizationAddress") + .WithMany() + .HasForeignKey("OrganizationAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Performer") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrganizationAddress"); + + b.Navigation("Performer"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularisation"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Does") + .WithMany() + .HasForeignKey("DoesCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "User") + .WithMany("Activity") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Does"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", "Repository") + .WithMany() + .HasForeignKey("GitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularisation"); + + b.Navigation("Repository"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => + { + b.HasOne("Yavsc.Server.Models.IT.Project", "TargetProject") + .WithMany("Configurations") + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TargetProject"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Navigation("AccountBalance") + .IsRequired(); + + b.Navigation("BankInfo"); + + b.Navigation("BlackList"); + + b.Navigation("Book"); + + b.Navigation("Circles"); + + b.Navigation("Connections"); + + b.Navigation("DeviceDeclaration"); + + b.Navigation("Membership"); + + b.Navigation("Posts"); + + b.Navigation("RoomAccess"); + + b.Navigation("Rooms"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Navigation("Bill"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => + { + b.Navigation("Bill"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => + { + b.Navigation("ACL"); + + b.Navigation("Comments"); + + b.Navigation("Tags"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => + { + b.Navigation("Events"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => + { + b.Navigation("Moderation"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.Navigation("Links"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.Navigation("Prestations"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => + { + b.Navigation("Taints"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.DjSettings", b => + { + b.Navigation("SoundColor"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.GeneralSettings", b => + { + b.Navigation("SoundColor"); + }); + + modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => + { + b.Navigation("Links"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.Navigation("Members"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.Navigation("Children"); + + b.Navigation("Forms"); + + b.Navigation("Services"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Navigation("Activity"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => + { + b.Navigation("CoWorking"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.Navigation("Configurations"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Yavsc.Server/Migrations/20241214201053_commentParent.cs b/src/Yavsc.Server/Migrations/20241214201053_commentParent.cs new file mode 100644 index 00000000..6180b3ab --- /dev/null +++ b/src/Yavsc.Server/Migrations/20241214201053_commentParent.cs @@ -0,0 +1,61 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Yavsc.Migrations +{ + /// + public partial class commentParent : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Comment_Blogspot_PostId", + table: "Comment"); + + migrationBuilder.DropIndex( + name: "IX_Comment_PostId", + table: "Comment"); + + + migrationBuilder.CreateIndex( + name: "IX_Comment_ReceiverId", + table: "Comment", + column: "ReceiverId"); + + migrationBuilder.AddForeignKey( + name: "FK_Comment_Blogspot_ReceiverId", + table: "Comment", + column: "ReceiverId", + principalTable: "Blogspot", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Comment_Blogspot_ReceiverId", + table: "Comment"); + + migrationBuilder.DropIndex( + name: "IX_Comment_ReceiverId", + table: "Comment"); + + migrationBuilder.CreateIndex( + name: "IX_Comment_PostId", + table: "Comment", + column: "PostId"); + + migrationBuilder.AddForeignKey( + name: "FK_Comment_Blogspot_PostId", + table: "Comment", + column: "PostId", + principalTable: "Blogspot", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/src/Yavsc.Server/Migrations/20250208001037_blogspotcase.Designer.cs b/src/Yavsc.Server/Migrations/20250208001037_blogspotcase.Designer.cs new file mode 100644 index 00000000..b6921b78 --- /dev/null +++ b/src/Yavsc.Server/Migrations/20250208001037_blogspotcase.Designer.cs @@ -0,0 +1,3513 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using Yavsc.Models; + +#nullable disable + +namespace Yavsc.Migrations +{ + [DbContext(typeof(ApplicationDbContext))] + [Migration("20250208001037_blogspotcase")] + partial class blogspotcase + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.2") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasDatabaseName("RoleNameIndex"); + + b.ToTable("AspNetRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("integer"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ClaimType") + .HasColumnType("text"); + + b.Property("ClaimValue") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("ProviderKey") + .HasColumnType("text"); + + b.Property("ProviderDisplayName") + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("text"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles", (string)null); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("LoginProvider") + .HasColumnType("text"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens", (string)null); + }); + + modelBuilder.Entity("Yavsc.Abstract.Identity.ClientProviderInfo", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Avatar") + .IsRequired() + .HasColumnType("text"); + + b.Property("BillingAddressId") + .HasColumnType("bigint"); + + b.Property("EMail") + .IsRequired() + .HasColumnType("text"); + + b.Property("Phone") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("ClientProviderInfo"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.Property("TargetId") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("TargetId"); + + b.ToTable("Ban"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.HasIndex("UserId"); + + b.ToTable("BlackListed"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => + { + b.Property("CircleId") + .HasColumnType("bigint"); + + b.Property("BlogPostId") + .HasColumnType("bigint"); + + b.HasKey("CircleId", "BlogPostId"); + + b.HasIndex("BlogPostId"); + + b.ToTable("CircleAuthorizationToBlogPost"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("ContactCredits") + .HasColumnType("bigint"); + + b.Property("Credits") + .HasColumnType("numeric"); + + b.HasKey("UserId"); + + b.ToTable("BankStatus"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("AccessFailedCount") + .HasColumnType("integer"); + + b.Property("AllowMonthlyEmail") + .HasColumnType("boolean"); + + b.Property("Avatar") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasDefaultValue("/images/Users/icon_user.png"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("text"); + + b.Property("DedicatedGoogleCalendar") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("DiskQuota") + .ValueGeneratedOnAdd() + .HasColumnType("bigint") + .HasDefaultValue(524288000L); + + b.Property("DiskUsage") + .HasColumnType("bigint"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("EmailConfirmed") + .HasColumnType("boolean"); + + b.Property("FullName") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("LockoutEnabled") + .HasColumnType("boolean"); + + b.Property("LockoutEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("MaxFileSize") + .HasColumnType("bigint"); + + b.Property("NormalizedEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("NormalizedUserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PasswordHash") + .HasColumnType("text"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("boolean"); + + b.Property("PostalAddressId") + .HasColumnType("bigint"); + + b.Property("SecurityStamp") + .HasColumnType("text"); + + b.Property("TwoFactorEnabled") + .HasColumnType("boolean"); + + b.Property("UserName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.HasKey("Id"); + + b.HasAlternateKey("Email"); + + b.HasIndex("NormalizedEmail") + .HasDatabaseName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasDatabaseName("UserNameIndex"); + + b.HasIndex("PostalAddressId"); + + b.ToTable("AspNetUsers", (string)null); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Client", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("text"); + + b.Property("AccessTokenLifetime") + .HasColumnType("integer"); + + b.Property("Active") + .HasColumnType("boolean"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("LogoutRedirectUri") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RedirectUri") + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("RefreshTokenLifeTime") + .HasColumnType("integer"); + + b.Property("Secret") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("Type") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Applications"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.OAuth2Tokens", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("AccessToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("Expiration") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresIn") + .IsRequired() + .HasColumnType("text"); + + b.Property("RefreshToken") + .IsRequired() + .HasColumnType("text"); + + b.Property("TokenType") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("OAuth2Tokens"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ExpiresUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("IssuedUtc") + .HasColumnType("timestamp with time zone"); + + b.Property("ProtectedTicket") + .IsRequired() + .HasColumnType("text"); + + b.Property("Subject") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.ToTable("RefreshTokens"); + }); + + modelBuilder.Entity("Yavsc.Models.Auth.Scope", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.ToTable("Scopes"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("BalanceId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ExecDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Impact") + .HasColumnType("numeric"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("BalanceId"); + + b.ToTable("BankBook"); + }); + + modelBuilder.Entity("Yavsc.Models.Bank.BankIdentity", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AccountNumber") + .IsRequired() + .HasColumnType("text"); + + b.Property("BIC") + .IsRequired() + .HasColumnType("text"); + + b.Property("BankCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("BankedKey") + .HasColumnType("integer"); + + b.Property("IBAN") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WicketCode") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("BankIdentity"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Count") + .HasColumnType("integer"); + + b.Property("Currency") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("EstimateId") + .HasColumnType("bigint"); + + b.Property("EstimateTemplateId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("UnitaryCost") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.HasIndex("EstimateId"); + + b.HasIndex("EstimateTemplateId"); + + b.ToTable("CommandLine"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AttachedFilesString") + .IsRequired() + .HasColumnType("text"); + + b.Property("AttachedGraphicsString") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CommandId") + .HasColumnType("bigint"); + + b.Property("CommandType") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProviderValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ClientId"); + + b.HasIndex("CommandId"); + + b.HasIndex("OwnerId"); + + b.ToTable("Estimates"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("EstimateTemplates"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b => + { + b.Property("SIREN") + .HasColumnType("text"); + + b.HasKey("SIREN"); + + b.ToTable("ExceptionsSIREN"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuthorId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Content") + .IsRequired() + .HasMaxLength(56224) + .HasColumnType("character varying(56224)"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Photo") + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("Title") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("Visible") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.ToTable("BlogSpot"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogTag", b => + { + b.Property("PostId") + .HasColumnType("bigint"); + + b.Property("TagId") + .HasColumnType("bigint"); + + b.HasKey("PostId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("BlogTag"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("AuthorId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Content") + .IsRequired() + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ParentId") + .HasColumnType("bigint"); + + b.Property("ReceiverId") + .HasColumnType("bigint"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("Visible") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("AuthorId"); + + b.HasIndex("ParentId"); + + b.HasIndex("ReceiverId"); + + b.ToTable("Comment"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => + { + b.Property("OwnerId") + .HasColumnType("text"); + + b.HasKey("OwnerId"); + + b.ToTable("Schedule"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.ScheduledEvent", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("PeriodEnd") + .HasColumnType("timestamp with time zone"); + + b.Property("PeriodStart") + .HasColumnType("timestamp with time zone"); + + b.Property("Reccurence") + .HasColumnType("integer"); + + b.Property("ScheduleOwnerId") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ScheduleOwnerId"); + + b.HasIndex("PeriodStart", "PeriodEnd"); + + b.ToTable("ScheduledEvent"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatConnection", b => + { + b.Property("ConnectionId") + .HasColumnType("text"); + + b.Property("ApplicationUserId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Connected") + .HasColumnType("boolean"); + + b.Property("UserAgent") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("ConnectionId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("ChatConnection"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => + { + b.Property("Name") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("LatestJoinPart") + .HasColumnType("timestamp with time zone"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Name"); + + b.HasIndex("OwnerId"); + + b.ToTable("ChatRoom"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b => + { + b.Property("ChannelName") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Level") + .HasColumnType("integer"); + + b.HasKey("ChannelName", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("ChatRoomAccess"); + }); + + modelBuilder.Entity("Yavsc.Models.Cratie.Option", b => + { + b.Property("Code") + .HasColumnType("text"); + + b.Property("CodeScrutin") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code", "CodeScrutin"); + + b.ToTable("Option"); + }); + + modelBuilder.Entity("Yavsc.Models.Drawing.Color", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Blue") + .HasColumnType("smallint"); + + b.Property("Green") + .HasColumnType("smallint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Red") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.ToTable("Color"); + }); + + modelBuilder.Entity("Yavsc.Models.Forms.Form", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Summary") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Form"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("ActionDistance") + .HasColumnType("integer"); + + b.Property("CarePrice") + .HasColumnType("numeric"); + + b.Property("FlatFeeDiscount") + .HasColumnType("numeric"); + + b.Property("HalfBalayagePrice") + .HasColumnType("numeric"); + + b.Property("HalfBrushingPrice") + .HasColumnType("numeric"); + + b.Property("HalfColorPrice") + .HasColumnType("numeric"); + + b.Property("HalfDefrisPrice") + .HasColumnType("numeric"); + + b.Property("HalfFoldingPrice") + .HasColumnType("numeric"); + + b.Property("HalfMechPrice") + .HasColumnType("numeric"); + + b.Property("HalfMultiColorPrice") + .HasColumnType("numeric"); + + b.Property("HalfPermanentPrice") + .HasColumnType("numeric"); + + b.Property("KidCutPrice") + .HasColumnType("numeric"); + + b.Property("LongBalayagePrice") + .HasColumnType("numeric"); + + b.Property("LongBrushingPrice") + .HasColumnType("numeric"); + + b.Property("LongColorPrice") + .HasColumnType("numeric"); + + b.Property("LongDefrisPrice") + .HasColumnType("numeric"); + + b.Property("LongFoldingPrice") + .HasColumnType("numeric"); + + b.Property("LongMechPrice") + .HasColumnType("numeric"); + + b.Property("LongMultiColorPrice") + .HasColumnType("numeric"); + + b.Property("LongPermanentPrice") + .HasColumnType("numeric"); + + b.Property("ManBrushPrice") + .HasColumnType("numeric"); + + b.Property("ManCutPrice") + .HasColumnType("numeric"); + + b.Property("ScheduleOwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShampooPrice") + .HasColumnType("numeric"); + + b.Property("ShortBalayagePrice") + .HasColumnType("numeric"); + + b.Property("ShortBrushingPrice") + .HasColumnType("numeric"); + + b.Property("ShortColorPrice") + .HasColumnType("numeric"); + + b.Property("ShortDefrisPrice") + .HasColumnType("numeric"); + + b.Property("ShortFoldingPrice") + .HasColumnType("numeric"); + + b.Property("ShortMechPrice") + .HasColumnType("numeric"); + + b.Property("ShortMultiColorPrice") + .HasColumnType("numeric"); + + b.Property("ShortPermanentPrice") + .HasColumnType("numeric"); + + b.Property("WomenHalfCutPrice") + .HasColumnType("numeric"); + + b.Property("WomenLongCutPrice") + .HasColumnType("numeric"); + + b.Property("WomenShortCutPrice") + .HasColumnType("numeric"); + + b.HasKey("UserId"); + + b.HasIndex("ScheduleOwnerId"); + + b.ToTable("BrusherProfile"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("AdditionalInfo") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("SelectedProfileUserId") + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.HasIndex("PrestationId"); + + b.HasIndex("SelectedProfileUserId"); + + b.ToTable("HairCutQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("HairMultiCutQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Cares") + .HasColumnType("boolean"); + + b.Property("Cut") + .HasColumnType("boolean"); + + b.Property("Dressing") + .HasColumnType("integer"); + + b.Property("Gender") + .HasColumnType("integer"); + + b.Property("Length") + .HasColumnType("integer"); + + b.Property("Shampoo") + .HasColumnType("boolean"); + + b.Property("Tech") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("HairPrestation"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestationCollectionItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.Property("QueryId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("PrestationId"); + + b.HasIndex("QueryId"); + + b.ToTable("HairPrestationCollectionItem"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Brand") + .IsRequired() + .HasColumnType("text"); + + b.Property("ColorId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ColorId"); + + b.ToTable("HairTaint"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaintInstance", b => + { + b.Property("TaintId") + .HasColumnType("bigint"); + + b.Property("PrestationId") + .HasColumnType("bigint"); + + b.HasKey("TaintId", "PrestationId"); + + b.HasIndex("PrestationId"); + + b.ToTable("HairTaintInstance"); + }); + + modelBuilder.Entity("Yavsc.Models.IT.Evolution.Feature", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("ShortName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("Feature"); + }); + + modelBuilder.Entity("Yavsc.Models.IT.Fixing.Bug", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("FeatureId") + .HasColumnType("bigint"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FeatureId"); + + b.ToTable("Bug"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b => + { + b.Property("DeviceId") + .HasColumnType("text"); + + b.Property("DeclarationDate") + .ValueGeneratedOnAdd() + .HasColumnType("timestamp with time zone") + .HasDefaultValueSql("LOCALTIMESTAMP"); + + b.Property("DeviceOwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("LatestActivityUpdate") + .HasColumnType("timestamp with time zone"); + + b.Property("Model") + .IsRequired() + .HasColumnType("text"); + + b.Property("Platform") + .IsRequired() + .HasColumnType("text"); + + b.Property("Version") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("DeviceId"); + + b.HasIndex("DeviceOwnerId"); + + b.ToTable("DeviceDeclaration"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Product", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Depth") + .HasColumnType("numeric"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Height") + .HasColumnType("numeric"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Price") + .HasColumnType("numeric"); + + b.Property("Public") + .HasColumnType("boolean"); + + b.Property("Weight") + .HasColumnType("numeric"); + + b.Property("Width") + .HasColumnType("numeric"); + + b.HasKey("Id"); + + b.ToTable("Products"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ContextId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Public") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("ContextId"); + + b.ToTable("Services"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("For") + .HasColumnType("smallint"); + + b.Property("Message") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Sender") + .IsRequired() + .HasColumnType("text"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("Announce"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.DismissClicked", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("NotificationId") + .HasColumnType("bigint"); + + b.HasKey("UserId", "NotificationId"); + + b.HasIndex("NotificationId"); + + b.ToTable("DismissClicked"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Notification", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Target") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("body") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("click_action") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("color") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("icon") + .IsRequired() + .ValueGeneratedOnAdd() + .HasMaxLength(512) + .HasColumnType("character varying(512)") + .HasDefaultValue("exclam"); + + b.Property("sound") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("tag") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("title") + .IsRequired() + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); + + b.HasKey("Id"); + + b.ToTable("Notification"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Instrument", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.ToTable("Instrument"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.InstrumentRating", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("InstrumentId") + .HasColumnType("bigint"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasAlternateKey("InstrumentId", "OwnerId"); + + b.HasIndex("OwnerId"); + + b.ToTable("InstrumentRating"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => + { + b.Property("OwnerProfileId") + .HasColumnType("text"); + + b.Property("DjSettingsUserId") + .HasColumnType("text"); + + b.Property("GeneralSettingsUserId") + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("TendencyId") + .HasColumnType("bigint"); + + b.HasKey("OwnerProfileId"); + + b.HasIndex("DjSettingsUserId"); + + b.HasIndex("GeneralSettingsUserId"); + + b.ToTable("MusicalPreference"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalTendency", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.HasKey("Id"); + + b.ToTable("MusicalTendency"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.DjSettings", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("SoundCloudId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("DjSettings"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.GeneralSettings", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("GeneralSettings"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => + { + b.Property("InstrumentId") + .HasColumnType("bigint"); + + b.Property("UserId") + .HasColumnType("text"); + + b.HasKey("InstrumentId", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("Instrumentation"); + }); + + modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => + { + b.Property("CreationToken") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ExecutorId") + .IsRequired() + .HasColumnType("text"); + + b.Property("OrderReference") + .IsRequired() + .HasColumnType("text"); + + b.Property("PaypalPayerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("CreationToken"); + + b.HasIndex("ExecutorId"); + + b.ToTable("PayPalPayment"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Public") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Circle"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => + { + b.Property("MemberId") + .HasColumnType("text"); + + b.Property("CircleId") + .HasColumnType("bigint"); + + b.HasKey("MemberId", "CircleId"); + + b.HasIndex("CircleId"); + + b.ToTable("CircleMembers"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => + { + b.Property("OwnerId") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("AddressId") + .HasColumnType("bigint"); + + b.Property("ApplicationUserId") + .HasColumnType("text"); + + b.Property("EMail") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("OwnerId", "UserId"); + + b.HasIndex("AddressId"); + + b.HasIndex("ApplicationUserId"); + + b.ToTable("Contact"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b => + { + b.Property("HRef") + .HasColumnType("text"); + + b.Property("Method") + .HasColumnType("text"); + + b.Property("BrusherProfileUserId") + .HasColumnType("text"); + + b.Property("ContentType") + .IsRequired() + .HasColumnType("text"); + + b.Property("PayPalPaymentCreationToken") + .HasColumnType("text"); + + b.Property("Rel") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("HRef", "Method"); + + b.HasIndex("BrusherProfileUserId"); + + b.HasIndex("PayPalPaymentCreationToken"); + + b.ToTable("HyperLink"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Location", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Address") + .IsRequired() + .HasMaxLength(512) + .HasColumnType("character varying(512)"); + + b.Property("Latitude") + .HasColumnType("double precision"); + + b.Property("Longitude") + .HasColumnType("double precision"); + + b.HasKey("Id"); + + b.ToTable("Locations"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.PostalAddress", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("City") + .IsRequired() + .HasColumnType("text"); + + b.Property("Country") + .IsRequired() + .HasColumnType("text"); + + b.Property("PostalCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("Province") + .IsRequired() + .HasColumnType("text"); + + b.Property("State") + .IsRequired() + .HasColumnType("text"); + + b.Property("Street1") + .IsRequired() + .HasColumnType("text"); + + b.Property("Street2") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("PostalAddress"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("Tags"); + }); + + modelBuilder.Entity("Yavsc.Models.Skill", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.ToTable("SiteSkills"); + }); + + modelBuilder.Entity("Yavsc.Models.Streaming.LiveFlow", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("DifferedFileName") + .IsRequired() + .HasColumnType("text"); + + b.Property("MediaType") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Pitch") + .IsRequired() + .HasColumnType("text"); + + b.Property("SequenceNumber") + .HasColumnType("integer"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("LiveFlow"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.Property("Code") + .HasColumnType("text"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("Hidden") + .HasColumnType("boolean"); + + b.Property("ModeratorGroupName") + .IsRequired() + .HasColumnType("text"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ParentCode") + .HasColumnType("text"); + + b.Property("Photo") + .IsRequired() + .HasColumnType("text"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("SettingsClassName") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Code"); + + b.HasIndex("ParentCode"); + + b.ToTable("Activities"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("FormationSettingsUserId") + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("WorkingForId") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("FormationSettingsUserId"); + + b.HasIndex("PerformerId"); + + b.HasIndex("WorkingForId"); + + b.ToTable("CoWorking"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("ActionName") + .IsRequired() + .HasColumnType("text"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("Title") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.ToTable("CommandForm"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Property("PerformerId") + .HasColumnType("text"); + + b.Property("AcceptNotifications") + .HasColumnType("boolean"); + + b.Property("AcceptPublicContact") + .HasColumnType("boolean"); + + b.Property("Active") + .HasColumnType("boolean"); + + b.Property("MaxDailyCost") + .HasColumnType("integer"); + + b.Property("MinDailyCost") + .HasColumnType("integer"); + + b.Property("OrganizationAddressId") + .HasColumnType("bigint"); + + b.Property("Rate") + .HasColumnType("integer"); + + b.Property("SIREN") + .IsRequired() + .HasColumnType("text"); + + b.Property("UseGeoLocalizationToReduceDistanceWithClients") + .HasColumnType("boolean"); + + b.Property("WebSite") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("PerformerId"); + + b.HasIndex("OrganizationAddressId"); + + b.ToTable("Performers"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => + { + b.Property("UserId") + .HasColumnType("text"); + + b.Property("DisplayName") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("UserId"); + + b.ToTable("FormationSettings"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("EventDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LocationId") + .HasColumnType("bigint"); + + b.Property("LocationType") + .HasColumnType("integer"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("Reason") + .IsRequired() + .HasColumnType("text"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("LocationId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("RdvQueries"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => + { + b.Property("DoesCode") + .HasColumnType("text"); + + b.Property("UserId") + .HasColumnType("text"); + + b.Property("Weight") + .HasColumnType("integer"); + + b.HasKey("DoesCode", "UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UserActivities"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.Calendar.Period", b => + { + b.Property("Start") + .HasColumnType("timestamp with time zone"); + + b.Property("End") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Start", "End"); + + b.ToTable("Period"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.EMailing.MailingTemplate", b => + { + b.Property("Id") + .HasColumnType("text"); + + b.Property("Body") + .IsRequired() + .HasMaxLength(65536) + .HasColumnType("character varying(65536)"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplyToAddress") + .IsRequired() + .HasColumnType("text"); + + b.Property("ToSend") + .HasColumnType("integer"); + + b.Property("Topic") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.ToTable("MailingTemplate"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Accepted") + .HasColumnType("boolean"); + + b.Property("ActivityCode") + .IsRequired() + .HasColumnType("text"); + + b.Property("ClientId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Consent") + .HasColumnType("boolean"); + + b.Property("DateCreated") + .HasColumnType("timestamp with time zone"); + + b.Property("DateModified") + .HasColumnType("timestamp with time zone"); + + b.Property("Decided") + .HasColumnType("boolean"); + + b.Property("Description") + .IsRequired() + .HasColumnType("text"); + + b.Property("GitId") + .HasColumnType("bigint"); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PaymentId") + .IsRequired() + .HasColumnType("text"); + + b.Property("PerformerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Previsional") + .HasColumnType("numeric"); + + b.Property("Status") + .HasColumnType("integer"); + + b.Property("UserCreated") + .IsRequired() + .HasColumnType("text"); + + b.Property("UserModified") + .IsRequired() + .HasColumnType("text"); + + b.Property("ValidationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Version") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("ActivityCode"); + + b.HasIndex("ClientId"); + + b.HasIndex("GitId"); + + b.HasIndex("PaymentId"); + + b.HasIndex("PerformerId"); + + b.ToTable("Project"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Name") + .IsRequired() + .HasColumnType("text"); + + b.Property("ProjectId") + .HasColumnType("bigint"); + + b.HasKey("Id"); + + b.HasIndex("ProjectId"); + + b.ToTable("ProjectBuildConfiguration"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("Branch") + .IsRequired() + .HasColumnType("text"); + + b.Property("OwnerId") + .IsRequired() + .HasColumnType("text"); + + b.Property("Path") + .IsRequired() + .HasColumnType("text"); + + b.Property("Url") + .IsRequired() + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OwnerId"); + + b.ToTable("GitRepositoryReference"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Yavsc.Models.Access.Ban", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "TargetUser") + .WithMany() + .HasForeignKey("TargetId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TargetUser"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany("BlackList") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Access.CircleAuthorizationToBlogPost", b => + { + b.HasOne("Yavsc.Models.Blog.BlogPost", "Target") + .WithMany("ACL") + .HasForeignKey("BlogPostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Circle", "Allowed") + .WithMany() + .HasForeignKey("CircleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Allowed"); + + b.Navigation("Target"); + }); + + modelBuilder.Entity("Yavsc.Models.AccountBalance", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithOne("AccountBalance") + .HasForeignKey("Yavsc.Models.AccountBalance", "UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.HasOne("Yavsc.Models.Relationship.Location", "PostalAddress") + .WithMany() + .HasForeignKey("PostalAddressId"); + + b.Navigation("PostalAddress"); + }); + + modelBuilder.Entity("Yavsc.Models.BalanceImpact", b => + { + b.HasOne("Yavsc.Models.AccountBalance", "Balance") + .WithMany() + .HasForeignKey("BalanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Balance"); + }); + + modelBuilder.Entity("Yavsc.Models.Bank.BankIdentity", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany("BankInfo") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b => + { + b.HasOne("Yavsc.Models.Billing.Estimate", null) + .WithMany("Bill") + .HasForeignKey("EstimateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Billing.EstimateTemplate", null) + .WithMany("Bill") + .HasForeignKey("EstimateTemplateId"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.RdvQuery", "Query") + .WithMany() + .HasForeignKey("CommandId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Owner"); + + b.Navigation("Query"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Author") + .WithMany("Posts") + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogTag", b => + { + b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") + .WithMany("Tags") + .HasForeignKey("PostId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Tag", "Tag") + .WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Post"); + + b.Navigation("Tag"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Author") + .WithMany() + .HasForeignKey("AuthorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Blog.Comment", "Parent") + .WithMany("Children") + .HasForeignKey("ParentId"); + + b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") + .WithMany("Comments") + .HasForeignKey("ReceiverId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Author"); + + b.Navigation("Parent"); + + b.Navigation("Post"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.ScheduledEvent", b => + { + b.HasOne("Yavsc.Models.Calendar.Schedule", null) + .WithMany("Events") + .HasForeignKey("ScheduleOwnerId"); + + b.HasOne("Yavsc.Server.Models.Calendar.Period", "Period") + .WithMany() + .HasForeignKey("PeriodStart", "PeriodEnd") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Period"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatConnection", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany("Connections") + .HasForeignKey("ApplicationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany("Rooms") + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b => + { + b.HasOne("Yavsc.Models.Chat.ChatRoom", "Room") + .WithMany("Moderation") + .HasForeignKey("ChannelName") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany("RoomAccess") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Room"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.HasOne("Yavsc.Models.Calendar.Schedule", "Schedule") + .WithMany() + .HasForeignKey("ScheduleOwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "BaseProfile") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("BaseProfile"); + + b.Navigation("Schedule"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairCutQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId"); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany() + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.BrusherProfile", "SelectedProfile") + .WithMany() + .HasForeignKey("SelectedProfileUserId"); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Prestation"); + + b.Navigation("Regularisation"); + + b.Navigation("SelectedProfile"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularisation"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestationCollectionItem", b => + { + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany() + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairMultiCutQuery", "Query") + .WithMany("Prestations") + .HasForeignKey("QueryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Prestation"); + + b.Navigation("Query"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaint", b => + { + b.HasOne("Yavsc.Models.Drawing.Color", "Color") + .WithMany() + .HasForeignKey("ColorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Color"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairTaintInstance", b => + { + b.HasOne("Yavsc.Models.Haircut.HairPrestation", "Prestation") + .WithMany("Taints") + .HasForeignKey("PrestationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Haircut.HairTaint", "Taint") + .WithMany() + .HasForeignKey("TaintId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Prestation"); + + b.Navigation("Taint"); + }); + + modelBuilder.Entity("Yavsc.Models.IT.Fixing.Bug", b => + { + b.HasOne("Yavsc.Models.IT.Evolution.Feature", "False") + .WithMany() + .HasForeignKey("FeatureId"); + + b.Navigation("False"); + }); + + modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "DeviceOwner") + .WithMany("DeviceDeclaration") + .HasForeignKey("DeviceOwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("DeviceOwner"); + }); + + modelBuilder.Entity("Yavsc.Models.Market.Service", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany("Services") + .HasForeignKey("ContextId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Context"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.Announce", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Messaging.DismissClicked", b => + { + b.HasOne("Yavsc.Models.Messaging.Notification", "Notified") + .WithMany() + .HasForeignKey("NotificationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Notified"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.InstrumentRating", b => + { + b.HasOne("Yavsc.Models.Musical.Instrument", "Instrument") + .WithMany() + .HasForeignKey("InstrumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Profile") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Instrument"); + + b.Navigation("Profile"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.MusicalPreference", b => + { + b.HasOne("Yavsc.Models.Musical.Profiles.DjSettings", null) + .WithMany("SoundColor") + .HasForeignKey("DjSettingsUserId"); + + b.HasOne("Yavsc.Models.Musical.Profiles.GeneralSettings", null) + .WithMany("SoundColor") + .HasForeignKey("GeneralSettingsUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.Instrumentation", b => + { + b.HasOne("Yavsc.Models.Musical.Instrument", "Tool") + .WithMany() + .HasForeignKey("InstrumentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Tool"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Executor") + .WithMany() + .HasForeignKey("ExecutorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Executor"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany("Circles") + .HasForeignKey("ApplicationUserId"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.CircleMember", b => + { + b.HasOne("Yavsc.Models.Relationship.Circle", "Circle") + .WithMany("Members") + .HasForeignKey("CircleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Member") + .WithMany("Membership") + .HasForeignKey("MemberId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Circle"); + + b.Navigation("Member"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b => + { + b.HasOne("Yavsc.Models.Relationship.PostalAddress", "PostalAddress") + .WithMany() + .HasForeignKey("AddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", null) + .WithMany("Book") + .HasForeignKey("ApplicationUserId"); + + b.Navigation("PostalAddress"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.HyperLink", b => + { + b.HasOne("Yavsc.Models.Haircut.BrusherProfile", null) + .WithMany("Links") + .HasForeignKey("BrusherProfileUserId"); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", null) + .WithMany("Links") + .HasForeignKey("PayPalPaymentCreationToken"); + }); + + modelBuilder.Entity("Yavsc.Models.Streaming.LiveFlow", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Parent") + .WithMany("Children") + .HasForeignKey("ParentCode"); + + b.Navigation("Parent"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CoWorking", b => + { + b.HasOne("Yavsc.Models.Workflow.Profiles.FormationSettings", null) + .WithMany("CoWorking") + .HasForeignKey("FormationSettingsUserId"); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "Performer") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "WorkingFor") + .WithMany() + .HasForeignKey("WorkingForId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Performer"); + + b.Navigation("WorkingFor"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.CommandForm", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany("Forms") + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Context"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.HasOne("Yavsc.Models.Relationship.Location", "OrganizationAddress") + .WithMany() + .HasForeignKey("OrganizationAddressId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Performer") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("OrganizationAddress"); + + b.Navigation("Performer"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.RdvQuery", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Relationship.Location", "Location") + .WithMany() + .HasForeignKey("LocationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("Location"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularisation"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Does") + .WithMany() + .HasForeignKey("DoesCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "User") + .WithMany("Activity") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Does"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.HasOne("Yavsc.Models.Workflow.Activity", "Context") + .WithMany() + .HasForeignKey("ActivityCode") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.ApplicationUser", "Client") + .WithMany() + .HasForeignKey("ClientId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", "Repository") + .WithMany() + .HasForeignKey("GitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Payment.PayPalPayment", "Regularisation") + .WithMany() + .HasForeignKey("PaymentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Yavsc.Models.Workflow.PerformerProfile", "PerformerProfile") + .WithMany() + .HasForeignKey("PerformerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Client"); + + b.Navigation("Context"); + + b.Navigation("PerformerProfile"); + + b.Navigation("Regularisation"); + + b.Navigation("Repository"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.ProjectBuildConfiguration", b => + { + b.HasOne("Yavsc.Server.Models.IT.Project", "TargetProject") + .WithMany("Configurations") + .HasForeignKey("ProjectId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("TargetProject"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b => + { + b.HasOne("Yavsc.Models.ApplicationUser", "Owner") + .WithMany() + .HasForeignKey("OwnerId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Owner"); + }); + + modelBuilder.Entity("Yavsc.Models.ApplicationUser", b => + { + b.Navigation("AccountBalance") + .IsRequired(); + + b.Navigation("BankInfo"); + + b.Navigation("BlackList"); + + b.Navigation("Book"); + + b.Navigation("Circles"); + + b.Navigation("Connections"); + + b.Navigation("DeviceDeclaration"); + + b.Navigation("Membership"); + + b.Navigation("Posts"); + + b.Navigation("RoomAccess"); + + b.Navigation("Rooms"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b => + { + b.Navigation("Bill"); + }); + + modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b => + { + b.Navigation("Bill"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.BlogPost", b => + { + b.Navigation("ACL"); + + b.Navigation("Comments"); + + b.Navigation("Tags"); + }); + + modelBuilder.Entity("Yavsc.Models.Blog.Comment", b => + { + b.Navigation("Children"); + }); + + modelBuilder.Entity("Yavsc.Models.Calendar.Schedule", b => + { + b.Navigation("Events"); + }); + + modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b => + { + b.Navigation("Moderation"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b => + { + b.Navigation("Links"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairMultiCutQuery", b => + { + b.Navigation("Prestations"); + }); + + modelBuilder.Entity("Yavsc.Models.Haircut.HairPrestation", b => + { + b.Navigation("Taints"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.DjSettings", b => + { + b.Navigation("SoundColor"); + }); + + modelBuilder.Entity("Yavsc.Models.Musical.Profiles.GeneralSettings", b => + { + b.Navigation("SoundColor"); + }); + + modelBuilder.Entity("Yavsc.Models.Payment.PayPalPayment", b => + { + b.Navigation("Links"); + }); + + modelBuilder.Entity("Yavsc.Models.Relationship.Circle", b => + { + b.Navigation("Members"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b => + { + b.Navigation("Children"); + + b.Navigation("Forms"); + + b.Navigation("Services"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b => + { + b.Navigation("Activity"); + }); + + modelBuilder.Entity("Yavsc.Models.Workflow.Profiles.FormationSettings", b => + { + b.Navigation("CoWorking"); + }); + + modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => + { + b.Navigation("Configurations"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Yavsc.Server/Migrations/20250208001037_blogspotcase.cs b/src/Yavsc.Server/Migrations/20250208001037_blogspotcase.cs new file mode 100644 index 00000000..13d393e5 --- /dev/null +++ b/src/Yavsc.Server/Migrations/20250208001037_blogspotcase.cs @@ -0,0 +1,161 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Yavsc.Migrations +{ + /// + public partial class blogspotcase : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Blogspot_AspNetUsers_AuthorId", + table: "Blogspot"); + + migrationBuilder.DropForeignKey( + name: "FK_BlogTag_Blogspot_PostId", + table: "BlogTag"); + + migrationBuilder.DropForeignKey( + name: "FK_CircleAuthorizationToBlogPost_Blogspot_BlogPostId", + table: "CircleAuthorizationToBlogPost"); + + migrationBuilder.DropForeignKey( + name: "FK_Comment_Blogspot_ReceiverId", + table: "Comment"); + + migrationBuilder.DropPrimaryKey( + name: "PK_Blogspot", + table: "Blogspot"); + + migrationBuilder.DropColumn( + name: "Rate", + table: "Blogspot"); + + migrationBuilder.RenameTable( + name: "Blogspot", + newName: "BlogSpot"); + + migrationBuilder.RenameIndex( + name: "IX_Blogspot_AuthorId", + table: "BlogSpot", + newName: "IX_BlogSpot_AuthorId"); + + migrationBuilder.AddPrimaryKey( + name: "PK_BlogSpot", + table: "BlogSpot", + column: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_BlogSpot_AspNetUsers_AuthorId", + table: "BlogSpot", + column: "AuthorId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_BlogTag_BlogSpot_PostId", + table: "BlogTag", + column: "PostId", + principalTable: "BlogSpot", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_CircleAuthorizationToBlogPost_BlogSpot_BlogPostId", + table: "CircleAuthorizationToBlogPost", + column: "BlogPostId", + principalTable: "BlogSpot", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_Comment_BlogSpot_ReceiverId", + table: "Comment", + column: "ReceiverId", + principalTable: "BlogSpot", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_BlogSpot_AspNetUsers_AuthorId", + table: "BlogSpot"); + + migrationBuilder.DropForeignKey( + name: "FK_BlogTag_BlogSpot_PostId", + table: "BlogTag"); + + migrationBuilder.DropForeignKey( + name: "FK_CircleAuthorizationToBlogPost_BlogSpot_BlogPostId", + table: "CircleAuthorizationToBlogPost"); + + migrationBuilder.DropForeignKey( + name: "FK_Comment_BlogSpot_ReceiverId", + table: "Comment"); + + migrationBuilder.DropPrimaryKey( + name: "PK_BlogSpot", + table: "BlogSpot"); + + migrationBuilder.RenameTable( + name: "BlogSpot", + newName: "Blogspot"); + + migrationBuilder.RenameIndex( + name: "IX_BlogSpot_AuthorId", + table: "Blogspot", + newName: "IX_Blogspot_AuthorId"); + + migrationBuilder.AddColumn( + name: "Rate", + table: "Blogspot", + type: "integer", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddPrimaryKey( + name: "PK_Blogspot", + table: "Blogspot", + column: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_Blogspot_AspNetUsers_AuthorId", + table: "Blogspot", + column: "AuthorId", + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_BlogTag_Blogspot_PostId", + table: "BlogTag", + column: "PostId", + principalTable: "Blogspot", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_CircleAuthorizationToBlogPost_Blogspot_BlogPostId", + table: "CircleAuthorizationToBlogPost", + column: "BlogPostId", + principalTable: "Blogspot", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_Comment_Blogspot_ReceiverId", + table: "Comment", + column: "ReceiverId", + principalTable: "Blogspot", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + } +} diff --git a/src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/src/Yavsc.Server/Migrations/ApplicationDbContextModelSnapshot.cs similarity index 98% rename from src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs rename to src/Yavsc.Server/Migrations/ApplicationDbContextModelSnapshot.cs index 276d9621..85f8cf30 100644 --- a/src/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/src/Yavsc.Server/Migrations/ApplicationDbContextModelSnapshot.cs @@ -712,7 +712,8 @@ namespace Yavsc.Migrations b.Property("Content") .IsRequired() - .HasColumnType("text"); + .HasMaxLength(56224) + .HasColumnType("character varying(56224)"); b.Property("DateCreated") .HasColumnType("timestamp with time zone"); @@ -720,20 +721,14 @@ namespace Yavsc.Migrations b.Property("DateModified") .HasColumnType("timestamp with time zone"); - b.Property("Lang") - .IsRequired() - .HasColumnType("text"); - b.Property("Photo") - .IsRequired() - .HasColumnType("text"); - - b.Property("Rate") - .HasColumnType("integer"); + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); b.Property("Title") .IsRequired() - .HasColumnType("text"); + .HasMaxLength(1024) + .HasColumnType("character varying(1024)"); b.Property("UserCreated") .IsRequired() @@ -750,7 +745,7 @@ namespace Yavsc.Migrations b.HasIndex("AuthorId"); - b.ToTable("Blogspot"); + b.ToTable("BlogSpot"); }); modelBuilder.Entity("Yavsc.Models.Blog.BlogTag", b => @@ -793,7 +788,7 @@ namespace Yavsc.Migrations b.Property("ParentId") .HasColumnType("bigint"); - b.Property("PostId") + b.Property("ReceiverId") .HasColumnType("bigint"); b.Property("UserCreated") @@ -813,7 +808,7 @@ namespace Yavsc.Migrations b.HasIndex("ParentId"); - b.HasIndex("PostId"); + b.HasIndex("ReceiverId"); b.ToTable("Comment"); }); @@ -2354,33 +2349,6 @@ namespace Yavsc.Migrations b.ToTable("UserActivities"); }); - modelBuilder.Entity("Yavsc.Server.Models.Blog.BlogTrad", b => - { - b.Property("PostId") - .HasColumnType("bigint"); - - b.Property("Lang") - .HasColumnType("text"); - - b.Property("Body") - .IsRequired() - .HasColumnType("text"); - - b.Property("Title") - .IsRequired() - .HasColumnType("text"); - - b.Property("TraducerId") - .IsRequired() - .HasColumnType("text"); - - b.HasKey("PostId", "Lang"); - - b.HasIndex("TraducerId"); - - b.ToTable("BlogTrad"); - }); - modelBuilder.Entity("Yavsc.Server.Models.Calendar.Period", b => { b.Property("Start") @@ -2801,7 +2769,7 @@ namespace Yavsc.Migrations b.HasOne("Yavsc.Models.Blog.BlogPost", "Post") .WithMany("Comments") - .HasForeignKey("PostId") + .HasForeignKey("ReceiverId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); @@ -3353,17 +3321,6 @@ namespace Yavsc.Migrations b.Navigation("User"); }); - modelBuilder.Entity("Yavsc.Server.Models.Blog.BlogTrad", b => - { - b.HasOne("Yavsc.Models.ApplicationUser", "Traducer") - .WithMany() - .HasForeignKey("TraducerId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Traducer"); - }); - modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b => { b.HasOne("Yavsc.Models.Workflow.Activity", "Context") diff --git a/src/Yavsc/Models/Access/AccountOptions.cs b/src/Yavsc.Server/Models/Access/AccountOptions.cs similarity index 100% rename from src/Yavsc/Models/Access/AccountOptions.cs rename to src/Yavsc.Server/Models/Access/AccountOptions.cs diff --git a/src/Yavsc.Server/Models/Access/Ban.cs b/src/Yavsc.Server/Models/Access/Ban.cs index 61fda305..5b2d02a3 100644 --- a/src/Yavsc.Server/Models/Access/Ban.cs +++ b/src/Yavsc.Server/Models/Access/Ban.cs @@ -5,7 +5,7 @@ using System.ComponentModel.DataAnnotations.Schema; namespace Yavsc.Models.Access { using Yavsc; - public class Ban : IBaseTrackedEntity + public class Ban : ITrackedEntity { public DateTime DateCreated { diff --git a/src/Yavsc/Models/Access/ConsentInputModel.cs b/src/Yavsc.Server/Models/Access/ConsentInputModel.cs similarity index 100% rename from src/Yavsc/Models/Access/ConsentInputModel.cs rename to src/Yavsc.Server/Models/Access/ConsentInputModel.cs diff --git a/src/Yavsc/Models/Access/ConsentViewModel.cs b/src/Yavsc.Server/Models/Access/ConsentViewModel.cs similarity index 100% rename from src/Yavsc/Models/Access/ConsentViewModel.cs rename to src/Yavsc.Server/Models/Access/ConsentViewModel.cs diff --git a/src/Yavsc/Models/Access/DeviceAuthorizationInputModel.cs b/src/Yavsc.Server/Models/Access/DeviceAuthorizationInputModel.cs similarity index 100% rename from src/Yavsc/Models/Access/DeviceAuthorizationInputModel.cs rename to src/Yavsc.Server/Models/Access/DeviceAuthorizationInputModel.cs diff --git a/src/Yavsc/Models/Access/DeviceAuthorizationViewModel.cs b/src/Yavsc.Server/Models/Access/DeviceAuthorizationViewModel.cs similarity index 100% rename from src/Yavsc/Models/Access/DeviceAuthorizationViewModel.cs rename to src/Yavsc.Server/Models/Access/DeviceAuthorizationViewModel.cs diff --git a/src/Yavsc/Models/Access/GrantViewModel.cs b/src/Yavsc.Server/Models/Access/GrantViewModel.cs similarity index 100% rename from src/Yavsc/Models/Access/GrantViewModel.cs rename to src/Yavsc.Server/Models/Access/GrantViewModel.cs diff --git a/src/Yavsc/Models/Access/GrantsViewModel.cs b/src/Yavsc.Server/Models/Access/GrantsViewModel.cs similarity index 100% rename from src/Yavsc/Models/Access/GrantsViewModel.cs rename to src/Yavsc.Server/Models/Access/GrantsViewModel.cs diff --git a/src/Yavsc/Models/Access/LoggedOutViewModel.cs b/src/Yavsc.Server/Models/Access/LoggedOutViewModel.cs similarity index 100% rename from src/Yavsc/Models/Access/LoggedOutViewModel.cs rename to src/Yavsc.Server/Models/Access/LoggedOutViewModel.cs diff --git a/src/Yavsc/Models/Access/LogoutInputModel.cs b/src/Yavsc.Server/Models/Access/LogoutInputModel.cs similarity index 100% rename from src/Yavsc/Models/Access/LogoutInputModel.cs rename to src/Yavsc.Server/Models/Access/LogoutInputModel.cs diff --git a/src/Yavsc/Models/Access/ProcessConsentResult.cs b/src/Yavsc.Server/Models/Access/ProcessConsentResult.cs similarity index 95% rename from src/Yavsc/Models/Access/ProcessConsentResult.cs rename to src/Yavsc.Server/Models/Access/ProcessConsentResult.cs index b86eb9f8..6800211c 100644 --- a/src/Yavsc/Models/Access/ProcessConsentResult.cs +++ b/src/Yavsc.Server/Models/Access/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using IdentityServer8.Models; namespace Yavsc.Models.Access { diff --git a/src/Yavsc/Models/Access/RedirectViewModel.cs b/src/Yavsc.Server/Models/Access/RedirectViewModel.cs similarity index 100% rename from src/Yavsc/Models/Access/RedirectViewModel.cs rename to src/Yavsc.Server/Models/Access/RedirectViewModel.cs diff --git a/src/Yavsc/Models/Access/Rule.cs b/src/Yavsc.Server/Models/Access/Rule.cs similarity index 100% rename from src/Yavsc/Models/Access/Rule.cs rename to src/Yavsc.Server/Models/Access/Rule.cs diff --git a/src/Yavsc/Models/Access/RuleSet.cs b/src/Yavsc.Server/Models/Access/RuleSet.cs similarity index 100% rename from src/Yavsc/Models/Access/RuleSet.cs rename to src/Yavsc.Server/Models/Access/RuleSet.cs diff --git a/src/Yavsc/Models/Access/ScopeViewModel.cs b/src/Yavsc.Server/Models/Access/ScopeViewModel.cs similarity index 100% rename from src/Yavsc/Models/Access/ScopeViewModel.cs rename to src/Yavsc.Server/Models/Access/ScopeViewModel.cs diff --git a/src/Yavsc/Models/ApplicationDbContext.cs b/src/Yavsc.Server/Models/ApplicationDbContext.cs similarity index 93% rename from src/Yavsc/Models/ApplicationDbContext.cs rename to src/Yavsc.Server/Models/ApplicationDbContext.cs index 3d8a3009..a4199896 100644 --- a/src/Yavsc/Models/ApplicationDbContext.cs +++ b/src/Yavsc.Server/Models/ApplicationDbContext.cs @@ -39,6 +39,8 @@ namespace Yavsc.Models using Microsoft.AspNetCore.Identity.EntityFrameworkCore; using Yavsc.Server.Models.Calendar; + using Microsoft.EntityFrameworkCore.ChangeTracking; + public class ApplicationDbContext : IdentityDbContext { public ApplicationDbContext() @@ -87,8 +89,8 @@ namespace Yavsc.Models } builder.Entity().Property(a=>a.ParentCode).IsRequired(false); - builder.Entity().HasOne(p => p.Author).WithMany(a => a.Posts); - + //builder.Entity().HasOne(p => p.Author).WithMany(a => a.Posts); + } // this is not a failback procedure. @@ -104,6 +106,7 @@ namespace Yavsc.Models var envSetup = Environment.GetEnvironmentVariable(Constants.YavscConnectionStringEnvName); if (envSetup!=null) optionsBuilder.UseNpgsql(envSetup); + else optionsBuilder.UseNpgsql(); } public DbSet Applications { get; set; } @@ -121,7 +124,7 @@ namespace Yavsc.Models /// Users posts /// /// - public DbSet Blogspot { get; set; } + public DbSet BlogSpot { get; set; } /// /// Skills powered by this site @@ -202,11 +205,11 @@ namespace Yavsc.Models public DbSet GeneralSettings { get; set; } public DbSet CoWorking { get; set; } - private void AddTimestamps(string currentUsername) + private void AddTimestamps(string userId) { var entities = ChangeTracker.Entries() - .Where(x => x.Entity.GetType().GetInterface("IBaseTrackedEntity") != null + .Where(x => x.Entity.GetType().GetInterface(nameof(ITrackedEntity)) != null && (x.State == EntityState.Added || x.State == EntityState.Modified)); @@ -214,20 +217,23 @@ namespace Yavsc.Models { if (entity.State == EntityState.Added) { - ((IBaseTrackedEntity)entity.Entity).DateCreated = DateTime.Now; - ((IBaseTrackedEntity)entity.Entity).UserCreated = currentUsername; + ((ITrackedEntity)entity.Entity).DateCreated = DateTime.Now; + ((ITrackedEntity)entity.Entity).UserCreated = userId; } - ((IBaseTrackedEntity)entity.Entity).DateModified = DateTime.Now; - ((IBaseTrackedEntity)entity.Entity).UserModified = currentUsername; + ((ITrackedEntity)entity.Entity).DateModified = DateTime.Now; + ((ITrackedEntity)entity.Entity).UserModified = userId; } } + public int SaveChanges(string userId) { AddTimestamps(userId); return base.SaveChanges(); } + + public async Task SaveChangesAsync(string userId, CancellationToken ctoken = default(CancellationToken)) { AddTimestamps(userId); diff --git a/src/Yavsc.Server/Models/Blog/BlogPost.cs b/src/Yavsc.Server/Models/Blog/BlogPost.cs index f5d55d21..1725678f 100644 --- a/src/Yavsc.Server/Models/Blog/BlogPost.cs +++ b/src/Yavsc.Server/Models/Blog/BlogPost.cs @@ -20,10 +20,6 @@ namespace Yavsc.Models.Blog [Display(Name="Identifiant du post")] public long Id { get; set; } - [Display(Name="Indice de qualité")] - public int Rate { get; set; } - - [Display(Name="Identifiant de l'auteur")] [ForeignKey("Author")] public string AuthorId { get; set; } @@ -60,11 +56,6 @@ namespace Yavsc.Models.Blog { return ACL?.Any( i=>i.CircleId == circleId) ?? true; } - - public string GetOwnerId() - { - return AuthorId; - } public ICircleAuthorization[] GetACL() { @@ -93,5 +84,8 @@ namespace Yavsc.Models.Blog [InverseProperty("Post")] public virtual List Comments { get; set; } + + [NotMapped] + public string OwnerId => AuthorId; } } diff --git a/src/Yavsc.Server/Models/Blog/Comment.cs b/src/Yavsc.Server/Models/Blog/Comment.cs index 07190459..5e8ab3cf 100644 --- a/src/Yavsc.Server/Models/Blog/Comment.cs +++ b/src/Yavsc.Server/Models/Blog/Comment.cs @@ -8,19 +8,19 @@ using Yavsc.Interfaces; namespace Yavsc.Models.Blog { - public class Comment : IComment, IBaseTrackedEntity + public class Comment : IComment, ITrackedEntity { [Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)] public long Id { get; set; } - [YaStringLength(1024)] + [YaStringLength(1024)] public string Content { get; set; } - [ForeignKeyAttribute("PostId")][JsonIgnore] + [ForeignKeyAttribute(nameof(ReceiverId))][JsonIgnore] public virtual BlogPost Post { get; set; } [Required] - public long PostId { get; set; } + public long ReceiverId { get; set; } public bool Visible { get; set; } [ForeignKeyAttribute("AuthorId")][JsonIgnore] @@ -34,10 +34,8 @@ namespace Yavsc.Models.Blog get; set; } - public string UserCreated - { - get; set; - } + public string UserCreated { get => AuthorId; set => AuthorId=value; } + public DateTime DateModified { get; set; @@ -53,19 +51,10 @@ namespace Yavsc.Models.Blog get; set; } - public long GetReceiverId() - { - return PostId; - } - public void SetReceiverId(long rid) - { - PostId = rid; - } - public long? ParentId { get; set; } [ForeignKeyAttribute("ParentId")] - public virtual Comment Parent { get; set; } + public virtual Comment? Parent { get; set; } [InversePropertyAttribute("Parent")] diff --git a/src/Yavsc.Server/Models/Chat/ChatRoom.cs b/src/Yavsc.Server/Models/Chat/ChatRoom.cs index 80d172ac..e03421c0 100644 --- a/src/Yavsc.Server/Models/Chat/ChatRoom.cs +++ b/src/Yavsc.Server/Models/Chat/ChatRoom.cs @@ -9,7 +9,7 @@ using Yavsc.Attributes.Validation; namespace Yavsc.Models.Chat { - public class ChatRoom: IChatRoom, IBaseTrackedEntity + public class ChatRoom: IChatRoom, ITrackedEntity { public string Topic { get; set; } @@ -32,4 +32,4 @@ namespace Yavsc.Models.Chat public DateTime DateModified { get; set;} public string UserModified { get; set; } } -} \ No newline at end of file +} diff --git a/src/Yavsc/Models/ConsentOptions.cs b/src/Yavsc.Server/Models/ConsentOptions.cs similarity index 100% rename from src/Yavsc/Models/ConsentOptions.cs rename to src/Yavsc.Server/Models/ConsentOptions.cs diff --git a/src/Yavsc.Server/Models/Cratie/Option.cs b/src/Yavsc.Server/Models/Cratie/Option.cs index 347fdf87..ed157717 100644 --- a/src/Yavsc.Server/Models/Cratie/Option.cs +++ b/src/Yavsc.Server/Models/Cratie/Option.cs @@ -2,7 +2,7 @@ using System; namespace Yavsc.Models.Cratie { - public class Option: IBaseTrackedEntity + public class Option: ITrackedEntity { public string CodeScrutin { get; set; } public string Code { get; set ; } @@ -12,4 +12,4 @@ namespace Yavsc.Models.Cratie public DateTime DateModified { get ; set ; } public string UserModified { get ; set ; } } -} \ No newline at end of file +} diff --git a/src/Yavsc.Server/Models/Cratie/Scrutin.cs b/src/Yavsc.Server/Models/Cratie/Scrutin.cs index 45634901..753cec34 100644 --- a/src/Yavsc.Server/Models/Cratie/Scrutin.cs +++ b/src/Yavsc.Server/Models/Cratie/Scrutin.cs @@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations; namespace Yavsc.Models.Cratie { - public class Scrutin : IBaseTrackedEntity + public class Scrutin : ITrackedEntity { [Key] public string Code { get; set ; } @@ -13,4 +13,4 @@ namespace Yavsc.Models.Cratie public DateTime DateModified { get; set; } public string UserModified { get; set; } } -} \ No newline at end of file +} diff --git a/src/Yavsc.Server/Models/EMailing/MailingTemplate.cs b/src/Yavsc.Server/Models/EMailing/MailingTemplate.cs index 66b3f6dd..956242dd 100644 --- a/src/Yavsc.Server/Models/EMailing/MailingTemplate.cs +++ b/src/Yavsc.Server/Models/EMailing/MailingTemplate.cs @@ -8,7 +8,7 @@ using Yavsc.Server.Models.Calendar; namespace Yavsc.Server.Models.EMailing { - public class MailingTemplate : IBaseTrackedEntity + public class MailingTemplate : ITrackedEntity { /// /// Date Created diff --git a/src/Yavsc/Models/ErrorViewModel.cs b/src/Yavsc.Server/Models/ErrorViewModel.cs similarity index 100% rename from src/Yavsc/Models/ErrorViewModel.cs rename to src/Yavsc.Server/Models/ErrorViewModel.cs diff --git a/src/Yavsc.Server/Models/Payment/PaypalPayment.cs b/src/Yavsc.Server/Models/Payment/PaypalPayment.cs index 3a88db01..60c6b2e0 100644 --- a/src/Yavsc.Server/Models/Payment/PaypalPayment.cs +++ b/src/Yavsc.Server/Models/Payment/PaypalPayment.cs @@ -8,7 +8,7 @@ namespace Yavsc.Models.Payment { using Relationship; using Yavsc.Attributes.Validation; - public class PayPalPayment : IBaseTrackedEntity + public class PayPalPayment : ITrackedEntity { [YaRequired,Key] public string CreationToken { get; set; } diff --git a/src/Yavsc.Server/Models/Workflow/Activity.cs b/src/Yavsc.Server/Models/Workflow/Activity.cs index 6106012b..2ca87aa5 100644 --- a/src/Yavsc.Server/Models/Workflow/Activity.cs +++ b/src/Yavsc.Server/Models/Workflow/Activity.cs @@ -11,7 +11,7 @@ namespace Yavsc.Models.Workflow using Yavsc; using Yavsc.Attributes.Validation; - public class Activity : IBaseTrackedEntity, IActivity + public class Activity : ITrackedEntity, IActivity { [YaStringLength(512), YaRequired, Key] diff --git a/src/Yavsc/Resources/Yavsc.AnnouncesController.resx b/src/Yavsc.Server/Resources/Yavsc.AnnouncesController.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.AnnouncesController.resx rename to src/Yavsc.Server/Resources/Yavsc.AnnouncesController.resx diff --git a/src/Yavsc/Resources/Yavsc.BugController.resx b/src/Yavsc.Server/Resources/Yavsc.BugController.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.BugController.resx rename to src/Yavsc.Server/Resources/Yavsc.BugController.resx diff --git a/src/Yavsc/Resources/Yavsc.Models.Billing.NominativeServiceCommand.resx b/src/Yavsc.Server/Resources/Yavsc.Models.Billing.NominativeServiceCommand.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.Models.Billing.NominativeServiceCommand.resx rename to src/Yavsc.Server/Resources/Yavsc.Models.Billing.NominativeServiceCommand.resx diff --git a/src/Yavsc/Resources/Yavsc.Models.IT.Fixing.Resources.resx b/src/Yavsc.Server/Resources/Yavsc.Models.IT.Fixing.Resources.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.Models.IT.Fixing.Resources.resx rename to src/Yavsc.Server/Resources/Yavsc.Models.IT.Fixing.Resources.resx diff --git a/src/Yavsc/Resources/Yavsc.Models.Musical.Profiles.Instrumentation.resx b/src/Yavsc.Server/Resources/Yavsc.Models.Musical.Profiles.Instrumentation.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.Models.Musical.Profiles.Instrumentation.resx rename to src/Yavsc.Server/Resources/Yavsc.Models.Musical.Profiles.Instrumentation.resx diff --git a/src/Yavsc/Resources/Yavsc.Resources.EnrolerViewModel.Designer.cs b/src/Yavsc.Server/Resources/Yavsc.Resources.EnrolerViewModel.Designer.cs similarity index 100% rename from src/Yavsc/Resources/Yavsc.Resources.EnrolerViewModel.Designer.cs rename to src/Yavsc.Server/Resources/Yavsc.Resources.EnrolerViewModel.Designer.cs diff --git a/src/Yavsc/Resources/Yavsc.Resources.Resources.Designer.cs b/src/Yavsc.Server/Resources/Yavsc.Resources.Resources.Designer.cs similarity index 100% rename from src/Yavsc/Resources/Yavsc.Resources.Resources.Designer.cs rename to src/Yavsc.Server/Resources/Yavsc.Resources.Resources.Designer.cs diff --git a/src/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.Designer.cs b/src/Yavsc.Server/Resources/Yavsc.Resources.YavscLocalisation.Designer.cs similarity index 100% rename from src/Yavsc/Resources/Yavsc.Resources.YavscLocalisation.Designer.cs rename to src/Yavsc.Server/Resources/Yavsc.Resources.YavscLocalisation.Designer.cs diff --git a/src/Yavsc/Resources/Yavsc.Services.ChatHubConnectionManager.resx b/src/Yavsc.Server/Resources/Yavsc.Services.ChatHubConnectionManager.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.Services.ChatHubConnectionManager.resx rename to src/Yavsc.Server/Resources/Yavsc.Services.ChatHubConnectionManager.resx diff --git a/src/Yavsc/Resources/Yavsc.ViewComponents.CommentViewComponent.en.resx b/src/Yavsc.Server/Resources/Yavsc.ViewComponents.CommentViewComponent.en.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.ViewComponents.CommentViewComponent.en.resx rename to src/Yavsc.Server/Resources/Yavsc.ViewComponents.CommentViewComponent.en.resx diff --git a/src/Yavsc/Resources/Yavsc.ViewComponents.CommentViewComponent.resx b/src/Yavsc.Server/Resources/Yavsc.ViewComponents.CommentViewComponent.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.ViewComponents.CommentViewComponent.resx rename to src/Yavsc.Server/Resources/Yavsc.ViewComponents.CommentViewComponent.resx diff --git a/src/Yavsc/Resources/Yavsc.ViewComponents.TaggerViewComponent.resx b/src/Yavsc.Server/Resources/Yavsc.ViewComponents.TaggerViewComponent.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.ViewComponents.TaggerViewComponent.resx rename to src/Yavsc.Server/Resources/Yavsc.ViewComponents.TaggerViewComponent.resx diff --git a/src/Yavsc/Resources/Yavsc.ViewModels.EnrolerViewModel.resx b/src/Yavsc.Server/Resources/Yavsc.ViewModels.EnrolerViewModel.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.ViewModels.EnrolerViewModel.resx rename to src/Yavsc.Server/Resources/Yavsc.ViewModels.EnrolerViewModel.resx diff --git a/src/Yavsc/Resources/Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel.resx b/src/Yavsc.Server/Resources/Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel.resx rename to src/Yavsc.Server/Resources/Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel.resx diff --git a/src/Yavsc/Resources/Yavsc.YavscLocalisation.en.resx b/src/Yavsc.Server/Resources/Yavsc.YavscLocalisation.en.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.YavscLocalisation.en.resx rename to src/Yavsc.Server/Resources/Yavsc.YavscLocalisation.en.resx diff --git a/src/Yavsc/Resources/Yavsc.YavscLocalisation.pt.resx b/src/Yavsc.Server/Resources/Yavsc.YavscLocalisation.pt.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.YavscLocalisation.pt.resx rename to src/Yavsc.Server/Resources/Yavsc.YavscLocalisation.pt.resx diff --git a/src/Yavsc/Resources/Yavsc.YavscLocalisation.resx b/src/Yavsc.Server/Resources/Yavsc.YavscLocalisation.resx similarity index 100% rename from src/Yavsc/Resources/Yavsc.YavscLocalisation.resx rename to src/Yavsc.Server/Resources/Yavsc.YavscLocalisation.resx diff --git a/src/Yavsc/Services/BillingService.cs b/src/Yavsc.Server/Services/BillingService.cs similarity index 100% rename from src/Yavsc/Services/BillingService.cs rename to src/Yavsc.Server/Services/BillingService.cs diff --git a/src/Yavsc/Services/ChatHubConnexionManager.cs b/src/Yavsc.Server/Services/ChatHubConnexionManager.cs similarity index 100% rename from src/Yavsc/Services/ChatHubConnexionManager.cs rename to src/Yavsc.Server/Services/ChatHubConnexionManager.cs diff --git a/src/Yavsc/Services/DiskUsageTracker.cs b/src/Yavsc.Server/Services/DiskUsageTracker.cs similarity index 100% rename from src/Yavsc/Services/DiskUsageTracker.cs rename to src/Yavsc.Server/Services/DiskUsageTracker.cs diff --git a/src/Yavsc/Services/EMailer.cs b/src/Yavsc.Server/Services/EMailer.cs similarity index 99% rename from src/Yavsc/Services/EMailer.cs rename to src/Yavsc.Server/Services/EMailer.cs index b9b76941..879af225 100644 --- a/src/Yavsc/Services/EMailer.cs +++ b/src/Yavsc.Server/Services/EMailer.cs @@ -16,6 +16,7 @@ using Yavsc.Abstract.Templates; using Microsoft.AspNetCore.Identity; using RazorEngine.Configuration; using Yavsc.Interface; +using Microsoft.Extensions.Logging; namespace Yavsc.Lib { diff --git a/src/Yavsc/Services/FileSystemAuthManager.cs b/src/Yavsc.Server/Services/FileSystemAuthManager.cs similarity index 100% rename from src/Yavsc/Services/FileSystemAuthManager.cs rename to src/Yavsc.Server/Services/FileSystemAuthManager.cs diff --git a/src/Yavsc/Services/GoogleApis/CalendarManager.cs b/src/Yavsc.Server/Services/GoogleApis/CalendarManager.cs similarity index 99% rename from src/Yavsc/Services/GoogleApis/CalendarManager.cs rename to src/Yavsc.Server/Services/GoogleApis/CalendarManager.cs index 8662ead2..00f5a9b2 100644 --- a/src/Yavsc/Services/GoogleApis/CalendarManager.cs +++ b/src/Yavsc.Server/Services/GoogleApis/CalendarManager.cs @@ -27,6 +27,7 @@ using Google.Apis.Auth.OAuth2.Responses; namespace Yavsc.Services { + using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Yavsc.Models.Calendar; using Yavsc.Server.Helpers; diff --git a/src/Yavsc/Services/IFileSystemAuthManager.cs b/src/Yavsc.Server/Services/IFileSystemAuthManager.cs similarity index 100% rename from src/Yavsc/Services/IFileSystemAuthManager.cs rename to src/Yavsc.Server/Services/IFileSystemAuthManager.cs diff --git a/src/Yavsc/Services/LiveProcessor.cs b/src/Yavsc.Server/Services/LiveProcessor.cs similarity index 99% rename from src/Yavsc/Services/LiveProcessor.cs rename to src/Yavsc.Server/Services/LiveProcessor.cs index 87c13114..a5259dad 100644 --- a/src/Yavsc/Services/LiveProcessor.cs +++ b/src/Yavsc.Server/Services/LiveProcessor.cs @@ -3,6 +3,8 @@ using System.Net.WebSockets; using Yavsc.Models; using Yavsc.ViewModels.Streaming; using Newtonsoft.Json; +using Microsoft.Extensions.Logging; +using Microsoft.AspNetCore.Http; namespace Yavsc.Services { diff --git a/src/Yavsc/Services/MailSender.cs b/src/Yavsc.Server/Services/MailSender.cs similarity index 100% rename from src/Yavsc/Services/MailSender.cs rename to src/Yavsc.Server/Services/MailSender.cs diff --git a/src/Yavsc.Server/Services/ProfileService.cs b/src/Yavsc.Server/Services/ProfileService.cs new file mode 100644 index 00000000..3239672a --- /dev/null +++ b/src/Yavsc.Server/Services/ProfileService.cs @@ -0,0 +1,92 @@ +using System.Security.Claims; +using IdentityModel; +using IdentityServer8.Models; +using IdentityServer8.Services; +using IdentityServer8.Stores; +using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Logging; +using Yavsc.Models; + +namespace Yavsc.Services +{ + public class ProfileService : IProfileService + { + private readonly UserManager _userManager; + public ProfileService( + UserManager userManager, + ILogger logger) + { + _userManager = userManager; + } + + private async Task> GetClaimsFromUserAsync( + ProfileDataRequestContext context, + ApplicationUser user) + { + + var claims = new List { + new Claim(JwtClaimTypes.Subject,user.Id.ToString()), + }; + List claimAdds = new List(); + + foreach (var scope in context.RequestedResources.ParsedScopes) + { + if (context.Client.AllowedScopes.Contains(scope.ParsedName)) + { + claims.Add(new Claim(JwtClaimTypes.Scope, scope.ParsedName)); + claimAdds.Add(scope.ParsedName); + } + } + + if (claimAdds.Contains(JwtClaimTypes.Profile)) + { + claimAdds.Remove("profile"); + claimAdds.Add(JwtClaimTypes.Name); + claimAdds.Add(JwtClaimTypes.Email); + claimAdds.Add(JwtClaimTypes.Role); + } + + if (claimAdds.Contains(JwtClaimTypes.Name)) + claims.Add(new Claim(JwtClaimTypes.Name, user.FullName)); + + if (claimAdds.Contains(JwtClaimTypes.Email)) + claims.Add(new Claim(JwtClaimTypes.Email, user.Email)); + + if (claimAdds.Contains(JwtClaimTypes.Role)) + { + var roles = await this._userManager.GetRolesAsync(user); + if (roles.Count()>0) + { + claims.AddRange(roles.Select(r => new Claim(Constants.RoleClaimName, r))); + } + } + return claims; + } + + public async Task GetProfileDataAsync(ProfileDataRequestContext context) + { + var subjectId = GetSubjectId(context.Subject); + if (subjectId==null) return; + var user = await _userManager.FindByIdAsync(subjectId); + if (user==null) return ; + context.IssuedClaims = await GetClaimsFromUserAsync(context, user); + } + + public async Task IsActiveAsync(IsActiveContext context) + { + string? subjectId = GetSubjectId(context.Subject); + if (subjectId == null) + { + context.IsActive = false; + return; + } + var user = await _userManager.FindByIdAsync(subjectId); + context.IsActive = user != null; + } + + private static string? GetSubjectId(ClaimsPrincipal claimsPrincipal) + { + return claimsPrincipal.Claims.FirstOrDefault(c => c.Type == "sub")?.Value; + } + } +} diff --git a/src/Yavsc/Services/SIRENCheker.cs b/src/Yavsc.Server/Services/SIRENCheker.cs similarity index 100% rename from src/Yavsc/Services/SIRENCheker.cs rename to src/Yavsc.Server/Services/SIRENCheker.cs diff --git a/src/Yavsc/Services/YavscClientStore.cs b/src/Yavsc.Server/Services/YavscClientStore.cs similarity index 96% rename from src/Yavsc/Services/YavscClientStore.cs rename to src/Yavsc.Server/Services/YavscClientStore.cs index 7accd231..46576662 100644 --- a/src/Yavsc/Services/YavscClientStore.cs +++ b/src/Yavsc.Server/Services/YavscClientStore.cs @@ -1,6 +1,6 @@ -using IdentityServer4.Models; -using IdentityServer4.Stores; +using IdentityServer8.Models; +using IdentityServer8.Stores; using Microsoft.EntityFrameworkCore; using Yavsc.Models; diff --git a/src/Yavsc/Settings/DataProtectionSettings.cs b/src/Yavsc.Server/Settings/DataProtectionSettings.cs similarity index 100% rename from src/Yavsc/Settings/DataProtectionSettings.cs rename to src/Yavsc.Server/Settings/DataProtectionSettings.cs diff --git a/src/Yavsc/Settings/SmtpSettings.cs b/src/Yavsc.Server/Settings/SmtpSettings.cs similarity index 100% rename from src/Yavsc/Settings/SmtpSettings.cs rename to src/Yavsc.Server/Settings/SmtpSettings.cs diff --git a/src/Yavsc/ViewModels/Auth/EditRequirement.cs b/src/Yavsc.Server/ViewModels/Auth/EditRequirement.cs similarity index 100% rename from src/Yavsc/ViewModels/Auth/EditRequirement.cs rename to src/Yavsc.Server/ViewModels/Auth/EditRequirement.cs diff --git a/src/Yavsc/ViewModels/Auth/FileSpotInfo.cs b/src/Yavsc.Server/ViewModels/Auth/FileSpotInfo.cs similarity index 100% rename from src/Yavsc/ViewModels/Auth/FileSpotInfo.cs rename to src/Yavsc.Server/ViewModels/Auth/FileSpotInfo.cs diff --git a/src/Yavsc/ViewModels/Auth/ModerationRequirement.cs b/src/Yavsc.Server/ViewModels/Auth/ModerationRequirement.cs similarity index 100% rename from src/Yavsc/ViewModels/Auth/ModerationRequirement.cs rename to src/Yavsc.Server/ViewModels/Auth/ModerationRequirement.cs diff --git a/src/Yavsc/ViewModels/Auth/PrivateChatEntryRequirement.cs b/src/Yavsc.Server/ViewModels/Auth/PrivateChatEntryRequirement.cs similarity index 100% rename from src/Yavsc/ViewModels/Auth/PrivateChatEntryRequirement.cs rename to src/Yavsc.Server/ViewModels/Auth/PrivateChatEntryRequirement.cs diff --git a/src/Yavsc/ViewModels/Auth/ViewFileContext.cs b/src/Yavsc.Server/ViewModels/Auth/ViewFileContext.cs similarity index 100% rename from src/Yavsc/ViewModels/Auth/ViewFileContext.cs rename to src/Yavsc.Server/ViewModels/Auth/ViewFileContext.cs diff --git a/src/Yavsc/ViewModels/Auth/ViewRequirement.cs b/src/Yavsc.Server/ViewModels/Auth/ViewRequirement.cs similarity index 100% rename from src/Yavsc/ViewModels/Auth/ViewRequirement.cs rename to src/Yavsc.Server/ViewModels/Auth/ViewRequirement.cs diff --git a/src/Yavsc.Server/ViewModels/BlogSpot/NewPost.cs b/src/Yavsc.Server/ViewModels/BlogSpot/NewPost.cs new file mode 100644 index 00000000..dc0d7842 --- /dev/null +++ b/src/Yavsc.Server/ViewModels/BlogSpot/NewPost.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using System.Threading.Tasks; + +namespace Yavsc.ViewModels.BlogSpot +{ + public class NewPost + { + [Required] + public string Title{ get; set; } + + [Required] + public string Content { get; set; } + } +} diff --git a/src/Yavsc/Hubs/ChatRoomInfo.cs b/src/Yavsc.Server/ViewModels/Chat/ChatRoomInfo.cs similarity index 100% rename from src/Yavsc/Hubs/ChatRoomInfo.cs rename to src/Yavsc.Server/ViewModels/Chat/ChatRoomInfo.cs diff --git a/src/Yavsc/ViewModels/FrontOffice/PerformerProfileViewModel.cs b/src/Yavsc.Server/ViewModels/FrontOffice/PerformerProfileViewModel.cs similarity index 100% rename from src/Yavsc/ViewModels/FrontOffice/PerformerProfileViewModel.cs rename to src/Yavsc.Server/ViewModels/FrontOffice/PerformerProfileViewModel.cs diff --git a/src/Yavsc/ViewModels/Streaming/LiveCastHandler.cs b/src/Yavsc.Server/ViewModels/LiveCastHandler.cs similarity index 99% rename from src/Yavsc/ViewModels/Streaming/LiveCastHandler.cs rename to src/Yavsc.Server/ViewModels/LiveCastHandler.cs index fc71e760..e5e83506 100644 --- a/src/Yavsc/ViewModels/Streaming/LiveCastHandler.cs +++ b/src/Yavsc.Server/ViewModels/LiveCastHandler.cs @@ -10,6 +10,7 @@ using Newtonsoft.Json; using Yavsc.Helpers; using Yavsc.Models; using Yavsc.Models.FileSystem; +using Yavsc.Server.Helpers; namespace Yavsc.ViewModels.Streaming { diff --git a/src/Yavsc.Server/Yavsc.Server.csproj b/src/Yavsc.Server/Yavsc.Server.csproj index f8a1ef6a..3769be24 100644 --- a/src/Yavsc.Server/Yavsc.Server.csproj +++ b/src/Yavsc.Server/Yavsc.Server.csproj @@ -1,20 +1,30 @@ - + net8.0 enable enable + 53bd70e8-ff81-497a-847f-a15fd8ea7a09 + + + runtime; build; native; contentfiles; analyzers; buildtransitive all + + + + + + diff --git a/src/Yavsc.Server/project.json b/src/Yavsc.Server/project.json deleted file mode 100644 index 472c4a95..00000000 --- a/src/Yavsc.Server/project.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "version": "1.0.5-*", - "description": "Yavsc server common library", - "authors": [ - "Paul Schneider " - ], - "packOptions": { - "repository": { - "type": "git", - "url": "https://github.com/pazof/yavsc" - }, - "licenseUrl": "https://github.com/pazof/yavsc/blob/vnext/LICENSE", - "requireLicenseAcceptance": true, - "owners": [ - "Paul Schneider " - ], - "summary": "Yet another very small company", - "projectUrl": "http://yavsc.pschneider.fr", - "tags": [ - "Blog", - "PoS", - "Chat" - ] - }, - "userSecretsId": "aspnet5-YavscWeb-a0dadd21-2ced-43d3-96f9-7e504345102f", - "buildOptions": { - "debugType": "full", - "emitEntryPoint": false, - "outputName": "Yavsc.Server", - "compile": { - "include": "*.cs", - "exclude": [ - "wwwroot", - "node_modules", - "bower_components", - "contrib" - ] - }, - "embed": [ - "Resources/**/*.resx" - ], - "publicSign": false, - "keyFile": "../../../sgKey.snk", - "nowarn": ["IDE1006"] - }, - "tooling": { - "defaultNamespace": "Yavsc" - }, - "dependencies": { - "EntityFramework.Commands": "7.0.0-rc1-final", - "Microsoft.AspNet.Identity.EntityFramework": "3.0.0-rc1-*", - "Microsoft.Extensions.Configuration.Abstractions": "1.0.0-rc1-final", - "Microsoft.Extensions.Configuration.FileProviderExtensions": "1.0.0-rc1-final", - "Microsoft.Extensions.Configuration.UserSecrets": "1.0.0-rc1-final", - "Microsoft.Extensions.Globalization.CultureInfoCache": "1.0.0-rc1-final", - "Microsoft.Extensions.Localization.Abstractions": "1.0.0-rc1-final", - "Microsoft.Extensions.Logging": "1.0.0-rc1-final", - "Microsoft.Extensions.Logging.Console": "1.0.0-rc1-final", - "Microsoft.Extensions.Logging.Debug": "1.0.0-rc1-final", - "Microsoft.Extensions.Logging.TraceSource": "1.0.0-rc1-final", - "Microsoft.Extensions.Options": "0.0.1-alpha", - "Microsoft.Extensions.Localization": "1.0.0-rc1-final", - "Newtonsoft.Json": "7.0.1", - "Gapi.net45": "1.0.1", - "PayPalMerchant-net451": "2.7.109", - "MailKit": "1.12.0", - "Microsoft.CodeAnalysis.CSharp": "1.1.0-rc1-20151109-01", - "Yavsc.Abstract": { - "type": "build" - } - }, - "frameworks": { - "dnx451": { - "frameworkAssemblies": { - "System.ComponentModel.DataAnnotations": "4.0.0", - "System.Linq": "4.0.0", - "System.Net": "4.0.0.0", - "System.Net.Http": "4.0.0", - "System.Xml": "4.0.0" - } - }, - "net451": { - "frameworkAssemblies": { - "System.ComponentModel.DataAnnotations": "4.0.0", - "System.Net": "4.0.0.0", - "System.Net.Http": "4.0.0", - "System.Xml": "4.0.0", - "System": "4.0.0" - } - }, - "net452": { - "frameworkAssemblies": { - "System.ComponentModel.DataAnnotations": "4.0.0", - "System.Net": "4.0.0.0", - "System.Net.Http": "4.0.0", - "System.Xml": "4.0.0", - "System": "4.0.0" - } - }, - "net46": { - "frameworkAssemblies": { - "System.ComponentModel.DataAnnotations": "4.0.0", - "System.Net": "4.0.0.0", - "System.Net.Http": "4.0.0", - "System.Xml": "4.0.0", - "System": "4.0.0" - } - }, - "net461": { - "frameworkAssemblies": { - "System.ComponentModel.DataAnnotations": "4.0.0", - "System.Net": "4.0.0.0", - "System.Net.Http": "4.0.0", - "System.Xml": "4.0.0", - "System": "4.0.0" - } - } - }, - "commands": { - "ef": "EntityFramework.Commands", - "gen": "Microsoft.Extensions.CodeGeneration" - }, - "scripts": { - "postrestore": [ - "grep -v '\\.\\.dll' project.lock.json > new.project.lock.json", - "mv new.project.lock.json project.lock.json" - ] - } -} diff --git a/src/Yavsc/ApiControllers/accounting/AccountController.cs b/src/Yavsc/ApiControllers/accounting/AccountController.cs deleted file mode 100644 index a9934a2b..00000000 --- a/src/Yavsc/ApiControllers/accounting/AccountController.cs +++ /dev/null @@ -1,189 +0,0 @@ -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Mvc; -using System.Security.Claims; -using Microsoft.EntityFrameworkCore; - -using Yavsc.Models; -using Yavsc.Models.Account; -using Yavsc.ViewModels.Account; -using Yavsc.Helpers; -using Yavsc.Abstract.Identity; - -namespace Yavsc.WebApi.Controllers -{ - - [Authorize(),Route("~/api/account")] - public class ApiAccountController : Controller - { - private UserManager _userManager; - private readonly SignInManager _signInManager; - readonly ApplicationDbContext _dbContext; - private readonly ILogger _logger; - - public ApiAccountController(UserManager userManager, - SignInManager signInManager, ILoggerFactory loggerFactory, ApplicationDbContext dbContext) - { - UserManager = userManager; - _signInManager = signInManager; - _logger = loggerFactory.CreateLogger("ApiAuth"); - _dbContext = dbContext; - } - - public UserManager UserManager - { - get - { - return _userManager; - } - private set - { - _userManager = value; - } - } - - // POST api/Account/ChangePassword - [Authorize] - public async Task ChangePassword(ChangePasswordBindingModel model) - { - if (!ModelState.IsValid) - { - return new BadRequestObjectResult(ModelState); - } - var user = await _userManager.FindByIdAsync(User.GetUserId()); - if (user == null || !(await _userManager.IsEmailConfirmedAsync(user))) { - IdentityResult result = await UserManager.ChangePasswordAsync(user, model.OldPassword, - model.NewPassword); - - if (!result.Succeeded) - { - AddErrors("NewPassword",result); - return new BadRequestObjectResult(ModelState); - } - } - return Ok(); - } - - // POST api/Account/SetPassword - [Authorize] - public async Task SetPassword(SetPasswordBindingModel model) - { - if (!ModelState.IsValid) - { - return new BadRequestObjectResult(ModelState); - } - var user = await _userManager.FindByIdAsync(User.GetUserId()); - if (user == null || !(await _userManager.IsEmailConfirmedAsync(user))) { - IdentityResult result = await UserManager.AddPasswordAsync(user, model.NewPassword); - if (!result.Succeeded) - { - AddErrors ("NewPassword",result); - return new BadRequestObjectResult(ModelState); - } - } - return Ok(); - } - - // POST api/Account/Register - [AllowAnonymous] - public async Task Register(RegisterModel model) - { - if (!ModelState.IsValid) - { - return new BadRequestObjectResult(ModelState); - } - - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - - IdentityResult result = await UserManager.CreateAsync(user, model.Password); - - if (!result.Succeeded) - { - AddErrors ("Register",result); - return new BadRequestObjectResult(ModelState); - } - await _signInManager.SignInAsync(user, isPersistent: false); - return Ok(); - } - private void AddErrors(string key, IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError(key, error.Description); - } - } - protected override void Dispose(bool disposing) - { - if (disposing) - { - UserManager.Dispose(); - } - - base.Dispose(disposing); - } - - [HttpGet("~/api/me"),Authorize] - public async Task Me () - { - if (User==null) - return new BadRequestObjectResult( - new { error = "user not found" }); - var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); - - var userData = await _dbContext.Users - .Include(u=>u.PostalAddress) - .Include(u=>u.AccountBalance) - .FirstAsync(u=>u.Id == uid); - - var user = new Yavsc.Models.Auth.Me(userData.Id, userData.UserName, userData.Email, - userData.Avatar , - userData.PostalAddress, userData.DedicatedGoogleCalendar ); - - var userRoles = _dbContext.UserRoles.Where(u=>u.UserId == uid).ToArray(); - - IdentityRole [] roles = _dbContext.Roles.Where(r=>userRoles.Any(ur=>ur.RoleId==r.Id)).ToArray(); - - user.Roles = roles.Select(r=>r.Name).ToArray(); - - return Ok(user); - } - - [HttpGet("~/api/myhost"),Authorize] - public IActionResult MyHost () - { - return Ok(new { host = Request.ForHost() }); - } - - /// - /// Actually only updates the user's name. - /// - /// MyUpdate containing the new user name - /// Ok when all is ok. - [HttpPut("~/api/me"),Authorize] - public async Task UpdateMe(UserInfo me) - { - if (!ModelState.IsValid) return new BadRequestObjectResult( - new { error = "Specify some valid user update request." }); - var user = await _userManager.FindByIdAsync(User.GetUserId()); - var result = await _userManager.SetUserNameAsync(user, me.UserName); - if (result.Succeeded) - return Ok(); - else return new BadRequestObjectResult(result); - } - /// - /// Updates the avatar - /// - /// - [HttpPost("~/api/setavatar"),Authorize] - public async Task SetAvatar() - { - var root = User.InitPostToFileSystem(null); - var user = await _userManager.FindByIdAsync(User.GetUserId()); - if (Request.Form.Files.Count!=1) - return new BadRequestResult(); - var info = user.ReceiveAvatar(Request.Form.Files[0]); - await _userManager.UpdateAsync(user); - return Ok(info); - } - } -} diff --git a/src/Yavsc/Avatars-Dev/Paul Schneider.png b/src/Yavsc/Avatars-Dev/Paul Schneider.png deleted file mode 100644 index aec46ec7..00000000 Binary files a/src/Yavsc/Avatars-Dev/Paul Schneider.png and /dev/null differ diff --git a/src/Yavsc/Avatars-Dev/Paul Schneider.s.png b/src/Yavsc/Avatars-Dev/Paul Schneider.s.png deleted file mode 100644 index e50b9632..00000000 Binary files a/src/Yavsc/Avatars-Dev/Paul Schneider.s.png and /dev/null differ diff --git a/src/Yavsc/Avatars-Dev/Paul Schneider.xs.png b/src/Yavsc/Avatars-Dev/Paul Schneider.xs.png deleted file mode 100644 index 083cdc3f..00000000 Binary files a/src/Yavsc/Avatars-Dev/Paul Schneider.xs.png and /dev/null differ diff --git a/src/Yavsc/Avatars-Dev/Paul.png b/src/Yavsc/Avatars-Dev/Paul.png index aec46ec7..9b71ef8e 100644 Binary files a/src/Yavsc/Avatars-Dev/Paul.png and b/src/Yavsc/Avatars-Dev/Paul.png differ diff --git a/src/Yavsc/Avatars-Dev/Paul.s.png b/src/Yavsc/Avatars-Dev/Paul.s.png index e50b9632..d03ad946 100644 Binary files a/src/Yavsc/Avatars-Dev/Paul.s.png and b/src/Yavsc/Avatars-Dev/Paul.s.png differ diff --git a/src/Yavsc/Avatars-Dev/Paul.xs.png b/src/Yavsc/Avatars-Dev/Paul.xs.png index 083cdc3f..2ca20445 100644 Binary files a/src/Yavsc/Avatars-Dev/Paul.xs.png and b/src/Yavsc/Avatars-Dev/Paul.xs.png differ diff --git a/src/Yavsc/Controllers/Accounting/AccountController.cs b/src/Yavsc/Controllers/Accounting/AccountController.cs index 000a8138..12f56967 100644 --- a/src/Yavsc/Controllers/Accounting/AccountController.cs +++ b/src/Yavsc/Controllers/Accounting/AccountController.cs @@ -13,16 +13,16 @@ using Yavsc.ViewModels.Account; using Yavsc.Helpers; using Yavsc.Abstract.Manage; using Yavsc.Interface; -using IdentityServer4.Test; -using IdentityServer4.Services; -using IdentityServer4.Stores; +using IdentityServer8.Test; +using IdentityServer8.Services; +using IdentityServer8.Stores; using Microsoft.AspNetCore.Authentication; using Yavsc.Models.Access; -using IdentityServer4.Models; +using IdentityServer8.Models; using Yavsc.Extensions; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4; +using IdentityServer8.Events; +using IdentityServer8.Extensions; +using IdentityServer8; using IdentityModel; using System.Security.Cryptography; using System.Text.Unicode; @@ -278,7 +278,7 @@ namespace Yavsc.Controllers var context = await _interaction.GetAuthorizationContextAsync(returnUrl); if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null) { - var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider; + var local = context.IdP == IdentityServer8.IdentityServerConstants.LocalIdentityProvider; // this is meant to short circuit the UI and only trigger the one external IdP var vm = new LoginViewModel @@ -380,7 +380,7 @@ namespace Yavsc.Controllers if (User?.Identity.IsAuthenticated == true) { var idp = User.FindFirst(JwtClaimTypes.IdentityProvider)?.Value; - if (idp != null && idp != IdentityServer4.IdentityServerConstants.LocalIdentityProvider) + if (idp != null && idp != IdentityServer8.IdentityServerConstants.LocalIdentityProvider) { var providerSupportsSignout = await HttpContext.GetSchemeSupportsSignOutAsync(idp); if (providerSupportsSignout) diff --git a/src/Yavsc/Controllers/Accounting/ManageController.cs b/src/Yavsc/Controllers/Accounting/ManageController.cs index ab12234d..d0f9dc01 100644 --- a/src/Yavsc/Controllers/Accounting/ManageController.cs +++ b/src/Yavsc/Controllers/Accounting/ManageController.cs @@ -15,10 +15,11 @@ using Yavsc.Models; using Yavsc.Services; using Yavsc.ViewModels.Manage; using Microsoft.AspNetCore.Identity.UI.Services; +using Microsoft.AspNetCore.Authorization; namespace Yavsc.Controllers { - + [Authorize] public class ManageController : Controller { private readonly UserManager _userManager; @@ -91,7 +92,10 @@ namespace Yavsc.Controllers : ""; var user = await GetCurrentUserAsync(); - long pc = _dbContext.Blogspot.Count(x => x.AuthorId == user.Id); + + long pc = _dbContext.BlogSpot.Count(x => x.AuthorId == user.Id); + + var model = new IndexViewModel { diff --git a/src/Yavsc/Controllers/Communicating/BlogspotController.cs b/src/Yavsc/Controllers/Communicating/BlogspotController.cs index b6f34d6e..a3eb627e 100644 --- a/src/Yavsc/Controllers/Communicating/BlogspotController.cs +++ b/src/Yavsc/Controllers/Communicating/BlogspotController.cs @@ -16,6 +16,7 @@ using Microsoft.Extensions.Options; using Microsoft.EntityFrameworkCore; using System.Diagnostics; using Yavsc.ViewModels.Blog; +using System.Collections; // For more information on enabling Web API for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860 @@ -45,7 +46,7 @@ namespace Yavsc.Controllers public async Task Index(string id) { if (!string.IsNullOrEmpty(id)) { - return await UserPosts(id); + return View("UserPosts", await UserPosts(id)); } return View(); } @@ -56,20 +57,17 @@ namespace Yavsc.Controllers { var uid = User.FindFirstValue(ClaimTypes.NameIdentifier); ViewData["Title"] = id; - return View("Title", _context.Blogspot.Include( + return View("Title", _context.BlogSpot.Include( b => b.Author ).Where(x => x.Title == id && (x.Visible || x.AuthorId == uid )).OrderByDescending( x => x.DateCreated ).ToList()); } - [Route("~/Blog/{userName}/{pageLen?}/{pageNum?}")] - [AllowAnonymous] - public async Task UserPosts(string userName, int pageLen=10, int pageNum=0) + private async Task> UserPosts(string userName, int pageLen=10, int pageNum=0) { string posterId = (await _context.Users.SingleOrDefaultAsync(u=>u.UserName == userName))?.Id ?? null ; - var result = _context.UserPosts(posterId, User.Identity.Name); - return View("Index", result.ToArray().Skip(pageLen*pageNum).Take(pageLen).OrderByDescending(p => p.DateCreated).ToList().GroupBy(p=> p.Title )); + return _context.UserPosts(posterId, User.Identity.Name); } // GET: Blog/Details/5 [AllowAnonymous] @@ -80,7 +78,7 @@ namespace Yavsc.Controllers return NotFound(); } - BlogPost blog = _context.Blogspot + BlogPost blog = _context.BlogSpot .Include(p => p.Author) .Include(p => p.Tags) .Include(p => p.Comments) @@ -130,10 +128,9 @@ namespace Yavsc.Controllers Title = blogInput.Title, Content = blogInput.Content, Photo = blogInput.Photo, - Rate = 0, AuthorId = User.GetUserId() }; - _context.Blogspot.Add(post); + _context.BlogSpot.Add(post); _context.SaveChanges(User.GetUserId()); return RedirectToAction("Index"); } @@ -152,7 +149,7 @@ namespace Yavsc.Controllers } ViewData["PostTarget"]="Edit"; - BlogPost blog = _context.Blogspot.Include(x => x.Author).Include(x => x.ACL).Single(m => m.Id == id); + BlogPost blog = _context.BlogSpot.Include(x => x.Author).Include(x => x.ACL).Single(m => m.Id == id); if (blog == null) { @@ -214,7 +211,7 @@ namespace Yavsc.Controllers return NotFound(); } - BlogPost blog = _context.Blogspot.Include( + BlogPost blog = _context.BlogSpot.Include( b => b.Author ).Single(m => m.Id == id); if (blog == null) @@ -230,9 +227,10 @@ namespace Yavsc.Controllers [ValidateAntiForgeryToken] public IActionResult DeleteConfirmed(long id) { - BlogPost blog = _context.Blogspot.Single(m => m.Id == id && m.GetOwnerId()== User.GetUserId()); + var uid = User.GetUserId(); + BlogPost blog = _context.BlogSpot.Single(m => m.Id == id && m.AuthorId == uid ); - _context.Blogspot.Remove(blog); + _context.BlogSpot.Remove(blog); _context.SaveChanges(User.GetUserId()); return RedirectToAction("Index"); diff --git a/src/Yavsc/Controllers/Communicating/CommentsController.cs b/src/Yavsc/Controllers/Communicating/CommentsController.cs index 9475c429..6c535fe8 100644 --- a/src/Yavsc/Controllers/Communicating/CommentsController.cs +++ b/src/Yavsc/Controllers/Communicating/CommentsController.cs @@ -47,7 +47,7 @@ namespace Yavsc.Controllers // GET: Comments/Create public IActionResult Create() { - ViewData["PostId"] = new SelectList(_context.Blogspot, "Id", "Post"); + ViewData["ReceiverId"] = new SelectList(_context.BlogSpot, "Id", "Post"); return View(); } @@ -64,7 +64,7 @@ namespace Yavsc.Controllers await _context.SaveChangesAsync(); return RedirectToAction("Index"); } - ViewData["PostId"] = new SelectList(_context.Blogspot, "Id", "Post", comment.PostId); + ViewData["ReceiverId"] = new SelectList(_context.BlogSpot, "Id", "Post", comment.ReceiverId); return View(comment); } @@ -81,7 +81,7 @@ namespace Yavsc.Controllers { return NotFound(); } - ViewData["PostId"] = new SelectList(_context.Blogspot, "Id", "Post", comment.PostId); + ViewData["ReceiverId"] = new SelectList(_context.BlogSpot, "Id", "Post", comment.ReceiverId); return View(comment); } @@ -96,7 +96,7 @@ namespace Yavsc.Controllers await _context.SaveChangesAsync(); return RedirectToAction("Index"); } - ViewData["PostId"] = new SelectList(_context.Blogspot, "Id", "Post", comment.PostId); + ViewData["ReceiverId"] = new SelectList(_context.BlogSpot, "Id", "Post", comment.ReceiverId); return View(comment); } diff --git a/src/Yavsc/Controllers/Consent/ConsentController.cs b/src/Yavsc/Controllers/Consent/ConsentController.cs index e597380f..15c4a93b 100644 --- a/src/Yavsc/Controllers/Consent/ConsentController.cs +++ b/src/Yavsc/Controllers/Consent/ConsentController.cs @@ -2,16 +2,16 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Events; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Extensions; +using IdentityServer8.Events; +using IdentityServer8.Models; +using IdentityServer8.Services; +using IdentityServer8.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Validation; +using IdentityServer8.Validation; using System.Collections.Generic; using System; using Yavsc; @@ -122,7 +122,7 @@ namespace IdentityServerHost.Quickstart.UI var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != IdentityServer8.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -210,7 +210,7 @@ namespace IdentityServerHost.Quickstart.UI } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer8.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -253,7 +253,7 @@ namespace IdentityServerHost.Quickstart.UI { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = IdentityServer8.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/src/Yavsc/Controllers/Consent/ProcessConsentResult.cs b/src/Yavsc/Controllers/Consent/ProcessConsentResult.cs index 1d331df0..179d00c4 100644 --- a/src/Yavsc/Controllers/Consent/ProcessConsentResult.cs +++ b/src/Yavsc/Controllers/Consent/ProcessConsentResult.cs @@ -2,7 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Models; +using IdentityServer8.Models; namespace IdentityServerHost.Quickstart.UI { diff --git a/src/Yavsc/Controllers/Contracting/CommandController.cs b/src/Yavsc/Controllers/Contracting/CommandController.cs index 270eac7e..5332a64e 100644 --- a/src/Yavsc/Controllers/Contracting/CommandController.cs +++ b/src/Yavsc/Controllers/Contracting/CommandController.cs @@ -35,7 +35,7 @@ namespace Yavsc.Controllers IYavscMessageSender messageSender, UserManager userManager, ICalendarManager calendarManager, - IStringLocalizer localizer, + IStringLocalizer localizer, ITrueEmailSender emailSender, IOptions smtpSettings, IOptions siteSettings, diff --git a/src/Yavsc/Controllers/Contracting/EstimateController.cs b/src/Yavsc/Controllers/Contracting/EstimateController.cs index a9040362..b81af756 100644 --- a/src/Yavsc/Controllers/Contracting/EstimateController.cs +++ b/src/Yavsc/Controllers/Contracting/EstimateController.cs @@ -12,6 +12,7 @@ namespace Yavsc.Controllers using Models.Billing; using Models.Workflow; using ViewModels.Auth; + using Yavsc.Server.Helpers; [Authorize] public class EstimateController : Controller @@ -87,7 +88,7 @@ namespace Yavsc.Controllers // POST: Estimate/Create [HttpPost] [ValidateAntiForgeryToken] - public IActionResult Create(Estimate estimate, + public async Task Create(Estimate estimate, ICollection newGraphics, ICollection newFiles ) @@ -118,7 +119,7 @@ namespace Yavsc.Controllers foreach (var gr in newGraphics) { ContentDisposition contentDisposition = new ContentDisposition(gr.ContentDisposition); - gr.SaveAs( + await gr.SaveAsAsync( Path.Combine( Path.Combine(billsdir, estimate.Id.ToString()), contentDisposition.FileName)); @@ -126,7 +127,7 @@ namespace Yavsc.Controllers foreach (var formFile in newFiles) { ContentDisposition contentDisposition = new ContentDisposition(formFile.ContentDisposition); - formFile.SaveAs( + await formFile.SaveAsAsync( Path.Combine( Path.Combine(billsdir, estimate.Id.ToString()), contentDisposition.FileName)); diff --git a/src/Yavsc/Controllers/Contracting/FrontOfficeController.cs b/src/Yavsc/Controllers/Contracting/FrontOfficeController.cs index 55a04fb0..666fa501 100644 --- a/src/Yavsc/Controllers/Contracting/FrontOfficeController.cs +++ b/src/Yavsc/Controllers/Contracting/FrontOfficeController.cs @@ -10,6 +10,7 @@ namespace Yavsc.Controllers using Microsoft.Extensions.Localization; using Models; using ViewModels.FrontOffice; + using Yavsc.Server.Helpers; using Yavsc.Services; public class FrontOfficeController : Controller diff --git a/src/Yavsc/Controllers/Device/DeviceController.cs b/src/Yavsc/Controllers/Device/DeviceController.cs index 2e69b95a..5e0c7780 100644 --- a/src/Yavsc/Controllers/Device/DeviceController.cs +++ b/src/Yavsc/Controllers/Device/DeviceController.cs @@ -6,12 +6,12 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using IdentityServer4.Configuration; -using IdentityServer4.Events; -using IdentityServer4.Extensions; -using IdentityServer4.Models; -using IdentityServer4.Services; -using IdentityServer4.Validation; +using IdentityServer8.Configuration; +using IdentityServer8.Events; +using IdentityServer8.Extensions; +using IdentityServer8.Models; +using IdentityServer8.Services; +using IdentityServer8.Validation; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; @@ -103,7 +103,7 @@ namespace Yavsc.Controllers var scopes = model.ScopesConsented; if (ConsentOptions.EnableOfflineAccess == false) { - scopes = scopes.Where(x => x != IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess); + scopes = scopes.Where(x => x != IdentityServer8.IdentityServerConstants.StandardScopes.OfflineAccess); } grantedConsent = new ConsentResponse @@ -185,7 +185,7 @@ namespace Yavsc.Controllers } if (ConsentOptions.EnableOfflineAccess && request.ValidatedResources.Resources.OfflineAccess) { - apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); + apiScopes.Add(GetOfflineAccessScope(vm.ScopesConsented.Contains(IdentityServer8.IdentityServerConstants.StandardScopes.OfflineAccess) || model == null)); } vm.ApiScopes = apiScopes; @@ -222,7 +222,7 @@ namespace Yavsc.Controllers { return new ScopeViewModel { - Value = IdentityServer4.IdentityServerConstants.StandardScopes.OfflineAccess, + Value = IdentityServer8.IdentityServerConstants.StandardScopes.OfflineAccess, DisplayName = ConsentOptions.OfflineAccessDisplayName, Description = ConsentOptions.OfflineAccessDescription, Emphasize = true, diff --git a/src/Yavsc/Controllers/FileSystemController.cs b/src/Yavsc/Controllers/FileSystemController.cs index 36ebcb04..84579675 100644 --- a/src/Yavsc/Controllers/FileSystemController.cs +++ b/src/Yavsc/Controllers/FileSystemController.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Yavsc.Helpers; +using Yavsc.Server.Helpers; namespace Yavsc.Controllers { diff --git a/src/Yavsc/Controllers/GrantsController.cs b/src/Yavsc/Controllers/GrantsController.cs index 852f438c..225b7f5b 100644 --- a/src/Yavsc/Controllers/GrantsController.cs +++ b/src/Yavsc/Controllers/GrantsController.cs @@ -2,15 +2,15 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -using IdentityServer4.Services; -using IdentityServer4.Stores; +using IdentityServer8.Services; +using IdentityServer8.Stores; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Authorization; -using IdentityServer4.Events; -using IdentityServer4.Extensions; +using IdentityServer8.Events; +using IdentityServer8.Extensions; using Yavsc; using Yavsc.Models.Access; diff --git a/src/Yavsc/Controllers/SecurityHeadersAttribute.cs b/src/Yavsc/Controllers/SecurityHeadersAttribute.cs index a82ed1f2..db979c70 100644 --- a/src/Yavsc/Controllers/SecurityHeadersAttribute.cs +++ b/src/Yavsc/Controllers/SecurityHeadersAttribute.cs @@ -14,7 +14,8 @@ namespace Yavsc var result = context.Result; if (result is ViewResult) { - // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options +#pragma warning disable ASP0019 // Suggest using IHeaderDictionary.Append or the indexer + // https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Content-Type-Options if (!context.HttpContext.Response.Headers.ContainsKey("X-Content-Type-Options")) { context.HttpContext.Response.Headers.Add("X-Content-Type-Options", "nosniff"); @@ -48,8 +49,10 @@ namespace Yavsc var referrer_policy = "no-referrer"; if (!context.HttpContext.Response.Headers.ContainsKey("Referrer-Policy")) { - context.HttpContext.Response.Headers.Add("Referrer-Policy", referrer_policy); + context.HttpContext.Response.Headers.Add("Referrer-Policy", referrer_policy); } +#pragma warning restore ASP0019 // Suggest using IHeaderDictionary.Append or the indexer + } } } diff --git a/src/Yavsc/Controllers/Survey/BugController.cs b/src/Yavsc/Controllers/Survey/BugController.cs index ef252a23..ea31a9cb 100644 --- a/src/Yavsc/Controllers/Survey/BugController.cs +++ b/src/Yavsc/Controllers/Survey/BugController.cs @@ -27,9 +27,12 @@ namespace Yavsc.Controllers } // GET: Bug - public async Task Index() + public async Task Index(int skip = 0, int take = 25) { - return View(await _context.Bug.ToListAsync()); + if (take > 50) return BadRequest(); + ViewData["skip"]=skip; + ViewData["take"]=take; + return View(await _context.Bug.Skip(skip).Take(take).ToListAsync()); } // GET: Bug/Details/5 @@ -135,6 +138,8 @@ namespace Yavsc.Controllers return View(bug); } + + // POST: Bug/Delete/5 [HttpPost, ActionName("Delete")] [ValidateAntiForgeryToken] @@ -168,10 +173,10 @@ namespace Yavsc.Controllers [HttpPost] [ValidateAntiForgeryToken] [Authorize("AdministratorOnly")] - public async Task DeleteAllLikeConfirmed(long id) + public async Task DeleteAllLikeConfirmed(long id, int prefixLen = 25) { Bug bug = await _context.Bug.SingleAsync(m => m.Id == id); - var bugs = await _context.Bug.Where(b => b.Description == bug.Description).ToArrayAsync(); + var bugs = await _context.Bug.Where(b => b.Description.Substring(0, prefixLen) == bug.Description.Substring(0, prefixLen)).ToArrayAsync(); foreach (var btd in bugs) _context.Bug.Remove(btd); await _context.SaveChangesAsync(); diff --git a/src/Yavsc/Extensions/AppBuilderExtensions.cs b/src/Yavsc/Extensions/AppBuilderExtensions.cs deleted file mode 100644 index d04e1be7..00000000 --- a/src/Yavsc/Extensions/AppBuilderExtensions.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Http; - -namespace Yavsc.Extensions { - public static class AppBuilderExtensions { - public static IApplicationBuilder UseWhen(this IApplicationBuilder app, - Func condition, Action configuration) { - if (app == null) { - throw new ArgumentNullException(nameof(app)); - } - - if (condition == null) { - throw new ArgumentNullException(nameof(condition)); - } - - if (configuration == null) { - throw new ArgumentNullException(nameof(configuration)); - } - - var builder = app.New(); - configuration(builder); - - return app.Use(next => { - builder.Run(next); - - var branch = builder.Build(); - - return context => { - if (condition(context)) { - return branch(context); - } - - return next(context); - }; - }); - } - } -} diff --git a/src/Yavsc/Extensions/ControlerExtensions.cs b/src/Yavsc/Extensions/ControlerExtensions.cs index 0de88133..53e9b41a 100644 --- a/src/Yavsc/Extensions/ControlerExtensions.cs +++ b/src/Yavsc/Extensions/ControlerExtensions.cs @@ -1,4 +1,4 @@ -using IdentityServer4.Models; +using IdentityServer8.Models; using Microsoft.AspNetCore.Mvc; using Yavsc.Models.Access; diff --git a/src/Yavsc/Extensions/HostingExtensions.cs b/src/Yavsc/Extensions/HostingExtensions.cs index 493f84f3..d86f8259 100644 --- a/src/Yavsc/Extensions/HostingExtensions.cs +++ b/src/Yavsc/Extensions/HostingExtensions.cs @@ -1,6 +1,10 @@ +using System.Diagnostics; using System.Globalization; +using System.Security.Cryptography.X509Certificates; using Google.Apis.Util.Store; -using IdentityServer4; +using IdentityServer8; +using IdentityServer8.Services; +using IdentityServerHost.Quickstart.UI; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.DataProtection; @@ -25,325 +29,387 @@ using Yavsc.Models.Workflow; using Yavsc.Services; using Yavsc.Settings; using Yavsc.ViewModels.Auth; +using Yavsc.Server.Helpers; namespace Yavsc.Extensions; -internal static class HostingExtensions +public static class HostingExtensions { - public static IApplicationBuilder ConfigureFileServerApp(this IApplicationBuilder app, - bool enableDirectoryBrowsing = false) - { - - var userFilesDirInfo = new DirectoryInfo(Config.SiteSetup.Blog); - AbstractFileSystemHelpers.UserFilesDirName = userFilesDirInfo.FullName; - - if (!userFilesDirInfo.Exists) userFilesDirInfo.Create(); - - Config.UserFilesOptions = new FileServerOptions() - { - FileProvider = new PhysicalFileProvider(AbstractFileSystemHelpers.UserFilesDirName), - RequestPath = PathString.FromUriComponent(Constants.UserFilesPath), - EnableDirectoryBrowsing = enableDirectoryBrowsing, - }; - Config.UserFilesOptions.EnableDefaultFiles = true; - Config.UserFilesOptions.StaticFileOptions.ServeUnknownFileTypes = true; - - var avatarsDirInfo = new DirectoryInfo(Config.SiteSetup.Avatars); - if (!avatarsDirInfo.Exists) avatarsDirInfo.Create(); - Config.AvatarsDirName = avatarsDirInfo.FullName; - - Config.AvatarsOptions = new FileServerOptions() - { - FileProvider = new PhysicalFileProvider(Config.AvatarsDirName), - RequestPath = PathString.FromUriComponent(Constants.AvatarsPath), - EnableDirectoryBrowsing = enableDirectoryBrowsing - }; - - - var gitdirinfo = new DirectoryInfo(Config.SiteSetup.GitRepository); - Config.GitDirName = gitdirinfo.FullName; - if (!gitdirinfo.Exists) gitdirinfo.Create(); - Config.GitOptions = new FileServerOptions() - { - FileProvider = new PhysicalFileProvider(Config.GitDirName), - RequestPath = PathString.FromUriComponent(Constants.GitPath), - EnableDirectoryBrowsing = enableDirectoryBrowsing, - }; - Config.GitOptions.DefaultFilesOptions.DefaultFileNames.Add("index.md"); - Config.GitOptions.StaticFileOptions.ServeUnknownFileTypes = true; - - app.UseFileServer(Config.UserFilesOptions); - - app.UseFileServer(Config.AvatarsOptions); - - app.UseFileServer(Config.GitOptions); - app.UseStaticFiles(); - return app; - } - public static void ConfigureWorkflow() - { - foreach (var a in System.AppDomain.CurrentDomain.GetAssemblies()) - { - foreach (var c in a.GetTypes()) - { - if (c.IsClass && !c.IsAbstract && - c.GetInterface("ISpecializationSettings") != null) - { - Config.ProfileTypes.Add(c); - } - } - } - - foreach (var propertyInfo in typeof(ApplicationDbContext).GetProperties()) - { - foreach (var attr in propertyInfo.CustomAttributes) - { - // something like a DbSet? - if (typeof(Yavsc.Attributes.ActivitySettingsAttribute).IsAssignableFrom(attr.AttributeType)) - { - BillingService.UserSettings.Add(propertyInfo); - } - } - } - - RegisterBilling(BillingCodes.Brush, new Func - ( ( db, id) => - { - var query = db.HairCutQueries.Include(q=>q.Prestation).Include(q=>q.Regularisation).Single(q=>q.Id == id) ; - query.SelectedProfile = db.BrusherProfile.Single(b=>b.UserId == query.PerformerId); - return query; - })) ; - - RegisterBilling(BillingCodes.MBrush,new Func - ( (db, id) => db.HairMultiCutQueries.Include(q=>q.Regularisation).Single(q=>q.Id == id))); - - RegisterBilling(BillingCodes.Rdv, new Func - ( (db, id) => db.RdvQueries.Include(q=>q.Regularisation).Single(q=>q.Id == id))); - } - public static void RegisterBilling(string code, Func getter) where T : IBillable - { - BillingService.Billing.Add(code,getter) ; - BillingService.GlobalBillingMap.Add(typeof(T).Name,code); - } - - public static WebApplication ConfigureServices(this WebApplicationBuilder builder) + #region files config + public static IApplicationBuilder ConfigureFileServerApp(this IApplicationBuilder app, + bool enableDirectoryBrowsing = false) { - - var siteSection = builder.Configuration.GetSection("Site"); - var smtpSection = builder.Configuration.GetSection("Smtp"); - var paypalSection = builder.Configuration.GetSection("Authentication:PayPal"); - // OAuth2AppSettings - var googleAuthSettings = builder.Configuration.GetSection("Authentication:Google"); - - string? googleClientFile = builder.Configuration["Authentication:Google:GoogleWebClientJson"]; - string? googleServiceAccountJsonFile = builder.Configuration["Authentication:Google:GoogleServiceAccountJson"]; - if (googleClientFile != null) - { - Config.GoogleWebClientConfiguration = new ConfigurationBuilder().AddJsonFile(googleClientFile).Build(); - } + var userFilesDirInfo = new DirectoryInfo(Config.SiteSetup.Blog); + AbstractFileSystemHelpers.UserFilesDirName = userFilesDirInfo.FullName; - if (googleServiceAccountJsonFile != null) + if (!userFilesDirInfo.Exists) userFilesDirInfo.Create(); + + Config.UserFilesOptions = new FileServerOptions() + { + FileProvider = new PhysicalFileProvider(AbstractFileSystemHelpers.UserFilesDirName), + RequestPath = PathString.FromUriComponent(Constants.UserFilesPath), + EnableDirectoryBrowsing = enableDirectoryBrowsing, + }; + Config.UserFilesOptions.EnableDefaultFiles = true; + Config.UserFilesOptions.StaticFileOptions.ServeUnknownFileTypes = true; + + var avatarsDirInfo = new DirectoryInfo(Config.SiteSetup.Avatars); + if (!avatarsDirInfo.Exists) avatarsDirInfo.Create(); + Config.AvatarsDirName = avatarsDirInfo.FullName; + + Config.AvatarsOptions = new FileServerOptions() + { + FileProvider = new PhysicalFileProvider(Config.AvatarsDirName), + RequestPath = PathString.FromUriComponent(Constants.AvatarsPath), + EnableDirectoryBrowsing = enableDirectoryBrowsing + }; + + + var gitdirinfo = new DirectoryInfo(Config.SiteSetup.GitRepository); + Config.GitDirName = gitdirinfo.FullName; + if (!gitdirinfo.Exists) gitdirinfo.Create(); + Config.GitOptions = new FileServerOptions() + { + FileProvider = new PhysicalFileProvider(Config.GitDirName), + RequestPath = PathString.FromUriComponent(Constants.GitPath), + EnableDirectoryBrowsing = enableDirectoryBrowsing, + }; + Config.GitOptions.DefaultFilesOptions.DefaultFileNames.Add("index.md"); + Config.GitOptions.StaticFileOptions.ServeUnknownFileTypes = true; + + app.UseFileServer(Config.UserFilesOptions); + + app.UseFileServer(Config.AvatarsOptions); + + app.UseFileServer(Config.GitOptions); + app.UseStaticFiles(); + return app; + } + + #endregion + + public static void ConfigureWorkflow() + { + foreach (var a in System.AppDomain.CurrentDomain.GetAssemblies()) + { + foreach (var c in a.GetTypes()) { - FileInfo safile = new FileInfo(googleServiceAccountJsonFile); - Config.GServiceAccount = JsonConvert.DeserializeObject(safile.OpenText().ReadToEnd()); + if (c.IsClass && !c.IsAbstract && + c.GetInterface("ISpecializationSettings") != null) + { + Config.ProfileTypes.Add(c); + } } - string? googleClientId = builder.Configuration["Authentication:Google:ClientId"]; - string? googleClientSecret = builder.Configuration["Authentication:Google:ClientSecret"]; - var services = builder.Services; - _ = services.AddControllersWithViews() - .AddNewtonsoftJson(); - LoadGoogleConfig(builder.Configuration); - - services.Configure(siteSection); - services.Configure(smtpSection); - services.Configure(paypalSection); - services.Configure(googleAuthSettings); + } + + foreach (var propertyInfo in typeof(ApplicationDbContext).GetProperties()) + { + foreach (var attr in propertyInfo.CustomAttributes) + { + // something like a DbSet? + if (typeof(Yavsc.Attributes.ActivitySettingsAttribute).IsAssignableFrom(attr.AttributeType)) + { + BillingService.UserSettings.Add(propertyInfo); + } + } + } + + RegisterBilling(BillingCodes.Brush, new Func + ((db, id) => + { + var query = db.HairCutQueries.Include(q => q.Prestation).Include(q => q.Regularisation).Single(q => q.Id == id); + query.SelectedProfile = db.BrusherProfile.Single(b => b.UserId == query.PerformerId); + return query; + })); + + RegisterBilling(BillingCodes.MBrush, new Func + ((db, id) => db.HairMultiCutQueries.Include(q => q.Regularisation).Single(q => q.Id == id))); + + RegisterBilling(BillingCodes.Rdv, new Func + ((db, id) => db.RdvQueries.Include(q => q.Regularisation).Single(q => q.Id == id))); + } + public static void RegisterBilling(string code, Func getter) where T : IBillable + { + BillingService.Billing.Add(code, getter); + BillingService.GlobalBillingMap.Add(typeof(T).Name, code); + } + + internal static WebApplication ConfigureWebAppServices(this WebApplicationBuilder builder) + { + IServiceCollection services = LoadConfiguration(builder); + + //services.AddRazorPages(); + + + services.AddSession(); + + // TODO .AddServerSideSessionStore() + + + // Add the system clock service + _ = services.AddSingleton(); + _ = services.AddSingleton(); + _ = services.AddSingleton(); + _ = services.AddTransient(); - services.AddRazorPages(); + AddIdentityDBAndStores(builder).AddDefaultTokenProviders(); + AddIdentityServer(builder); + services.AddSignalR(o => { o.EnableDetailedErrors = true; }); + + services.AddMvc(config => + { + /* var policy = new AuthorizationPolicyBuilder() + .RequireAuthenticatedUser() + .Build(); + config.Filters.Add(new AuthorizeFilter(policy)); */ + config.Filters.Add(new ProducesAttribute("application/json")); + // config.ModelBinders.Insert(0,new MyDateTimeModelBinder()); + // config.ModelBinders.Insert(0,new MyDecimalModelBinder()); + config.EnableEndpointRouting = true; + }).AddFormatterMappings( + config => config.SetMediaTypeMappingForFormat("text/pdf", + new MediaTypeHeaderValue("text/pdf")) + ).AddFormatterMappings( + config => config.SetMediaTypeMappingForFormat("text/x-tex", + new MediaTypeHeaderValue("text/x-tex")) + ) + .AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix, + options => + { + options.ResourcesPath = "Resources"; + }).AddDataAnnotationsLocalization(); + services.AddTransient() + .AddTransient() + .AddTransient() + .AddTransient() + .AddTransient((sp) => new FileDataStore("googledatastore", false)) + .AddTransient(); + + // TODO for SMS: services.AddTransient(); + + _ = services.AddLocalization(options => + { + options.ResourcesPath = "Resources"; + }); + var dataDirConfig = builder.Configuration["Site:DataDir"] ?? "DataDir"; + + var dataDir = new DirectoryInfo(dataDirConfig); + // Add session related services. + + services.AddDataProtection().PersistKeysToFileSystem(dataDir); + AddYavscPolicies(services); + + services.AddSingleton(); + + + AddAuthentication(builder); + // accepts any access token issued by identity server + + return builder.Build(); + } + + public static IdentityBuilder AddIdentityDBAndStores(this WebApplicationBuilder builder) + { + IServiceCollection services = builder.Services; services.AddDbContext(options => - options.UseNpgsql(builder.Configuration.GetConnectionString("Default"))); + options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"))); - services.AddIdentity() - .AddEntityFrameworkStores() - .AddDefaultTokenProviders(); - - - - services.AddIdentityServer(options => - { - options.Events.RaiseErrorEvents = true; - options.Events.RaiseInformationEvents = true; - options.Events.RaiseFailureEvents = true; - options.Events.RaiseSuccessEvents = true; - - // see https://docs.duendesoftware.com/identityserver/v6/fundamentals/resources/ - options.EmitStaticAudienceClaim = true; - }) - .AddInMemoryIdentityResources(Config.IdentityResources) - .AddInMemoryApiScopes(Config.ApiScopes) - .AddInMemoryClients(Config.Clients) - .AddAspNetIdentity() - ; - services.AddSession(); - - - // TODO .AddServerSideSessionStore() + return services.AddIdentity() + .AddEntityFrameworkStores(); - - services.AddAuthentication() - .AddGoogle(options => - { - options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme; + } - // register your IdentityServer with Google at https://console.developers.google.com - // enable the Google+ API - // set the redirect URI to https://localhost:5001/signin-google - options.ClientId = googleClientId; - options.ClientSecret = googleClientSecret; + private static void AddYavscPolicies(IServiceCollection services) + { + services.AddAuthorization(options => + { + options.AddPolicy("ApiScope", policy => + { + policy.RequireAuthenticatedUser() + .RequireClaim("scope", "scope2"); }); - services.Configure(options => + options.AddPolicy("Performer", policy => + { + policy + .RequireAuthenticatedUser() + .RequireClaim("http://schemas.microsoft.com/ws/2008/06/identity/claims/role", "Performer"); + }); + options.AddPolicy("AdministratorOnly", policy => + { + _ = policy.RequireClaim("http://schemas.microsoft.com/ws/2008/06/identity/claims/role", Constants.AdminGroupName); + }); + + options.AddPolicy("FrontOffice", policy => policy.RequireRole(Constants.FrontOfficeGroupName)); + + // options.AddPolicy("EmployeeId", policy => policy.RequireClaim("EmployeeId", "123", "456")); + // options.AddPolicy("BuildingEntry", policy => policy.Requirements.Add(new OfficeEntryRequirement())); + options.AddPolicy("Authenticated", policy => policy.RequireAuthenticatedUser()); + options.AddPolicy("IsTheAuthor", policy => policy.Requirements.Add(new EditPermission())); + }) + .AddCors(options => + { + options.AddPolicy("default", builder => + { + _ = builder.WithOrigins("*") + .AllowAnyHeader() + .AllowAnyMethod(); + }); + + }); + } + + public static IServiceCollection LoadConfiguration(this WebApplicationBuilder builder) + { + var siteSection = builder.Configuration.GetSection("Site"); + var smtpSection = builder.Configuration.GetSection("Smtp"); + var paypalSection = builder.Configuration.GetSection("Authentication:PayPal"); + // OAuth2AppSettings + var googleAuthSettings = builder.Configuration.GetSection("Authentication:Google"); + + string? googleClientFile = builder.Configuration["Authentication:Google:GoogleWebClientJson"]; + string? googleServiceAccountJsonFile = builder.Configuration["Authentication:Google:GoogleServiceAccountJson"]; + if (googleClientFile != null) + { + Config.GoogleWebClientConfiguration = new ConfigurationBuilder().AddJsonFile(googleClientFile).Build(); + } + + if (googleServiceAccountJsonFile != null) + { + FileInfo safile = new FileInfo(googleServiceAccountJsonFile); + Config.GServiceAccount = JsonConvert.DeserializeObject(safile.OpenText().ReadToEnd()); + } + var services = builder.Services; + _ = services.AddControllersWithViews() + .AddNewtonsoftJson(); + LoadGoogleConfig(builder.Configuration); + + services.Configure(siteSection); + services.Configure(smtpSection); + services.Configure(paypalSection); + services.Configure(googleAuthSettings); + ConfigureRequestLocalization(services); + + return services; + } + + private static void AddAuthentication(WebApplicationBuilder builder) + { + IServiceCollection services=builder.Services; + IConfigurationRoot configurationRoot=builder.Configuration; + string? googleClientId = configurationRoot["Authentication:Google:ClientId"]; + string? googleClientSecret = configurationRoot["Authentication:Google:ClientSecret"]; + + var authenticationBuilder = services.AddAuthentication(); + + if (googleClientId!=null && googleClientSecret!=null) + authenticationBuilder.AddGoogle(options => + { + options.SignInScheme = IdentityServerConstants.ExternalCookieAuthenticationScheme; + + // register your IdentityServer with Google at https://console.developers.google.com + // enable the Google+ API + // set the redirect URI to https://localhost:5001/signin-google + options.ClientId = googleClientId; + options.ClientSecret = googleClientSecret; + }); + } + private static IIdentityServerBuilder AddIdentityServer(WebApplicationBuilder builder) + { + builder.Services.AddTransient(); + var identityServerBuilder = builder.Services.AddIdentityServer(options => + { + options.Events.RaiseErrorEvents = true; + options.Events.RaiseInformationEvents = true; + options.Events.RaiseFailureEvents = true; + options.Events.RaiseSuccessEvents = true; + + // see https://IdentityServer8.readthedocs.io/en/latest/topics/resources.html + options.EmitStaticAudienceClaim = true; + }) + .AddInMemoryIdentityResources(Config.IdentityResources) + .AddInMemoryClients(Config.Clients) + .AddInMemoryApiScopes(Config.ApiScopes) + .AddAspNetIdentity() + .AddProfileService() + ; + if (builder.Environment.IsDevelopment()) + { + identityServerBuilder.AddDeveloperSigningCredential(); + } + else + { + var key = builder.Configuration["YavscSigningCert"]; + Debug.Assert(key != null); + var pfxBytes = Convert.FromBase64String(key); + var cert = new X509Certificate2(pfxBytes, (string)null, X509KeyStorageFlags.MachineKeySet); + identityServerBuilder.AddSigningCredential(cert); + } + return identityServerBuilder; + } + + private static void ConfigureRequestLocalization(IServiceCollection services) + { + services.Configure(options => + { + CultureInfo[] supportedCultures = new[] { - CultureInfo[] supportedCultures = new[] - { new CultureInfo("en"), new CultureInfo("fr"), new CultureInfo("pt") - }; + }; - CultureInfo[] supportedUICultures = new[] - { + CultureInfo[] supportedUICultures = new[] + { new CultureInfo("fr"), new CultureInfo("en"), new CultureInfo("pt") - }; + }; - // You must explicitly state which cultures your application supports. - // These are the cultures the app supports for formatting numbers, dates, etc. - options.SupportedCultures = supportedCultures; + // You must explicitly state which cultures your application supports. + // These are the cultures the app supports for formatting numbers, dates, etc. + options.SupportedCultures = supportedCultures; - // These are the cultures the app supports for UI strings, i.e. we have localized resources for. - options.SupportedUICultures = supportedUICultures; + // These are the cultures the app supports for UI strings, i.e. we have localized resources for. + options.SupportedUICultures = supportedUICultures; - options.RequestCultureProviders = new List - { + options.RequestCultureProviders = new List + { new QueryStringRequestCultureProvider { Options = options }, new CookieRequestCultureProvider { Options = options, CookieName="ASPNET_CULTURE" }, new AcceptLanguageHeaderRequestCultureProvider { Options = options } - }; - }); - - services.AddCors(options => - { - options.AddPolicy("CorsPolicy", builder => - { - _ = builder.WithOrigins("*"); - }); - }); - - - // Add the system clock service - _ = services.AddSingleton(); - - _ = services.AddSingleton(); - _ = services.AddSingleton(); - _ = services.AddTransient(); - - services.AddMvc(config => - { - /* var policy = new AuthorizationPolicyBuilder() - .RequireAuthenticatedUser() - .Build(); - config.Filters.Add(new AuthorizeFilter(policy)); */ - config.Filters.Add(new ProducesAttribute("application/json")); - // config.ModelBinders.Insert(0,new MyDateTimeModelBinder()); - // config.ModelBinders.Insert(0,new MyDecimalModelBinder()); - config.EnableEndpointRouting = true; - }).AddFormatterMappings( - config => config.SetMediaTypeMappingForFormat("text/pdf", - new MediaTypeHeaderValue("text/pdf")) - ).AddFormatterMappings( - config => config.SetMediaTypeMappingForFormat("text/x-tex", - new MediaTypeHeaderValue("text/x-tex")) - ) - .AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix, - options => - { - options.ResourcesPath = "Resources"; - }).AddDataAnnotationsLocalization(); - - - _ = services.AddTransient(); - _ = services.AddTransient(); - _ = services.AddTransient(); - _ = services.AddTransient(); - _ = services.AddTransient((sp) => new FileDataStore("googledatastore", false)); - _ = services.AddTransient(); - - - // TODO for SMS: services.AddTransient(); - - _ = services.AddLocalization(options => - { - options.ResourcesPath = "Resources"; - }); - var dataDir = new DirectoryInfo(builder.Configuration["Site:DataDir"]); - // Add session related services. - - services.AddDataProtection().PersistKeysToFileSystem(dataDir); - services.AddAuthorization(options => - { - - options.AddPolicy("AdministratorOnly", policy => - { - _ = policy.RequireClaim("http://schemas.microsoft.com/ws/2008/06/identity/claims/role", Constants.AdminGroupName); - }); - - options.AddPolicy("FrontOffice", policy => policy.RequireRole(Constants.FrontOfficeGroupName)); - options.AddPolicy("Bearer", new AuthorizationPolicyBuilder() - .AddAuthenticationSchemes("Bearer") - .RequireAuthenticatedUser().Build()); - // options.AddPolicy("EmployeeId", policy => policy.RequireClaim("EmployeeId", "123", "456")); - // options.AddPolicy("BuildingEntry", policy => policy.Requirements.Add(new OfficeEntryRequirement())); - options.AddPolicy("Authenticated", policy => policy.RequireAuthenticatedUser()); - options.AddPolicy("IsTheAuthor", policy => - policy.Requirements.Add(new EditPermission())); - }); - - services.AddSingleton(); - - - return builder.Build(); + }; + }); } - public static WebApplication ConfigurePipeline(this WebApplication app) - { - + + + internal static WebApplication ConfigurePipeline(this WebApplication app) + { + if (app.Environment.IsDevelopment()) { app.UseDeveloperExceptionPage(); } - else + else { app.UseExceptionHandler("/Home/Error"); } - + app.UseStaticFiles(); app.UseRouting(); app.UseIdentityServer(); app.UseAuthorization(); - app.MapControllerRoute( - name: "default", - pattern: "{controller=Home}/{action=Index}/{id?}"); - app.MapRazorPages() - .RequireAuthorization(); + app.UseCors("default"); + app.MapDefaultControllerRoute(); + //pp.MapRazorPages(); app.MapHub("/chatHub"); - app.MapAreaControllerRoute("api", "api", "~/api/{controller}/{action}/{id?}"); + ConfigureWorkflow(); var services = app.Services; ILoggerFactory loggerFactory = services.GetRequiredService(); @@ -353,15 +419,15 @@ internal static class HostingExtensions var googleAuthSettings = services.GetRequiredService>(); var authorizationService = services.GetRequiredService(); var localization = services.GetRequiredService>(); - Startup.Configure(app, siteSettings, smtpSettings, authorizationService, + Startup.Configure(app, siteSettings, smtpSettings, authorizationService, payPalSettings, googleAuthSettings, localization, loggerFactory, - app.Environment.EnvironmentName ); + app.Environment.EnvironmentName); app.ConfigureFileServerApp(); - + return app; } - static void LoadGoogleConfig(IConfigurationRoot configuration) + static void LoadGoogleConfig(IConfigurationRoot configuration) { string? googleClientFile = configuration["Authentication:Google:GoogleWebClientJson"]; string? googleServiceAccountJsonFile = configuration["Authentication:Google:GoogleServiceAccountJson"]; diff --git a/src/Yavsc/Extensions/HttpContextExtensions.cs b/src/Yavsc/Extensions/HttpContextExtensions.cs index 235ec277..089d124a 100644 --- a/src/Yavsc/Extensions/HttpContextExtensions.cs +++ b/src/Yavsc/Extensions/HttpContextExtensions.cs @@ -1,6 +1,6 @@ using System.Security.Claims; -using IdentityServer4; +using IdentityServer8; using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Identity; using Microsoft.EntityFrameworkCore; diff --git a/src/Yavsc/Helpers/AsciiDocHelpers.cs b/src/Yavsc/Helpers/AsciiDocHelpers.cs index 133942f1..a641960e 100644 --- a/src/Yavsc/Helpers/AsciiDocHelpers.cs +++ b/src/Yavsc/Helpers/AsciiDocHelpers.cs @@ -90,11 +90,11 @@ namespace Yavsc.Helpers case "AsciiDocNet.TextLiteral": var tl = elt as TextLiteral; - if (tl.Attributes.Anchor!=null) + if (tl?.Attributes.Anchor!=null) { sb.AppendFormat("{1} ", tl.Attributes.Anchor.Id, tl.Attributes.Anchor.XRefLabel); } - sb.Append(tl.Text); + if (tl!=null) sb.Append(tl.Text); break; case "AsciiDocNet.Emphasis": diff --git a/src/Yavsc/Helpers/UserHelpers.cs b/src/Yavsc/Helpers/UserHelpers.cs index 391cbf6c..ade8cac0 100644 --- a/src/Yavsc/Helpers/UserHelpers.cs +++ b/src/Yavsc/Helpers/UserHelpers.cs @@ -1,47 +1,10 @@ using System.Security.Claims; -using System.Collections.Generic; -using System.Linq; -using Microsoft.EntityFrameworkCore; -using Yavsc.Models; -using Yavsc.Models.Blog; namespace Yavsc.Helpers { public static class UserHelpers { - public static string GetUserId(this ClaimsPrincipal user) - { - return user.FindFirstValue("sub"); - } - public static string GetUserName(this ClaimsPrincipal user) - { - return user.FindFirstValue(ClaimTypes.Name); - } - - public static bool IsSignedIn(this ClaimsPrincipal user) - { - return user.Identity.IsAuthenticated; - } - - public static IEnumerable UserPosts(this ApplicationDbContext dbContext, string posterId, string readerId) - { - long[] readerCirclesMemberships = dbContext.Circle.Include(c=>c.Members).Where(c=>c.Members.Any(m=>m.MemberId == readerId)) - .Select(c=>c.Id).ToArray(); - var result = (readerId!=null) - ? - dbContext.Blogspot.Include( - b => b.Author - ).Include(p=>p.ACL).Where(x => x.Author.Id == posterId && - (x.Visible && - (x.ACL.Count==0 || x.ACL.Any(a=> readerCirclesMemberships.Contains(a.CircleId))))) - : - dbContext.Blogspot.Include( - b => b.Author - ).Where(x => x.Author.Id == posterId && x.Visible); - // BlogIndexKey - return result; - } } } diff --git a/src/Yavsc/Program.cs b/src/Yavsc/Program.cs index a084d833..0337fc8c 100644 --- a/src/Yavsc/Program.cs +++ b/src/Yavsc/Program.cs @@ -15,7 +15,7 @@ namespace Yavsc .AddJsonFile($"appsettings.{builder.Environment.EnvironmentName}.json", optional: true) .AddEnvironmentVariables() .Build(); - var app = builder.ConfigureServices().ConfigurePipeline(); + var app = builder.ConfigureWebAppServices().ConfigurePipeline(); app.UseSession(); app.Run(); } diff --git a/src/Yavsc/Properties/launchSettings.json b/src/Yavsc/Properties/launchSettings.json index c7aa64d5..a78ff8ae 100644 --- a/src/Yavsc/Properties/launchSettings.json +++ b/src/Yavsc/Properties/launchSettings.json @@ -1,27 +1,19 @@ -{ +{ + "$schema": "http://json.schemastore.org/launchsettings.json", "iisSettings": { "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:30089", - "sslPort": 44391 + "applicationUrl": "https://localhost:5001", + "sslPort": 5001 } }, "profiles": { - "http": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "applicationUrl": "http://localhost:5172", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, "https": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, - "applicationUrl": "https://localhost:7062;http://localhost:5172", + "applicationUrl": "https://localhost:5001;", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } diff --git a/src/Yavsc/Resources/Yavsc.Resources.CommentViewComponent.Designer.cs b/src/Yavsc/Resources/Yavsc.Resources.CommentViewComponent.Designer.cs deleted file mode 100644 index f62f8775..00000000 --- a/src/Yavsc/Resources/Yavsc.Resources.CommentViewComponent.Designer.cs +++ /dev/null @@ -1,94 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Yavsc.ViewComponents { - using System; - using System.Reflection; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public partial class CommentViewComponent { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public static System.Resources.ResourceManager ResourceManager { - get { - if (object.Equals(null, resourceMan)) { - System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Resources." + "Yavsc.ViewComponents.CommentViewComponent"), typeof(CommentViewComponent).GetTypeInfo().Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public static System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - public static string apiRouteCommentBlogPost { - get { - return ResourceManager.GetString("apiRouteCommentBlogPost", resourceCulture); - } - } - - public static string CommmentId { - get { - return ResourceManager.GetString("CommmentId", resourceCulture); - } - } - - public static string Comment { - get { - return ResourceManager.GetString("Comment", resourceCulture); - } - } - - public static string LastModificationDate { - get { - return ResourceManager.GetString("LastModificationDate", resourceCulture); - } - } - - public static string CreationDate { - get { - return ResourceManager.GetString("CreationDate", resourceCulture); - } - } - - public static string PostId { - get { - return ResourceManager.GetString("PostId", resourceCulture); - } - } - - public static string UserCreated { - get { - return ResourceManager.GetString("UserCreated", resourceCulture); - } - } - - public static string UserModified { - get { - return ResourceManager.GetString("UserModified", resourceCulture); - } - } - } -} diff --git a/src/Yavsc/Resources/Yavsc.Resources.PerformerProfileViewModel.Designer.cs b/src/Yavsc/Resources/Yavsc.Resources.PerformerProfileViewModel.Designer.cs deleted file mode 100644 index 511dbf5b..00000000 --- a/src/Yavsc/Resources/Yavsc.Resources.PerformerProfileViewModel.Designer.cs +++ /dev/null @@ -1,52 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace Yavsc.ViewModels.FrontOffice { - using System; - using System.Reflection; - - - [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] - [System.Diagnostics.DebuggerNonUserCodeAttribute()] - [System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - public partial class PerformerProfileViewModel { - - private static System.Resources.ResourceManager resourceMan; - - private static System.Globalization.CultureInfo resourceCulture; - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public static System.Resources.ResourceManager ResourceManager { - get { - if (object.Equals(null, resourceMan)) { - System.Resources.ResourceManager temp = new System.Resources.ResourceManager(("Yavsc.Resources." + "Yavsc.ViewModels.FrontOffice.PerformerProfileViewModel"), typeof(PerformerProfileViewModel).GetTypeInfo().Assembly); - resourceMan = temp; - } - return resourceMan; - } - } - - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Advanced)] - public static System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - public static string PerformerIdLabel { - get { - return ResourceManager.GetString("PerformerIdLabel", resourceCulture); - } - } - } -} diff --git a/src/Yavsc/ScaffoldingReadMe.txt b/src/Yavsc/ScaffoldingReadMe.txt deleted file mode 100644 index 6e6208dc..00000000 --- a/src/Yavsc/ScaffoldingReadMe.txt +++ /dev/null @@ -1,3 +0,0 @@ -Support for ASP.NET Core Identity was added to your project. - -For setup and configuration information, see https://go.microsoft.com/fwlink/?linkid=2116645. diff --git a/src/Yavsc/Services/YavscMessageSender.cs b/src/Yavsc/Services/YavscMessageSender.cs index cf5031e0..d1cdfa6d 100644 --- a/src/Yavsc/Services/YavscMessageSender.cs +++ b/src/Yavsc/Services/YavscMessageSender.cs @@ -1,5 +1,5 @@ -using Microsoft.AspNetCore.Identity.UI.Services; -using Microsoft.AspNetCore.SignalR; +using Microsoft.AspNetCore.SignalR; +using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Newtonsoft.Json; using Yavsc.Interface; diff --git a/src/Yavsc/Startup.cs b/src/Yavsc/Startup.cs index 1625debf..93cf5dcf 100644 --- a/src/Yavsc/Startup.cs +++ b/src/Yavsc/Startup.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; using Yavsc.Helpers; +using Yavsc.Server.Helpers; using Yavsc.Settings; namespace Yavsc; diff --git a/src/Yavsc/ViewComponents/BillViewComponent.cs b/src/Yavsc/ViewComponents/BillViewComponent.cs index 4f7c3fc5..d0d0b9fe 100644 --- a/src/Yavsc/ViewComponents/BillViewComponent.cs +++ b/src/Yavsc/ViewComponents/BillViewComponent.cs @@ -8,6 +8,7 @@ using Yavsc.ViewModels; using Yavsc.ViewModels.Gen; using Yavsc.Services; using Microsoft.EntityFrameworkCore; +using Yavsc.Server.Helpers; namespace Yavsc.ViewComponents { diff --git a/src/Yavsc/ViewComponents/BlogIndexViewComponent.cs b/src/Yavsc/ViewComponents/BlogIndexViewComponent.cs index 1ad9f12a..e38ad975 100644 --- a/src/Yavsc/ViewComponents/BlogIndexViewComponent.cs +++ b/src/Yavsc/ViewComponents/BlogIndexViewComponent.cs @@ -24,7 +24,7 @@ namespace Yavsc.ViewComponents Where(c=>c.Members.Any(m=>m.MemberId == viewerId)) .Select(c=>c.Id).ToArrayAsync(); - var allposts = _context.Blogspot + var allposts = _context.BlogSpot .Include(b => b.Author) .Include(p=>p.ACL) .Include(p=>p.Tags) diff --git a/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs b/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs index 4eb18add..eacca699 100644 --- a/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs +++ b/src/Yavsc/ViewComponents/CirclesControlViewComponent.cs @@ -22,7 +22,7 @@ namespace Yavsc.ViewComponents { if (target!=null) { - var oid = target.GetOwnerId(); + var oid = target.OwnerId; ViewBag.ACL = dbContext.Circle.Where( c=>c.OwnerId == oid) .Select( diff --git a/src/Yavsc/ViewComponents/CommentViewComponent.cs b/src/Yavsc/ViewComponents/CommentViewComponent.cs index 619811cb..17fc0fd7 100644 --- a/src/Yavsc/ViewComponents/CommentViewComponent.cs +++ b/src/Yavsc/ViewComponents/CommentViewComponent.cs @@ -1,21 +1,35 @@ +using System.Diagnostics; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Localization; +using Yavsc.Models; using Yavsc.Models.Blog; namespace Yavsc.ViewComponents { - public partial class CommentViewComponent : ViewComponent + public class CommentViewComponent : ViewComponent { + private readonly ApplicationDbContext context; private readonly IStringLocalizer localizer; - public CommentViewComponent(IStringLocalizer localizer) + public CommentViewComponent(IStringLocalizer localizer, + ApplicationDbContext context + ) { + this.context = context; this.localizer = localizer; } - public IViewComponentResult Invoke(IIdentified longCommentable) + public async Task InvokeAsync(long id) { - // for a BlogPost, it results in the localization 'apiRouteCommentBlogPost': blogcomments - ViewData["apictlr"] = "/api/"+localizer["apiRouteComment"+longCommentable.GetType().Name]; - return View(longCommentable.GetType().Name, new Comment{ PostId = longCommentable.Id }); + var comment = await context.Comment.Include(c=>c.Children).FirstOrDefaultAsync(c => c.Id==id); + if (comment == null) + throw new InvalidOperationException(); + ViewData["apictlr"] = "/api/blogcomments"; + return View("Default", comment); + } + + private string GetDebuggerDisplay() + { + return ToString(); } } } diff --git a/src/Yavsc/ViewComponents/DirectoryViewComponent.cs b/src/Yavsc/ViewComponents/DirectoryViewComponent.cs index b5f5b902..af7f436b 100644 --- a/src/Yavsc/ViewComponents/DirectoryViewComponent.cs +++ b/src/Yavsc/ViewComponents/DirectoryViewComponent.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc; using System.Threading.Tasks; using Yavsc.Helpers; using Yavsc.Models; +using Yavsc.Server.Helpers; using Yavsc.ViewModels.UserFiles; namespace Yavsc.ViewComponents diff --git a/src/Yavsc/Views/Blogspot/Delete.cshtml b/src/Yavsc/Views/Blogspot/Delete.cshtml index 7ebffe0b..dfbdc335 100644 --- a/src/Yavsc/Views/Blogspot/Delete.cshtml +++ b/src/Yavsc/Views/Blogspot/Delete.cshtml @@ -41,12 +41,6 @@
@Html.DisplayFor(model => model.DateCreated)
-
- @Html.DisplayNameFor(model => model.Rate) -
-
- @Html.DisplayFor(model => model.Rate) -
@Html.DisplayNameFor(model => model.Title)
diff --git a/src/Yavsc/Views/Blogspot/Details.cshtml b/src/Yavsc/Views/Blogspot/Details.cshtml index 64471a1e..4d884a29 100644 --- a/src/Yavsc/Views/Blogspot/Details.cshtml +++ b/src/Yavsc/Views/Blogspot/Details.cshtml @@ -2,55 +2,50 @@ @{ ViewData["Title"]=Model.Title; } -@section header { +@section scripts { + + } @section scripts{ - + } @@ -34,7 +35,7 @@ ", that.document[ 0 ] ).appendTo( element ) + ); + } else if ( nodeName === "tr" ) { + that._createTrPlaceholder( that.currentItem, element ); + } else if ( nodeName === "img" ) { + element.attr( "src", that.currentItem.attr( "src" ) ); + } + + if ( !className ) { + element.css( "visibility", "hidden" ); + } + + return element; + }, + update: function( container, p ) { + + // 1. If a className is set as 'placeholder option, we don't force sizes - + // the class is responsible for that + // 2. The option 'forcePlaceholderSize can be enabled to force it even if a + // class name is specified + if ( className && !o.forcePlaceholderSize ) { + return; + } + + // If the element doesn't have a actual height or width by itself (without + // styles coming from a stylesheet), it receives the inline height and width + // from the dragged item. Or, if it's a tbody or tr, it's going to have a height + // anyway since we're populating them with ", that.document[ 0 ] ) + .attr( "colspan", $( this ).attr( "colspan" ) || 1 ) + .appendTo( targetTr ); + } ); + }, + + _contactContainers: function( event ) { + var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, cur, nearBottom, + floating, axis, + innermostContainer = null, + innermostIndex = null; + + // Get innermost container that intersects with item + for ( i = this.containers.length - 1; i >= 0; i-- ) { + + // Never consider a container that's located within the item itself + if ( $.contains( this.currentItem[ 0 ], this.containers[ i ].element[ 0 ] ) ) { + continue; + } + + if ( this._intersectsWith( this.containers[ i ].containerCache ) ) { + + // If we've already found a container and it's more "inner" than this, then continue + if ( innermostContainer && + $.contains( + this.containers[ i ].element[ 0 ], + innermostContainer.element[ 0 ] ) ) { + continue; + } + + innermostContainer = this.containers[ i ]; + innermostIndex = i; + + } else { + + // container doesn't intersect. trigger "out" event if necessary + if ( this.containers[ i ].containerCache.over ) { + this.containers[ i ]._trigger( "out", event, this._uiHash( this ) ); + this.containers[ i ].containerCache.over = 0; + } + } + + } + + // If no intersecting containers found, return + if ( !innermostContainer ) { + return; + } + + // Move the item into the container if it's not there already + if ( this.containers.length === 1 ) { + if ( !this.containers[ innermostIndex ].containerCache.over ) { + this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); + this.containers[ innermostIndex ].containerCache.over = 1; + } + } else { + + // When entering a new container, we will find the item with the least distance and + // append our item near it + dist = 10000; + itemWithLeastDistance = null; + floating = innermostContainer.floating || this._isFloating( this.currentItem ); + posProperty = floating ? "left" : "top"; + sizeProperty = floating ? "width" : "height"; + axis = floating ? "pageX" : "pageY"; + + for ( j = this.items.length - 1; j >= 0; j-- ) { + if ( !$.contains( + this.containers[ innermostIndex ].element[ 0 ], this.items[ j ].item[ 0 ] ) + ) { + continue; + } + if ( this.items[ j ].item[ 0 ] === this.currentItem[ 0 ] ) { + continue; + } + + cur = this.items[ j ].item.offset()[ posProperty ]; + nearBottom = false; + if ( event[ axis ] - cur > this.items[ j ][ sizeProperty ] / 2 ) { + nearBottom = true; + } + + if ( Math.abs( event[ axis ] - cur ) < dist ) { + dist = Math.abs( event[ axis ] - cur ); + itemWithLeastDistance = this.items[ j ]; + this.direction = nearBottom ? "up" : "down"; + } + } + + //Check if dropOnEmpty is enabled + if ( !itemWithLeastDistance && !this.options.dropOnEmpty ) { + return; + } + + if ( this.currentContainer === this.containers[ innermostIndex ] ) { + if ( !this.currentContainer.containerCache.over ) { + this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash() ); + this.currentContainer.containerCache.over = 1; + } + return; + } + + if ( itemWithLeastDistance ) { + this._rearrange( event, itemWithLeastDistance, null, true ); + } else { + this._rearrange( event, null, this.containers[ innermostIndex ].element, true ); + } + this._trigger( "change", event, this._uiHash() ); + this.containers[ innermostIndex ]._trigger( "change", event, this._uiHash( this ) ); + this.currentContainer = this.containers[ innermostIndex ]; + + //Update the placeholder + this.options.placeholder.update( this.currentContainer, this.placeholder ); + + //Update scrollParent + this.scrollParent = this.placeholder.scrollParent(); + + //Update overflowOffset + if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && + this.scrollParent[ 0 ].tagName !== "HTML" ) { + this.overflowOffset = this.scrollParent.offset(); + } + + this.containers[ innermostIndex ]._trigger( "over", event, this._uiHash( this ) ); + this.containers[ innermostIndex ].containerCache.over = 1; + } + + }, + + _createHelper: function( event ) { + + var o = this.options, + helper = typeof o.helper === "function" ? + $( o.helper.apply( this.element[ 0 ], [ event, this.currentItem ] ) ) : + ( o.helper === "clone" ? this.currentItem.clone() : this.currentItem ); + + //Add the helper to the DOM if that didn't happen already + if ( !helper.parents( "body" ).length ) { + this.appendTo[ 0 ].appendChild( helper[ 0 ] ); + } + + if ( helper[ 0 ] === this.currentItem[ 0 ] ) { + this._storedCSS = { + width: this.currentItem[ 0 ].style.width, + height: this.currentItem[ 0 ].style.height, + position: this.currentItem.css( "position" ), + top: this.currentItem.css( "top" ), + left: this.currentItem.css( "left" ) + }; + } + + if ( !helper[ 0 ].style.width || o.forceHelperSize ) { + helper.width( this.currentItem.width() ); + } + if ( !helper[ 0 ].style.height || o.forceHelperSize ) { + helper.height( this.currentItem.height() ); + } + + return helper; + + }, + + _adjustOffsetFromHelper: function( obj ) { + if ( typeof obj === "string" ) { + obj = obj.split( " " ); + } + if ( Array.isArray( obj ) ) { + obj = { left: +obj[ 0 ], top: +obj[ 1 ] || 0 }; + } + if ( "left" in obj ) { + this.offset.click.left = obj.left + this.margins.left; + } + if ( "right" in obj ) { + this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left; + } + if ( "top" in obj ) { + this.offset.click.top = obj.top + this.margins.top; + } + if ( "bottom" in obj ) { + this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top; + } + }, + + _getParentOffset: function() { + + //Get the offsetParent and cache its position + this.offsetParent = this.helper.offsetParent(); + var po = this.offsetParent.offset(); + + // This is a special case where we need to modify a offset calculated on start, since the + // following happened: + // 1. The position of the helper is absolute, so it's position is calculated based on the + // next positioned parent + // 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't + // the document, which means that the scroll is included in the initial calculation of the + // offset of the parent, and never recalculated upon drag + if ( this.cssPosition === "absolute" && this.scrollParent[ 0 ] !== this.document[ 0 ] && + $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) { + po.left += this.scrollParent.scrollLeft(); + po.top += this.scrollParent.scrollTop(); + } + + // This needs to be actually done for all browsers, since pageX/pageY includes + // this information. + if ( this.offsetParent[ 0 ] === this.document[ 0 ].body ) { + po = { top: 0, left: 0 }; + } + + return { + top: po.top + ( parseInt( this.offsetParent.css( "borderTopWidth" ), 10 ) || 0 ), + left: po.left + ( parseInt( this.offsetParent.css( "borderLeftWidth" ), 10 ) || 0 ) + }; + + }, + + _getRelativeOffset: function() { + + if ( this.cssPosition === "relative" ) { + var p = this.currentItem.position(); + return { + top: p.top - ( parseInt( this.helper.css( "top" ), 10 ) || 0 ) + + this.scrollParent.scrollTop(), + left: p.left - ( parseInt( this.helper.css( "left" ), 10 ) || 0 ) + + this.scrollParent.scrollLeft() + }; + } else { + return { top: 0, left: 0 }; + } + + }, + + _cacheMargins: function() { + this.margins = { + left: ( parseInt( this.currentItem.css( "marginLeft" ), 10 ) || 0 ), + top: ( parseInt( this.currentItem.css( "marginTop" ), 10 ) || 0 ) + }; + }, + + _cacheHelperProportions: function() { + this.helperProportions = { + width: this.helper.outerWidth(), + height: this.helper.outerHeight() + }; + }, + + _setContainment: function() { + + var ce, co, over, + o = this.options; + if ( o.containment === "parent" ) { + o.containment = this.helper[ 0 ].parentNode; + } + if ( o.containment === "document" || o.containment === "window" ) { + this.containment = [ + 0 - this.offset.relative.left - this.offset.parent.left, + 0 - this.offset.relative.top - this.offset.parent.top, + o.containment === "document" ? + this.document.width() : + this.window.width() - this.helperProportions.width - this.margins.left, + ( o.containment === "document" ? + ( this.document.height() || document.body.parentNode.scrollHeight ) : + this.window.height() || this.document[ 0 ].body.parentNode.scrollHeight + ) - this.helperProportions.height - this.margins.top + ]; + } + + if ( !( /^(document|window|parent)$/ ).test( o.containment ) ) { + ce = $( o.containment )[ 0 ]; + co = $( o.containment ).offset(); + over = ( $( ce ).css( "overflow" ) !== "hidden" ); + + this.containment = [ + co.left + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) + + ( parseInt( $( ce ).css( "paddingLeft" ), 10 ) || 0 ) - this.margins.left, + co.top + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) + + ( parseInt( $( ce ).css( "paddingTop" ), 10 ) || 0 ) - this.margins.top, + co.left + ( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - + ( parseInt( $( ce ).css( "borderLeftWidth" ), 10 ) || 0 ) - + ( parseInt( $( ce ).css( "paddingRight" ), 10 ) || 0 ) - + this.helperProportions.width - this.margins.left, + co.top + ( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - + ( parseInt( $( ce ).css( "borderTopWidth" ), 10 ) || 0 ) - + ( parseInt( $( ce ).css( "paddingBottom" ), 10 ) || 0 ) - + this.helperProportions.height - this.margins.top + ]; + } + + }, + + _convertPositionTo: function( d, pos ) { + + if ( !pos ) { + pos = this.position; + } + var mod = d === "absolute" ? 1 : -1, + scroll = this.cssPosition === "absolute" && + !( this.scrollParent[ 0 ] !== this.document[ 0 ] && + $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? + this.offsetParent : + this.scrollParent, + scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); + + return { + top: ( + + // The absolute mouse position + pos.top + + + // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.relative.top * mod + + + // The offsetParent's offset without borders (offset + border) + this.offset.parent.top * mod - + ( ( this.cssPosition === "fixed" ? + -this.scrollParent.scrollTop() : + ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod ) + ), + left: ( + + // The absolute mouse position + pos.left + + + // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.relative.left * mod + + + // The offsetParent's offset without borders (offset + border) + this.offset.parent.left * mod - + ( ( this.cssPosition === "fixed" ? + -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : + scroll.scrollLeft() ) * mod ) + ) + }; + + }, + + _generatePosition: function( event ) { + + var top, left, + o = this.options, + pageX = event.pageX, + pageY = event.pageY, + scroll = this.cssPosition === "absolute" && + !( this.scrollParent[ 0 ] !== this.document[ 0 ] && + $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? + this.offsetParent : + this.scrollParent, + scrollIsRootNode = ( /(html|body)/i ).test( scroll[ 0 ].tagName ); + + // This is another very weird special case that only happens for relative elements: + // 1. If the css position is relative + // 2. and the scroll parent is the document or similar to the offset parent + // we have to refresh the relative offset during the scroll so there are no jumps + if ( this.cssPosition === "relative" && !( this.scrollParent[ 0 ] !== this.document[ 0 ] && + this.scrollParent[ 0 ] !== this.offsetParent[ 0 ] ) ) { + this.offset.relative = this._getRelativeOffset(); + } + + /* + * - Position constraining - + * Constrain the position to a mix of grid, containment. + */ + + if ( this.originalPosition ) { //If we are not dragging yet, we won't check for options + + if ( this.containment ) { + if ( event.pageX - this.offset.click.left < this.containment[ 0 ] ) { + pageX = this.containment[ 0 ] + this.offset.click.left; + } + if ( event.pageY - this.offset.click.top < this.containment[ 1 ] ) { + pageY = this.containment[ 1 ] + this.offset.click.top; + } + if ( event.pageX - this.offset.click.left > this.containment[ 2 ] ) { + pageX = this.containment[ 2 ] + this.offset.click.left; + } + if ( event.pageY - this.offset.click.top > this.containment[ 3 ] ) { + pageY = this.containment[ 3 ] + this.offset.click.top; + } + } + + if ( o.grid ) { + top = this.originalPageY + Math.round( ( pageY - this.originalPageY ) / + o.grid[ 1 ] ) * o.grid[ 1 ]; + pageY = this.containment ? + ( ( top - this.offset.click.top >= this.containment[ 1 ] && + top - this.offset.click.top <= this.containment[ 3 ] ) ? + top : + ( ( top - this.offset.click.top >= this.containment[ 1 ] ) ? + top - o.grid[ 1 ] : top + o.grid[ 1 ] ) ) : + top; + + left = this.originalPageX + Math.round( ( pageX - this.originalPageX ) / + o.grid[ 0 ] ) * o.grid[ 0 ]; + pageX = this.containment ? + ( ( left - this.offset.click.left >= this.containment[ 0 ] && + left - this.offset.click.left <= this.containment[ 2 ] ) ? + left : + ( ( left - this.offset.click.left >= this.containment[ 0 ] ) ? + left - o.grid[ 0 ] : left + o.grid[ 0 ] ) ) : + left; + } + + } + + return { + top: ( + + // The absolute mouse position + pageY - + + // Click offset (relative to the element) + this.offset.click.top - + + // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.relative.top - + + // The offsetParent's offset without borders (offset + border) + this.offset.parent.top + + ( ( this.cssPosition === "fixed" ? + -this.scrollParent.scrollTop() : + ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) ) + ), + left: ( + + // The absolute mouse position + pageX - + + // Click offset (relative to the element) + this.offset.click.left - + + // Only for relative positioned nodes: Relative offset from element to offset parent + this.offset.relative.left - + + // The offsetParent's offset without borders (offset + border) + this.offset.parent.left + + ( ( this.cssPosition === "fixed" ? + -this.scrollParent.scrollLeft() : + scrollIsRootNode ? 0 : scroll.scrollLeft() ) ) + ) + }; + + }, + + _rearrange: function( event, i, a, hardRefresh ) { + + if ( a ) { + a[ 0 ].appendChild( this.placeholder[ 0 ] ); + } else { + i.item[ 0 ].parentNode.insertBefore( this.placeholder[ 0 ], + ( this.direction === "down" ? i.item[ 0 ] : i.item[ 0 ].nextSibling ) ); + } + + //Various things done here to improve the performance: + // 1. we create a setTimeout, that calls refreshPositions + // 2. on the instance, we have a counter variable, that get's higher after every append + // 3. on the local scope, we copy the counter variable, and check in the timeout, + // if it's still the same + // 4. this lets only the last addition to the timeout stack through + this.counter = this.counter ? ++this.counter : 1; + var counter = this.counter; + + this._delay( function() { + if ( counter === this.counter ) { + + //Precompute after each DOM insertion, NOT on mousemove + this.refreshPositions( !hardRefresh ); + } + } ); + + }, + + _clear: function( event, noPropagation ) { + + this.reverting = false; + + // We delay all events that have to be triggered to after the point where the placeholder + // has been removed and everything else normalized again + var i, + delayedTriggers = []; + + // We first have to update the dom position of the actual currentItem + // Note: don't do it if the current item is already removed (by a user), or it gets + // reappended (see #4088) + if ( !this._noFinalSort && this.currentItem.parent().length ) { + this.placeholder.before( this.currentItem ); + } + this._noFinalSort = null; + + if ( this.helper[ 0 ] === this.currentItem[ 0 ] ) { + for ( i in this._storedCSS ) { + if ( this._storedCSS[ i ] === "auto" || this._storedCSS[ i ] === "static" ) { + this._storedCSS[ i ] = ""; + } + } + this.currentItem.css( this._storedCSS ); + this._removeClass( this.currentItem, "ui-sortable-helper" ); + } else { + this.currentItem.show(); + } + + if ( this.fromOutside && !noPropagation ) { + delayedTriggers.push( function( event ) { + this._trigger( "receive", event, this._uiHash( this.fromOutside ) ); + } ); + } + if ( ( this.fromOutside || + this.domPosition.prev !== + this.currentItem.prev().not( ".ui-sortable-helper" )[ 0 ] || + this.domPosition.parent !== this.currentItem.parent()[ 0 ] ) && !noPropagation ) { + + // Trigger update callback if the DOM position has changed + delayedTriggers.push( function( event ) { + this._trigger( "update", event, this._uiHash() ); + } ); + } + + // Check if the items Container has Changed and trigger appropriate + // events. + if ( this !== this.currentContainer ) { + if ( !noPropagation ) { + delayedTriggers.push( function( event ) { + this._trigger( "remove", event, this._uiHash() ); + } ); + delayedTriggers.push( ( function( c ) { + return function( event ) { + c._trigger( "receive", event, this._uiHash( this ) ); + }; + } ).call( this, this.currentContainer ) ); + delayedTriggers.push( ( function( c ) { + return function( event ) { + c._trigger( "update", event, this._uiHash( this ) ); + }; + } ).call( this, this.currentContainer ) ); + } + } + + //Post events to containers + function delayEvent( type, instance, container ) { + return function( event ) { + container._trigger( type, event, instance._uiHash( instance ) ); + }; + } + for ( i = this.containers.length - 1; i >= 0; i-- ) { + if ( !noPropagation ) { + delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); + } + if ( this.containers[ i ].containerCache.over ) { + delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); + this.containers[ i ].containerCache.over = 0; + } + } + + //Do what was originally in plugins + if ( this._storedStylesheet ) { + this._storedStylesheet.remove(); + this._storedStylesheet = null; + } + if ( this._storedOpacity ) { + this.helper.css( "opacity", this._storedOpacity ); + } + if ( this._storedZIndex ) { + this.helper.css( "zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex ); + } + + this.dragging = false; + + if ( !noPropagation ) { + this._trigger( "beforeStop", event, this._uiHash() ); + } + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, + // it unbinds ALL events from the original node! + this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); + + if ( !this.cancelHelperRemoval ) { + if ( this.helper[ 0 ] !== this.currentItem[ 0 ] ) { + this.helper.remove(); + } + this.helper = null; + } + + if ( !noPropagation ) { + for ( i = 0; i < delayedTriggers.length; i++ ) { + + // Trigger all delayed events + delayedTriggers[ i ].call( this, event ); + } + this._trigger( "stop", event, this._uiHash() ); + } + + this.fromOutside = false; + return !this.cancelHelperRemoval; + + }, + + _trigger: function() { + if ( $.Widget.prototype._trigger.apply( this, arguments ) === false ) { + this.cancel(); + } + }, + + _uiHash: function( _inst ) { + var inst = _inst || this; + return { + helper: inst.helper, + placeholder: inst.placeholder || $( [] ), + position: inst.position, + originalPosition: inst.originalPosition, + offset: inst.positionAbs, + item: inst.currentItem, + sender: _inst ? _inst.element : null + }; + } + +} ); + + +/*! + * jQuery UI Accordion 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Accordion +//>>group: Widgets +/* eslint-disable max-len */ +//>>description: Displays collapsible content panels for presenting information in a limited amount of space. +/* eslint-enable max-len */ +//>>docs: https://api.jqueryui.com/accordion/ +//>>demos: https://jqueryui.com/accordion/ +//>>css.structure: ../../themes/base/core.css +//>>css.structure: ../../themes/base/accordion.css +//>>css.theme: ../../themes/base/theme.css + + +var widgetsAccordion = $.widget( "ui.accordion", { + version: "1.14.1", + options: { + active: 0, + animate: {}, + classes: { + "ui-accordion-header": "ui-corner-top", + "ui-accordion-header-collapsed": "ui-corner-all", + "ui-accordion-content": "ui-corner-bottom" + }, + collapsible: false, + event: "click", + header: function( elem ) { + return elem + .find( "> li > :first-child" ) + .add( + elem.find( "> :not(li)" ) + + // Support: jQuery <3.5 only + // We could use `.even()` but that's unavailable in older jQuery. + .filter( function( i ) { + return i % 2 === 0; + } ) + ); + }, + heightStyle: "auto", + icons: { + activeHeader: "ui-icon-triangle-1-s", + header: "ui-icon-triangle-1-e" + }, + + // Callbacks + activate: null, + beforeActivate: null + }, + + hideProps: { + borderTopWidth: "hide", + borderBottomWidth: "hide", + paddingTop: "hide", + paddingBottom: "hide", + height: "hide" + }, + + showProps: { + borderTopWidth: "show", + borderBottomWidth: "show", + paddingTop: "show", + paddingBottom: "show", + height: "show" + }, + + _create: function() { + var options = this.options; + + this.prevShow = this.prevHide = $(); + this._addClass( "ui-accordion", "ui-widget ui-helper-reset" ); + this.element.attr( "role", "tablist" ); + + // Don't allow collapsible: false and active: false / null + if ( !options.collapsible && ( options.active === false || options.active == null ) ) { + options.active = 0; + } + + this._processPanels(); + + // handle negative values + if ( options.active < 0 ) { + options.active += this.headers.length; + } + this._refresh(); + }, + + _getCreateEventData: function() { + return { + header: this.active, + panel: !this.active.length ? $() : this.active.next() + }; + }, + + _createIcons: function() { + var icon, children, + icons = this.options.icons; + + if ( icons ) { + icon = $( "" ); + this._addClass( icon, "ui-accordion-header-icon", "ui-icon " + icons.header ); + icon.prependTo( this.headers ); + children = this.active.children( ".ui-accordion-header-icon" ); + this._removeClass( children, icons.header ) + ._addClass( children, null, icons.activeHeader ) + ._addClass( this.headers, "ui-accordion-icons" ); + } + }, + + _destroyIcons: function() { + this._removeClass( this.headers, "ui-accordion-icons" ); + this.headers.children( ".ui-accordion-header-icon" ).remove(); + }, + + _destroy: function() { + var contents; + + // Clean up main element + this.element.removeAttr( "role" ); + + // Clean up headers + this.headers + .removeAttr( "role aria-expanded aria-selected aria-controls tabIndex" ) + .removeUniqueId(); + + this._destroyIcons(); + + // Clean up content panels + contents = this.headers.next() + .css( "display", "" ) + .removeAttr( "role aria-hidden aria-labelledby" ) + .removeUniqueId(); + + if ( this.options.heightStyle !== "content" ) { + contents.css( "height", "" ); + } + }, + + _setOption: function( key, value ) { + if ( key === "active" ) { + + // _activate() will handle invalid values and update this.options + this._activate( value ); + return; + } + + if ( key === "event" ) { + if ( this.options.event ) { + this._off( this.headers, this.options.event ); + } + this._setupEvents( value ); + } + + this._super( key, value ); + + // Setting collapsible: false while collapsed; open first panel + if ( key === "collapsible" && !value && this.options.active === false ) { + this._activate( 0 ); + } + + if ( key === "icons" ) { + this._destroyIcons(); + if ( value ) { + this._createIcons(); + } + } + }, + + _setOptionDisabled: function( value ) { + this._super( value ); + + this.element.attr( "aria-disabled", value ); + this._toggleClass( null, "ui-state-disabled", !!value ); + }, + + _keydown: function( event ) { + if ( event.altKey || event.ctrlKey ) { + return; + } + + var keyCode = $.ui.keyCode, + length = this.headers.length, + currentIndex = this.headers.index( event.target ), + toFocus = false; + + switch ( event.keyCode ) { + case keyCode.RIGHT: + case keyCode.DOWN: + toFocus = this.headers[ ( currentIndex + 1 ) % length ]; + break; + case keyCode.LEFT: + case keyCode.UP: + toFocus = this.headers[ ( currentIndex - 1 + length ) % length ]; + break; + case keyCode.SPACE: + case keyCode.ENTER: + this._eventHandler( event ); + break; + case keyCode.HOME: + toFocus = this.headers[ 0 ]; + break; + case keyCode.END: + toFocus = this.headers[ length - 1 ]; + break; + } + + if ( toFocus ) { + $( event.target ).attr( "tabIndex", -1 ); + $( toFocus ).attr( "tabIndex", 0 ); + $( toFocus ).trigger( "focus" ); + event.preventDefault(); + } + }, + + _panelKeyDown: function( event ) { + if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) { + $( event.currentTarget ).prev().trigger( "focus" ); + } + }, + + refresh: function() { + var options = this.options; + this._processPanels(); + + // Was collapsed or no panel + if ( ( options.active === false && options.collapsible === true ) || + !this.headers.length ) { + options.active = false; + this.active = $(); + + // active false only when collapsible is true + } else if ( options.active === false ) { + this._activate( 0 ); + + // was active, but active panel is gone + } else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { + + // all remaining panel are disabled + if ( this.headers.length === this.headers.find( ".ui-state-disabled" ).length ) { + options.active = false; + this.active = $(); + + // activate previous panel + } else { + this._activate( Math.max( 0, options.active - 1 ) ); + } + + // was active, active panel still exists + } else { + + // make sure active index is correct + options.active = this.headers.index( this.active ); + } + + this._destroyIcons(); + + this._refresh(); + }, + + _processPanels: function() { + var prevHeaders = this.headers, + prevPanels = this.panels; + + if ( typeof this.options.header === "function" ) { + this.headers = this.options.header( this.element ); + } else { + this.headers = this.element.find( this.options.header ); + } + this._addClass( this.headers, "ui-accordion-header ui-accordion-header-collapsed", + "ui-state-default" ); + + this.panels = this.headers.next().filter( ":not(.ui-accordion-content-active)" ).hide(); + this._addClass( this.panels, "ui-accordion-content", "ui-helper-reset ui-widget-content" ); + + // Avoid memory leaks (#10056) + if ( prevPanels ) { + this._off( prevHeaders.not( this.headers ) ); + this._off( prevPanels.not( this.panels ) ); + } + }, + + _refresh: function() { + var maxHeight, + options = this.options, + heightStyle = options.heightStyle, + parent = this.element.parent(); + + this.active = this._findActive( options.active ); + this._addClass( this.active, "ui-accordion-header-active", "ui-state-active" ) + ._removeClass( this.active, "ui-accordion-header-collapsed" ); + this._addClass( this.active.next(), "ui-accordion-content-active" ); + this.active.next().show(); + + this.headers + .attr( "role", "tab" ) + .each( function() { + var header = $( this ), + headerId = header.uniqueId().attr( "id" ), + panel = header.next(), + panelId = panel.uniqueId().attr( "id" ); + header.attr( "aria-controls", panelId ); + panel.attr( "aria-labelledby", headerId ); + } ) + .next() + .attr( "role", "tabpanel" ); + + this.headers + .not( this.active ) + .attr( { + "aria-selected": "false", + "aria-expanded": "false", + tabIndex: -1 + } ) + .next() + .attr( { + "aria-hidden": "true" + } ) + .hide(); + + // Make sure at least one header is in the tab order + if ( !this.active.length ) { + this.headers.eq( 0 ).attr( "tabIndex", 0 ); + } else { + this.active.attr( { + "aria-selected": "true", + "aria-expanded": "true", + tabIndex: 0 + } ) + .next() + .attr( { + "aria-hidden": "false" + } ); + } + + this._createIcons(); + + this._setupEvents( options.event ); + + if ( heightStyle === "fill" ) { + maxHeight = parent.height(); + this.element.siblings( ":visible" ).each( function() { + var elem = $( this ), + position = elem.css( "position" ); + + if ( position === "absolute" || position === "fixed" ) { + return; + } + maxHeight -= elem.outerHeight( true ); + } ); + + this.headers.each( function() { + maxHeight -= $( this ).outerHeight( true ); + } ); + + this.headers.next() + .each( function() { + $( this ).height( Math.max( 0, maxHeight - + $( this ).innerHeight() + $( this ).height() ) ); + } ) + .css( "overflow", "auto" ); + } else if ( heightStyle === "auto" ) { + maxHeight = 0; + this.headers.next() + .each( function() { + var isVisible = $( this ).is( ":visible" ); + if ( !isVisible ) { + $( this ).show(); + } + maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() ); + if ( !isVisible ) { + $( this ).hide(); + } + } ) + .height( maxHeight ); + } + }, + + _activate: function( index ) { + var active = this._findActive( index )[ 0 ]; + + // Trying to activate the already active panel + if ( active === this.active[ 0 ] ) { + return; + } + + // Trying to collapse, simulate a click on the currently active header + active = active || this.active[ 0 ]; + + this._eventHandler( { + target: active, + currentTarget: active, + preventDefault: $.noop + } ); + }, + + _findActive: function( selector ) { + return typeof selector === "number" ? this.headers.eq( selector ) : $(); + }, + + _setupEvents: function( event ) { + var events = { + keydown: "_keydown" + }; + if ( event ) { + $.each( event.split( " " ), function( index, eventName ) { + events[ eventName ] = "_eventHandler"; + } ); + } + + this._off( this.headers.add( this.headers.next() ) ); + this._on( this.headers, events ); + this._on( this.headers.next(), { keydown: "_panelKeyDown" } ); + this._hoverable( this.headers ); + this._focusable( this.headers ); + }, + + _eventHandler: function( event ) { + var activeChildren, clickedChildren, + options = this.options, + active = this.active, + clicked = $( event.currentTarget ), + clickedIsActive = clicked[ 0 ] === active[ 0 ], + collapsing = clickedIsActive && options.collapsible, + toShow = collapsing ? $() : clicked.next(), + toHide = active.next(), + eventData = { + oldHeader: active, + oldPanel: toHide, + newHeader: collapsing ? $() : clicked, + newPanel: toShow + }; + + event.preventDefault(); + + if ( + + // click on active header, but not collapsible + ( clickedIsActive && !options.collapsible ) || + + // allow canceling activation + ( this._trigger( "beforeActivate", event, eventData ) === false ) ) { + return; + } + + options.active = collapsing ? false : this.headers.index( clicked ); + + // When the call to ._toggle() comes after the class changes + // it causes a very odd bug in IE 8 (see #6720) + this.active = clickedIsActive ? $() : clicked; + this._toggle( eventData ); + + // Switch classes + // corner classes on the previously active header stay after the animation + this._removeClass( active, "ui-accordion-header-active", "ui-state-active" ); + if ( options.icons ) { + activeChildren = active.children( ".ui-accordion-header-icon" ); + this._removeClass( activeChildren, null, options.icons.activeHeader ) + ._addClass( activeChildren, null, options.icons.header ); + } + + if ( !clickedIsActive ) { + this._removeClass( clicked, "ui-accordion-header-collapsed" ) + ._addClass( clicked, "ui-accordion-header-active", "ui-state-active" ); + if ( options.icons ) { + clickedChildren = clicked.children( ".ui-accordion-header-icon" ); + this._removeClass( clickedChildren, null, options.icons.header ) + ._addClass( clickedChildren, null, options.icons.activeHeader ); + } + + this._addClass( clicked.next(), "ui-accordion-content-active" ); + } + }, + + _toggle: function( data ) { + var toShow = data.newPanel, + toHide = this.prevShow.length ? this.prevShow : data.oldPanel; + + // Handle activating a panel during the animation for another activation + this.prevShow.add( this.prevHide ).stop( true, true ); + this.prevShow = toShow; + this.prevHide = toHide; + + if ( this.options.animate ) { + this._animate( toShow, toHide, data ); + } else { + toHide.hide(); + toShow.show(); + this._toggleComplete( data ); + } + + toHide.attr( { + "aria-hidden": "true" + } ); + toHide.prev().attr( { + "aria-selected": "false", + "aria-expanded": "false" + } ); + + // if we're switching panels, remove the old header from the tab order + // if we're opening from collapsed state, remove the previous header from the tab order + // if we're collapsing, then keep the collapsing header in the tab order + if ( toShow.length && toHide.length ) { + toHide.prev().attr( { + "tabIndex": -1, + "aria-expanded": "false" + } ); + } else if ( toShow.length ) { + this.headers.filter( function() { + return parseInt( $( this ).attr( "tabIndex" ), 10 ) === 0; + } ) + .attr( "tabIndex", -1 ); + } + + toShow + .attr( "aria-hidden", "false" ) + .prev() + .attr( { + "aria-selected": "true", + "aria-expanded": "true", + tabIndex: 0 + } ); + }, + + _animate: function( toShow, toHide, data ) { + var total, easing, duration, + that = this, + adjust = 0, + boxSizing = toShow.css( "box-sizing" ), + down = toShow.length && + ( !toHide.length || ( toShow.index() < toHide.index() ) ), + animate = this.options.animate || {}, + options = down && animate.down || animate, + complete = function() { + that._toggleComplete( data ); + }; + + if ( typeof options === "number" ) { + duration = options; + } + if ( typeof options === "string" ) { + easing = options; + } + + // fall back from options to animation in case of partial down settings + easing = easing || options.easing || animate.easing; + duration = duration || options.duration || animate.duration; + + if ( !toHide.length ) { + return toShow.animate( this.showProps, duration, easing, complete ); + } + if ( !toShow.length ) { + return toHide.animate( this.hideProps, duration, easing, complete ); + } + + total = toShow.show().outerHeight(); + toHide.animate( this.hideProps, { + duration: duration, + easing: easing, + step: function( now, fx ) { + fx.now = Math.round( now ); + } + } ); + toShow + .hide() + .animate( this.showProps, { + duration: duration, + easing: easing, + complete: complete, + step: function( now, fx ) { + fx.now = Math.round( now ); + if ( fx.prop !== "height" ) { + if ( boxSizing === "content-box" ) { + adjust += fx.now; + } + } else if ( that.options.heightStyle !== "content" ) { + fx.now = Math.round( total - toHide.outerHeight() - adjust ); + adjust = 0; + } + } + } ); + }, + + _toggleComplete: function( data ) { + var toHide = data.oldPanel, + prev = toHide.prev(); + + this._removeClass( toHide, "ui-accordion-content-active" ); + this._removeClass( prev, "ui-accordion-header-active" ) + ._addClass( prev, "ui-accordion-header-collapsed" ); + + this._trigger( "activate", null, data ); + } +} ); + + +/*! + * jQuery UI Menu 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Menu +//>>group: Widgets +//>>description: Creates nestable menus. +//>>docs: https://api.jqueryui.com/menu/ +//>>demos: https://jqueryui.com/menu/ +//>>css.structure: ../../themes/base/core.css +//>>css.structure: ../../themes/base/menu.css +//>>css.theme: ../../themes/base/theme.css + + +var widgetsMenu = $.widget( "ui.menu", { + version: "1.14.1", + defaultElement: "
    ", + delay: 300, + options: { + icons: { + submenu: "ui-icon-caret-1-e" + }, + items: "> *", + menus: "ul", + position: { + my: "left top", + at: "right top" + }, + role: "menu", + + // Callbacks + blur: null, + focus: null, + select: null + }, + + _create: function() { + this.activeMenu = this.element; + + // Flag used to prevent firing of the click handler + // as the event bubbles up through nested menus + this.mouseHandled = false; + this.lastMousePosition = { x: null, y: null }; + this.element + .uniqueId() + .attr( { + role: this.options.role, + tabIndex: 0 + } ); + + this._addClass( "ui-menu", "ui-widget ui-widget-content" ); + this._on( { + + // Prevent focus from sticking to links inside menu after clicking + // them (focus should always stay on UL during navigation). + "mousedown .ui-menu-item": function( event ) { + event.preventDefault(); + + this._activateItem( event ); + }, + "click .ui-menu-item": function( event ) { + var target = $( event.target ); + var active = $( this.document[ 0 ].activeElement ); + if ( !this.mouseHandled && target.not( ".ui-state-disabled" ).length ) { + this.select( event ); + + // Only set the mouseHandled flag if the event will bubble, see #9469. + if ( !event.isPropagationStopped() ) { + this.mouseHandled = true; + } + + // Open submenu on click + if ( target.has( ".ui-menu" ).length ) { + this.expand( event ); + } else if ( !this.element.is( ":focus" ) && + active.closest( ".ui-menu" ).length ) { + + // Redirect focus to the menu + this.element.trigger( "focus", [ true ] ); + + // If the active item is on the top level, let it stay active. + // Otherwise, blur the active item since it is no longer visible. + if ( this.active && this.active.parents( ".ui-menu" ).length === 1 ) { + clearTimeout( this.timer ); + } + } + } + }, + "mouseenter .ui-menu-item": "_activateItem", + "mousemove .ui-menu-item": "_activateItem", + mouseleave: "collapseAll", + "mouseleave .ui-menu": "collapseAll", + focus: function( event, keepActiveItem ) { + + // If there's already an active item, keep it active + // If not, activate the first item + var item = this.active || this._menuItems().first(); + + if ( !keepActiveItem ) { + this.focus( event, item ); + } + }, + blur: function( event ) { + this._delay( function() { + var notContained = !$.contains( + this.element[ 0 ], + this.document[ 0 ].activeElement + ); + if ( notContained ) { + this.collapseAll( event ); + } + } ); + }, + keydown: "_keydown" + } ); + + this.refresh(); + + // Clicks outside of a menu collapse any open menus + this._on( this.document, { + click: function( event ) { + if ( this._closeOnDocumentClick( event ) ) { + this.collapseAll( event, true ); + } + + // Reset the mouseHandled flag + this.mouseHandled = false; + } + } ); + }, + + _activateItem: function( event ) { + + // Ignore mouse events while typeahead is active, see #10458. + // Prevents focusing the wrong item when typeahead causes a scroll while the mouse + // is over an item in the menu + if ( this.previousFilter ) { + return; + } + + // If the mouse didn't actually move, but the page was scrolled, ignore the event (#9356) + if ( event.clientX === this.lastMousePosition.x && + event.clientY === this.lastMousePosition.y ) { + return; + } + + this.lastMousePosition = { + x: event.clientX, + y: event.clientY + }; + + var actualTarget = $( event.target ).closest( ".ui-menu-item" ), + target = $( event.currentTarget ); + + // Ignore bubbled events on parent items, see #11641 + if ( actualTarget[ 0 ] !== target[ 0 ] ) { + return; + } + + // If the item is already active, there's nothing to do + if ( target.is( ".ui-state-active" ) ) { + return; + } + + // Remove ui-state-active class from siblings of the newly focused menu item + // to avoid a jump caused by adjacent elements both having a class with a border + this._removeClass( target.siblings().children( ".ui-state-active" ), + null, "ui-state-active" ); + this.focus( event, target ); + }, + + _destroy: function() { + var items = this.element.find( ".ui-menu-item" ) + .removeAttr( "role aria-disabled" ), + submenus = items.children( ".ui-menu-item-wrapper" ) + .removeUniqueId() + .removeAttr( "tabIndex role aria-haspopup" ); + + // Destroy (sub)menus + this.element + .removeAttr( "aria-activedescendant" ) + .find( ".ui-menu" ).addBack() + .removeAttr( "role aria-labelledby aria-expanded aria-hidden aria-disabled " + + "tabIndex" ) + .removeUniqueId() + .show(); + + submenus.children().each( function() { + var elem = $( this ); + if ( elem.data( "ui-menu-submenu-caret" ) ) { + elem.remove(); + } + } ); + }, + + _keydown: function( event ) { + var match, prev, character, skip, + preventDefault = true; + + switch ( event.keyCode ) { + case $.ui.keyCode.PAGE_UP: + this.previousPage( event ); + break; + case $.ui.keyCode.PAGE_DOWN: + this.nextPage( event ); + break; + case $.ui.keyCode.HOME: + this._move( "first", "first", event ); + break; + case $.ui.keyCode.END: + this._move( "last", "last", event ); + break; + case $.ui.keyCode.UP: + this.previous( event ); + break; + case $.ui.keyCode.DOWN: + this.next( event ); + break; + case $.ui.keyCode.LEFT: + this.collapse( event ); + break; + case $.ui.keyCode.RIGHT: + if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { + this.expand( event ); + } + break; + case $.ui.keyCode.ENTER: + case $.ui.keyCode.SPACE: + this._activate( event ); + break; + case $.ui.keyCode.ESCAPE: + this.collapse( event ); + break; + default: + preventDefault = false; + prev = this.previousFilter || ""; + skip = false; + + // Support number pad values + character = event.keyCode >= 96 && event.keyCode <= 105 ? + ( event.keyCode - 96 ).toString() : String.fromCharCode( event.keyCode ); + + clearTimeout( this.filterTimer ); + + if ( character === prev ) { + skip = true; + } else { + character = prev + character; + } + + match = this._filterMenuItems( character ); + match = skip && match.index( this.active.next() ) !== -1 ? + this.active.nextAll( ".ui-menu-item" ) : + match; + + // If no matches on the current filter, reset to the last character pressed + // to move down the menu to the first item that starts with that character + if ( !match.length ) { + character = String.fromCharCode( event.keyCode ); + match = this._filterMenuItems( character ); + } + + if ( match.length ) { + this.focus( event, match ); + this.previousFilter = character; + this.filterTimer = this._delay( function() { + delete this.previousFilter; + }, 1000 ); + } else { + delete this.previousFilter; + } + } + + if ( preventDefault ) { + event.preventDefault(); + } + }, + + _activate: function( event ) { + if ( this.active && !this.active.is( ".ui-state-disabled" ) ) { + if ( this.active.children( "[aria-haspopup='true']" ).length ) { + this.expand( event ); + } else { + this.select( event ); + } + } + }, + + refresh: function() { + var menus, items, newSubmenus, newItems, newWrappers, + that = this, + icon = this.options.icons.submenu, + submenus = this.element.find( this.options.menus ); + + this._toggleClass( "ui-menu-icons", null, !!this.element.find( ".ui-icon" ).length ); + + // Initialize nested menus + newSubmenus = submenus.filter( ":not(.ui-menu)" ) + .hide() + .attr( { + role: this.options.role, + "aria-hidden": "true", + "aria-expanded": "false" + } ) + .each( function() { + var menu = $( this ), + item = menu.prev(), + submenuCaret = $( "" ).data( "ui-menu-submenu-caret", true ); + + that._addClass( submenuCaret, "ui-menu-icon", "ui-icon " + icon ); + item + .attr( "aria-haspopup", "true" ) + .prepend( submenuCaret ); + menu.attr( "aria-labelledby", item.attr( "id" ) ); + } ); + + this._addClass( newSubmenus, "ui-menu", "ui-widget ui-widget-content ui-front" ); + + menus = submenus.add( this.element ); + items = menus.find( this.options.items ); + + // Initialize menu-items containing spaces and/or dashes only as dividers + items.not( ".ui-menu-item" ).each( function() { + var item = $( this ); + if ( that._isDivider( item ) ) { + that._addClass( item, "ui-menu-divider", "ui-widget-content" ); + } + } ); + + // Don't refresh list items that are already adapted + newItems = items.not( ".ui-menu-item, .ui-menu-divider" ); + newWrappers = newItems.children() + .not( ".ui-menu" ) + .uniqueId() + .attr( { + tabIndex: -1, + role: this._itemRole() + } ); + this._addClass( newItems, "ui-menu-item" ) + ._addClass( newWrappers, "ui-menu-item-wrapper" ); + + // Add aria-disabled attribute to any disabled menu item + items.filter( ".ui-state-disabled" ).attr( "aria-disabled", "true" ); + + // If the active item has been removed, blur the menu + if ( this.active && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) { + this.blur(); + } + }, + + _itemRole: function() { + return { + menu: "menuitem", + listbox: "option" + }[ this.options.role ]; + }, + + _setOption: function( key, value ) { + if ( key === "icons" ) { + var icons = this.element.find( ".ui-menu-icon" ); + this._removeClass( icons, null, this.options.icons.submenu ) + ._addClass( icons, null, value.submenu ); + } + this._super( key, value ); + }, + + _setOptionDisabled: function( value ) { + this._super( value ); + + this.element.attr( "aria-disabled", String( value ) ); + this._toggleClass( null, "ui-state-disabled", !!value ); + }, + + focus: function( event, item ) { + var nested, focused, activeParent; + this.blur( event, event && event.type === "focus" ); + + this._scrollIntoView( item ); + + this.active = item.first(); + + focused = this.active.children( ".ui-menu-item-wrapper" ); + this._addClass( focused, null, "ui-state-active" ); + + // Only update aria-activedescendant if there's a role + // otherwise we assume focus is managed elsewhere + if ( this.options.role ) { + this.element.attr( "aria-activedescendant", focused.attr( "id" ) ); + } + + // Highlight active parent menu item, if any + activeParent = this.active + .parent() + .closest( ".ui-menu-item" ) + .children( ".ui-menu-item-wrapper" ); + this._addClass( activeParent, null, "ui-state-active" ); + + if ( event && event.type === "keydown" ) { + this._close(); + } else { + this.timer = this._delay( function() { + this._close(); + }, this.delay ); + } + + nested = item.children( ".ui-menu" ); + if ( nested.length && event && ( /^mouse/.test( event.type ) ) ) { + this._startOpening( nested ); + } + this.activeMenu = item.parent(); + + this._trigger( "focus", event, { item: item } ); + }, + + _scrollIntoView: function( item ) { + var borderTop, paddingTop, offset, scroll, elementHeight, itemHeight; + if ( this._hasScroll() ) { + borderTop = parseFloat( $.css( this.activeMenu[ 0 ], "borderTopWidth" ) ) || 0; + paddingTop = parseFloat( $.css( this.activeMenu[ 0 ], "paddingTop" ) ) || 0; + offset = item.offset().top - this.activeMenu.offset().top - borderTop - paddingTop; + scroll = this.activeMenu.scrollTop(); + elementHeight = this.activeMenu.height(); + itemHeight = item.outerHeight(); + + if ( offset < 0 ) { + this.activeMenu.scrollTop( scroll + offset ); + } else if ( offset + itemHeight > elementHeight ) { + this.activeMenu.scrollTop( scroll + offset - elementHeight + itemHeight ); + } + } + }, + + blur: function( event, fromFocus ) { + if ( !fromFocus ) { + clearTimeout( this.timer ); + } + + if ( !this.active ) { + return; + } + + this._removeClass( this.active.children( ".ui-menu-item-wrapper" ), + null, "ui-state-active" ); + + this._trigger( "blur", event, { item: this.active } ); + this.active = null; + }, + + _startOpening: function( submenu ) { + clearTimeout( this.timer ); + + // Don't open if already open fixes a Firefox bug that caused a .5 pixel + // shift in the submenu position when mousing over the caret icon + if ( submenu.attr( "aria-hidden" ) !== "true" ) { + return; + } + + this.timer = this._delay( function() { + this._close(); + this._open( submenu ); + }, this.delay ); + }, + + _open: function( submenu ) { + var position = $.extend( { + of: this.active + }, this.options.position ); + + clearTimeout( this.timer ); + this.element.find( ".ui-menu" ).not( submenu.parents( ".ui-menu" ) ) + .hide() + .attr( "aria-hidden", "true" ); + + submenu + .show() + .removeAttr( "aria-hidden" ) + .attr( "aria-expanded", "true" ) + .position( position ); + }, + + collapseAll: function( event, all ) { + clearTimeout( this.timer ); + this.timer = this._delay( function() { + + // If we were passed an event, look for the submenu that contains the event + var currentMenu = all ? this.element : + $( event && event.target ).closest( this.element.find( ".ui-menu" ) ); + + // If we found no valid submenu ancestor, use the main menu to close all + // sub menus anyway + if ( !currentMenu.length ) { + currentMenu = this.element; + } + + this._close( currentMenu ); + + this.blur( event ); + + // Work around active item staying active after menu is blurred + this._removeClass( currentMenu.find( ".ui-state-active" ), null, "ui-state-active" ); + + this.activeMenu = currentMenu; + }, all ? 0 : this.delay ); + }, + + // With no arguments, closes the currently active menu - if nothing is active + // it closes all menus. If passed an argument, it will search for menus BELOW + _close: function( startMenu ) { + if ( !startMenu ) { + startMenu = this.active ? this.active.parent() : this.element; + } + + startMenu.find( ".ui-menu" ) + .hide() + .attr( "aria-hidden", "true" ) + .attr( "aria-expanded", "false" ); + }, + + _closeOnDocumentClick: function( event ) { + return !$( event.target ).closest( ".ui-menu" ).length; + }, + + _isDivider: function( item ) { + + // Match hyphen, em dash, en dash + return !/[^\-\u2014\u2013\s]/.test( item.text() ); + }, + + collapse: function( event ) { + var newItem = this.active && + this.active.parent().closest( ".ui-menu-item", this.element ); + if ( newItem && newItem.length ) { + this._close(); + this.focus( event, newItem ); + } + }, + + expand: function( event ) { + var newItem = this.active && this._menuItems( this.active.children( ".ui-menu" ) ).first(); + + if ( newItem && newItem.length ) { + this._open( newItem.parent() ); + + // Delay so Firefox will not hide activedescendant change in expanding submenu from AT + this._delay( function() { + this.focus( event, newItem ); + } ); + } + }, + + next: function( event ) { + this._move( "next", "first", event ); + }, + + previous: function( event ) { + this._move( "prev", "last", event ); + }, + + isFirstItem: function() { + return this.active && !this.active.prevAll( ".ui-menu-item" ).length; + }, + + isLastItem: function() { + return this.active && !this.active.nextAll( ".ui-menu-item" ).length; + }, + + _menuItems: function( menu ) { + return ( menu || this.element ) + .find( this.options.items ) + .filter( ".ui-menu-item" ); + }, + + _move: function( direction, filter, event ) { + var next; + if ( this.active ) { + if ( direction === "first" || direction === "last" ) { + next = this.active + [ direction === "first" ? "prevAll" : "nextAll" ]( ".ui-menu-item" ) + .last(); + } else { + next = this.active + [ direction + "All" ]( ".ui-menu-item" ) + .first(); + } + } + if ( !next || !next.length || !this.active ) { + next = this._menuItems( this.activeMenu )[ filter ](); + } + + this.focus( event, next ); + }, + + nextPage: function( event ) { + var item, base, height; + + if ( !this.active ) { + this.next( event ); + return; + } + if ( this.isLastItem() ) { + return; + } + if ( this._hasScroll() ) { + base = this.active.offset().top; + height = this.element.innerHeight(); + + // jQuery 3.2 doesn't include scrollbars in innerHeight, add it back. + if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) { + height += this.element[ 0 ].offsetHeight - this.element.outerHeight(); + } + + this.active.nextAll( ".ui-menu-item" ).each( function() { + item = $( this ); + return item.offset().top - base - height < 0; + } ); + + this.focus( event, item ); + } else { + this.focus( event, this._menuItems( this.activeMenu ) + [ !this.active ? "first" : "last" ]() ); + } + }, + + previousPage: function( event ) { + var item, base, height; + if ( !this.active ) { + this.next( event ); + return; + } + if ( this.isFirstItem() ) { + return; + } + if ( this._hasScroll() ) { + base = this.active.offset().top; + height = this.element.innerHeight(); + + // jQuery 3.2 doesn't include scrollbars in innerHeight, add it back. + if ( $.fn.jquery.indexOf( "3.2." ) === 0 ) { + height += this.element[ 0 ].offsetHeight - this.element.outerHeight(); + } + + this.active.prevAll( ".ui-menu-item" ).each( function() { + item = $( this ); + return item.offset().top - base + height > 0; + } ); + + this.focus( event, item ); + } else { + this.focus( event, this._menuItems( this.activeMenu ).first() ); + } + }, + + _hasScroll: function() { + return this.element.outerHeight() < this.element.prop( "scrollHeight" ); + }, + + select: function( event ) { + + // TODO: It should never be possible to not have an active item at this + // point, but the tests don't trigger mouseenter before click. + this.active = this.active || $( event.target ).closest( ".ui-menu-item" ); + var ui = { item: this.active }; + if ( !this.active.has( ".ui-menu" ).length ) { + this.collapseAll( event, true ); + } + this._trigger( "select", event, ui ); + }, + + _filterMenuItems: function( character ) { + var escapedCharacter = character.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ), + regex = new RegExp( "^" + escapedCharacter, "i" ); + + return this.activeMenu + .find( this.options.items ) + + // Only match on items, not dividers or other content (#10571) + .filter( ".ui-menu-item" ) + .filter( function() { + return regex.test( + String.prototype.trim.call( + $( this ).children( ".ui-menu-item-wrapper" ).text() ) ); + } ); + } +} ); + + +/*! + * jQuery UI Autocomplete 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Autocomplete +//>>group: Widgets +//>>description: Lists suggested words as the user is typing. +//>>docs: https://api.jqueryui.com/autocomplete/ +//>>demos: https://jqueryui.com/autocomplete/ +//>>css.structure: ../../themes/base/core.css +//>>css.structure: ../../themes/base/autocomplete.css +//>>css.theme: ../../themes/base/theme.css + + +$.widget( "ui.autocomplete", { + version: "1.14.1", + defaultElement: "", + options: { + appendTo: null, + autoFocus: false, + delay: 300, + minLength: 1, + position: { + my: "left top", + at: "left bottom", + collision: "none" + }, + source: null, + + // Callbacks + change: null, + close: null, + focus: null, + open: null, + response: null, + search: null, + select: null + }, + + requestIndex: 0, + pending: 0, + liveRegionTimer: null, + + _create: function() { + + // Some browsers only repeat keydown events, not keypress events, + // so we use the suppressKeyPress flag to determine if we've already + // handled the keydown event. #7269 + // Unfortunately the code for & in keypress is the same as the up arrow, + // so we use the suppressKeyPressRepeat flag to avoid handling keypress + // events when we know the keydown event was used to modify the + // search term. #7799 + var suppressKeyPress, suppressKeyPressRepeat, suppressInput, + nodeName = this.element[ 0 ].nodeName.toLowerCase(), + isTextarea = nodeName === "textarea", + isInput = nodeName === "input"; + + // Textareas are always multi-line + // Inputs are always single-line, even if inside a contentEditable element + // All other element types are determined by whether they're contentEditable + this.isMultiLine = isTextarea || + !isInput && this.element.prop( "contentEditable" ) === "true"; + + this.valueMethod = this.element[ isTextarea || isInput ? "val" : "text" ]; + this.isNewMenu = true; + + this._addClass( "ui-autocomplete-input" ); + this.element.attr( "autocomplete", "off" ); + + this._on( this.element, { + keydown: function( event ) { + if ( this.element.prop( "readOnly" ) ) { + suppressKeyPress = true; + suppressInput = true; + suppressKeyPressRepeat = true; + return; + } + + suppressKeyPress = false; + suppressInput = false; + suppressKeyPressRepeat = false; + var keyCode = $.ui.keyCode; + switch ( event.keyCode ) { + case keyCode.PAGE_UP: + suppressKeyPress = true; + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + suppressKeyPress = true; + this._move( "nextPage", event ); + break; + case keyCode.UP: + suppressKeyPress = true; + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + suppressKeyPress = true; + this._keyEvent( "next", event ); + break; + case keyCode.ENTER: + + // when menu is open and has focus + if ( this.menu.active ) { + + // #6055 - Opera still allows the keypress to occur + // which causes forms to submit + suppressKeyPress = true; + event.preventDefault(); + this.menu.select( event ); + } + break; + case keyCode.TAB: + if ( this.menu.active ) { + this.menu.select( event ); + } + break; + case keyCode.ESCAPE: + if ( this.menu.element.is( ":visible" ) ) { + if ( !this.isMultiLine ) { + this._value( this.term ); + } + this.close( event ); + + // Different browsers have different default behavior for escape + // Single press can mean undo or clear + event.preventDefault(); + } + break; + default: + suppressKeyPressRepeat = true; + + // search timeout should be triggered before the input value is changed + this._searchTimeout( event ); + break; + } + }, + keypress: function( event ) { + if ( suppressKeyPress ) { + suppressKeyPress = false; + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + event.preventDefault(); + } + return; + } + if ( suppressKeyPressRepeat ) { + return; + } + + // Replicate some key handlers to allow them to repeat in Firefox and Opera + var keyCode = $.ui.keyCode; + switch ( event.keyCode ) { + case keyCode.PAGE_UP: + this._move( "previousPage", event ); + break; + case keyCode.PAGE_DOWN: + this._move( "nextPage", event ); + break; + case keyCode.UP: + this._keyEvent( "previous", event ); + break; + case keyCode.DOWN: + this._keyEvent( "next", event ); + break; + } + }, + input: function( event ) { + if ( suppressInput ) { + suppressInput = false; + event.preventDefault(); + return; + } + this._searchTimeout( event ); + }, + focus: function() { + this.selectedItem = null; + this.previous = this._value(); + }, + blur: function( event ) { + clearTimeout( this.searching ); + this.close( event ); + this._change( event ); + } + } ); + + this._initSource(); + this.menu = $( "
      " ) + .appendTo( this._appendTo() ) + .menu( { + + // disable ARIA support, the live region takes care of that + role: null + } ) + .hide() + .menu( "instance" ); + + this._addClass( this.menu.element, "ui-autocomplete", "ui-front" ); + this._on( this.menu.element, { + mousedown: function( event ) { + + // Prevent moving focus out of the text field + event.preventDefault(); + }, + menufocus: function( event, ui ) { + var label, item; + + // Support: Firefox + // Prevent accidental activation of menu items in Firefox (#7024 #9118) + if ( this.isNewMenu ) { + this.isNewMenu = false; + if ( event.originalEvent && /^mouse/.test( event.originalEvent.type ) ) { + this.menu.blur(); + + this.document.one( "mousemove", function() { + $( event.target ).trigger( event.originalEvent ); + } ); + + return; + } + } + + item = ui.item.data( "ui-autocomplete-item" ); + if ( false !== this._trigger( "focus", event, { item: item } ) ) { + + // use value to match what will end up in the input, if it was a key event + if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { + this._value( item.value ); + } + } + + // Announce the value in the liveRegion + label = ui.item.attr( "aria-label" ) || item.value; + if ( label && String.prototype.trim.call( label ).length ) { + clearTimeout( this.liveRegionTimer ); + this.liveRegionTimer = this._delay( function() { + this.liveRegion.html( $( "
      " ).text( label ) ); + }, 100 ); + } + }, + menuselect: function( event, ui ) { + var item = ui.item.data( "ui-autocomplete-item" ), + previous = this.previous; + + // Only trigger when focus was lost (click on menu) + if ( this.element[ 0 ] !== this.document[ 0 ].activeElement ) { + this.element.trigger( "focus" ); + this.previous = previous; + } + + if ( false !== this._trigger( "select", event, { item: item } ) ) { + this._value( item.value ); + } + + // reset the term after the select event + // this allows custom select handling to work properly + this.term = this._value(); + + this.close( event ); + this.selectedItem = item; + } + } ); + + this.liveRegion = $( "
      ", { + role: "status", + "aria-live": "assertive", + "aria-relevant": "additions" + } ) + .appendTo( this.document[ 0 ].body ); + + this._addClass( this.liveRegion, null, "ui-helper-hidden-accessible" ); + + // Turning off autocomplete prevents the browser from remembering the + // value when navigating through history, so we re-enable autocomplete + // if the page is unloaded before the widget is destroyed. #7790 + this._on( this.window, { + beforeunload: function() { + this.element.removeAttr( "autocomplete" ); + } + } ); + }, + + _destroy: function() { + clearTimeout( this.searching ); + this.element.removeAttr( "autocomplete" ); + this.menu.element.remove(); + this.liveRegion.remove(); + }, + + _setOption: function( key, value ) { + this._super( key, value ); + if ( key === "source" ) { + this._initSource(); + } + if ( key === "appendTo" ) { + this.menu.element.appendTo( this._appendTo() ); + } + if ( key === "disabled" && value && this.xhr ) { + this.xhr.abort(); + } + }, + + _isEventTargetInWidget: function( event ) { + var menuElement = this.menu.element[ 0 ]; + + return event.target === this.element[ 0 ] || + event.target === menuElement || + $.contains( menuElement, event.target ); + }, + + _closeOnClickOutside: function( event ) { + if ( !this._isEventTargetInWidget( event ) ) { + this.close(); + } + }, + + _appendTo: function() { + var element = this.options.appendTo; + + if ( element ) { + element = element.jquery || element.nodeType ? + $( element ) : + this.document.find( element ).eq( 0 ); + } + + if ( !element || !element[ 0 ] ) { + element = this.element.closest( ".ui-front, dialog" ); + } + + if ( !element.length ) { + element = this.document[ 0 ].body; + } + + return element; + }, + + _initSource: function() { + var array, url, + that = this; + if ( Array.isArray( this.options.source ) ) { + array = this.options.source; + this.source = function( request, response ) { + response( $.ui.autocomplete.filter( array, request.term ) ); + }; + } else if ( typeof this.options.source === "string" ) { + url = this.options.source; + this.source = function( request, response ) { + if ( that.xhr ) { + that.xhr.abort(); + } + that.xhr = $.ajax( { + url: url, + data: request, + dataType: "json", + success: function( data ) { + response( data ); + }, + error: function() { + response( [] ); + } + } ); + }; + } else { + this.source = this.options.source; + } + }, + + _searchTimeout: function( event ) { + clearTimeout( this.searching ); + this.searching = this._delay( function() { + + // Search if the value has changed, or if the user retypes the same value (see #7434) + var equalValues = this.term === this._value(), + menuVisible = this.menu.element.is( ":visible" ), + modifierKey = event.altKey || event.ctrlKey || event.metaKey || event.shiftKey; + + if ( !equalValues || ( equalValues && !menuVisible && !modifierKey ) ) { + this.selectedItem = null; + this.search( null, event ); + } + }, this.options.delay ); + }, + + search: function( value, event ) { + value = value != null ? value : this._value(); + + // Always save the actual value, not the one passed as an argument + this.term = this._value(); + + if ( value.length < this.options.minLength ) { + return this.close( event ); + } + + if ( this._trigger( "search", event ) === false ) { + return; + } + + return this._search( value ); + }, + + _search: function( value ) { + this.pending++; + this._addClass( "ui-autocomplete-loading" ); + this.cancelSearch = false; + + this.source( { term: value }, this._response() ); + }, + + _response: function() { + var index = ++this.requestIndex; + + return function( content ) { + if ( index === this.requestIndex ) { + this.__response( content ); + } + + this.pending--; + if ( !this.pending ) { + this._removeClass( "ui-autocomplete-loading" ); + } + }.bind( this ); + }, + + __response: function( content ) { + if ( content ) { + content = this._normalize( content ); + } + this._trigger( "response", null, { content: content } ); + if ( !this.options.disabled && content && content.length && !this.cancelSearch ) { + this._suggest( content ); + this._trigger( "open" ); + } else { + + // use ._close() instead of .close() so we don't cancel future searches + this._close(); + } + }, + + close: function( event ) { + this.cancelSearch = true; + this._close( event ); + }, + + _close: function( event ) { + + // Remove the handler that closes the menu on outside clicks + this._off( this.document, "mousedown" ); + + if ( this.menu.element.is( ":visible" ) ) { + this.menu.element.hide(); + this.menu.blur(); + this.isNewMenu = true; + this._trigger( "close", event ); + } + }, + + _change: function( event ) { + if ( this.previous !== this._value() ) { + this._trigger( "change", event, { item: this.selectedItem } ); + } + }, + + _normalize: function( items ) { + + // assume all items have the right format when the first item is complete + if ( items.length && items[ 0 ].label && items[ 0 ].value ) { + return items; + } + return $.map( items, function( item ) { + if ( typeof item === "string" ) { + return { + label: item, + value: item + }; + } + return $.extend( {}, item, { + label: item.label || item.value, + value: item.value || item.label + } ); + } ); + }, + + _suggest: function( items ) { + var ul = this.menu.element.empty(); + this._renderMenu( ul, items ); + this.isNewMenu = true; + this.menu.refresh(); + + // Size and position menu + ul.show(); + this._resizeMenu(); + ul.position( $.extend( { + of: this.element + }, this.options.position ) ); + + if ( this.options.autoFocus ) { + this.menu.next(); + } + + // Listen for interactions outside of the widget (#6642) + this._on( this.document, { + mousedown: "_closeOnClickOutside" + } ); + }, + + _resizeMenu: function() { + var ul = this.menu.element; + ul.outerWidth( Math.max( + + // Firefox wraps long text (possibly a rounding bug) + // so we add 1px to avoid the wrapping (#7513) + ul.width( "" ).outerWidth() + 1, + this.element.outerWidth() + ) ); + }, + + _renderMenu: function( ul, items ) { + var that = this; + $.each( items, function( index, item ) { + that._renderItemData( ul, item ); + } ); + }, + + _renderItemData: function( ul, item ) { + return this._renderItem( ul, item ).data( "ui-autocomplete-item", item ); + }, + + _renderItem: function( ul, item ) { + return $( "
    • " ) + .append( $( "
      " ).text( item.label ) ) + .appendTo( ul ); + }, + + _move: function( direction, event ) { + if ( !this.menu.element.is( ":visible" ) ) { + this.search( null, event ); + return; + } + if ( this.menu.isFirstItem() && /^previous/.test( direction ) || + this.menu.isLastItem() && /^next/.test( direction ) ) { + + if ( !this.isMultiLine ) { + this._value( this.term ); + } + + this.menu.blur(); + return; + } + this.menu[ direction ]( event ); + }, + + widget: function() { + return this.menu.element; + }, + + _value: function() { + return this.valueMethod.apply( this.element, arguments ); + }, + + _keyEvent: function( keyEvent, event ) { + if ( !this.isMultiLine || this.menu.element.is( ":visible" ) ) { + this._move( keyEvent, event ); + + // Prevents moving cursor to beginning/end of the text field in some browsers + event.preventDefault(); + } + } +} ); + +$.extend( $.ui.autocomplete, { + escapeRegex: function( value ) { + return value.replace( /[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&" ); + }, + filter: function( array, term ) { + var matcher = new RegExp( $.ui.autocomplete.escapeRegex( term ), "i" ); + return $.grep( array, function( value ) { + return matcher.test( value.label || value.value || value ); + } ); + } +} ); + +// Live region extension, adding a `messages` option +// NOTE: This is an experimental API. We are still investigating +// a full solution for string manipulation and internationalization. +$.widget( "ui.autocomplete", $.ui.autocomplete, { + options: { + messages: { + noResults: "No search results.", + results: function( amount ) { + return amount + ( amount > 1 ? " results are" : " result is" ) + + " available, use up and down arrow keys to navigate."; + } + } + }, + + __response: function( content ) { + var message; + this._superApply( arguments ); + if ( this.options.disabled || this.cancelSearch ) { + return; + } + if ( content && content.length ) { + message = this.options.messages.results( content.length ); + } else { + message = this.options.messages.noResults; + } + clearTimeout( this.liveRegionTimer ); + this.liveRegionTimer = this._delay( function() { + this.liveRegion.html( $( "
      " ).text( message ) ); + }, 100 ); + } +} ); + +var widgetsAutocomplete = $.ui.autocomplete; + + +/*! + * jQuery UI Controlgroup 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Controlgroup +//>>group: Widgets +//>>description: Visually groups form control widgets +//>>docs: https://api.jqueryui.com/controlgroup/ +//>>demos: https://jqueryui.com/controlgroup/ +//>>css.structure: ../../themes/base/core.css +//>>css.structure: ../../themes/base/controlgroup.css +//>>css.theme: ../../themes/base/theme.css + + +var controlgroupCornerRegex = /ui-corner-([a-z]){2,6}/g; + +var widgetsControlgroup = $.widget( "ui.controlgroup", { + version: "1.14.1", + defaultElement: "
      ", + options: { + direction: "horizontal", + disabled: null, + onlyVisible: true, + items: { + "button": "input[type=button], input[type=submit], input[type=reset], button, a", + "controlgroupLabel": ".ui-controlgroup-label", + "checkboxradio": "input[type='checkbox'], input[type='radio']", + "selectmenu": "select", + "spinner": ".ui-spinner-input" + } + }, + + _create: function() { + this._enhance(); + }, + + // To support the enhanced option in jQuery Mobile, we isolate DOM manipulation + _enhance: function() { + this.element.attr( "role", "toolbar" ); + this.refresh(); + }, + + _destroy: function() { + this._callChildMethod( "destroy" ); + this.childWidgets.removeData( "ui-controlgroup-data" ); + this.element.removeAttr( "role" ); + if ( this.options.items.controlgroupLabel ) { + this.element + .find( this.options.items.controlgroupLabel ) + .find( ".ui-controlgroup-label-contents" ) + .contents().unwrap(); + } + }, + + _initWidgets: function() { + var that = this, + childWidgets = []; + + // First we iterate over each of the items options + $.each( this.options.items, function( widget, selector ) { + var labels; + var options = {}; + + // Make sure the widget has a selector set + if ( !selector ) { + return; + } + + if ( widget === "controlgroupLabel" ) { + labels = that.element.find( selector ); + labels.each( function() { + var element = $( this ); + + if ( element.children( ".ui-controlgroup-label-contents" ).length ) { + return; + } + element.contents() + .wrapAll( "" ); + } ); + that._addClass( labels, null, "ui-widget ui-widget-content ui-state-default" ); + childWidgets = childWidgets.concat( labels.get() ); + return; + } + + // Make sure the widget actually exists + if ( !$.fn[ widget ] ) { + return; + } + + // We assume everything is in the middle to start because we can't determine + // first / last elements until all enhancments are done. + if ( that[ "_" + widget + "Options" ] ) { + options = that[ "_" + widget + "Options" ]( "middle" ); + } else { + options = { classes: {} }; + } + + // Find instances of this widget inside controlgroup and init them + that.element + .find( selector ) + .each( function() { + var element = $( this ); + var instance = element[ widget ]( "instance" ); + + // We need to clone the default options for this type of widget to avoid + // polluting the variable options which has a wider scope than a single widget. + var instanceOptions = $.widget.extend( {}, options ); + + // If the button is the child of a spinner ignore it + // TODO: Find a more generic solution + if ( widget === "button" && element.parent( ".ui-spinner" ).length ) { + return; + } + + // Create the widget if it doesn't exist + if ( !instance ) { + instance = element[ widget ]()[ widget ]( "instance" ); + } + if ( instance ) { + instanceOptions.classes = + that._resolveClassesValues( instanceOptions.classes, instance ); + } + element[ widget ]( instanceOptions ); + + // Store an instance of the controlgroup to be able to reference + // from the outermost element for changing options and refresh + var widgetElement = element[ widget ]( "widget" ); + $.data( widgetElement[ 0 ], "ui-controlgroup-data", + instance ? instance : element[ widget ]( "instance" ) ); + + childWidgets.push( widgetElement[ 0 ] ); + } ); + } ); + + this.childWidgets = $( $.uniqueSort( childWidgets ) ); + this._addClass( this.childWidgets, "ui-controlgroup-item" ); + }, + + _callChildMethod: function( method ) { + this.childWidgets.each( function() { + var element = $( this ), + data = element.data( "ui-controlgroup-data" ); + if ( data && data[ method ] ) { + data[ method ](); + } + } ); + }, + + _updateCornerClass: function( element, position ) { + var remove = "ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"; + var add = this._buildSimpleOptions( position, "label" ).classes.label; + + this._removeClass( element, null, remove ); + this._addClass( element, null, add ); + }, + + _buildSimpleOptions: function( position, key ) { + var direction = this.options.direction === "vertical"; + var result = { + classes: {} + }; + result.classes[ key ] = { + "middle": "", + "first": "ui-corner-" + ( direction ? "top" : "left" ), + "last": "ui-corner-" + ( direction ? "bottom" : "right" ), + "only": "ui-corner-all" + }[ position ]; + + return result; + }, + + _spinnerOptions: function( position ) { + var options = this._buildSimpleOptions( position, "ui-spinner" ); + + options.classes[ "ui-spinner-up" ] = ""; + options.classes[ "ui-spinner-down" ] = ""; + + return options; + }, + + _buttonOptions: function( position ) { + return this._buildSimpleOptions( position, "ui-button" ); + }, + + _checkboxradioOptions: function( position ) { + return this._buildSimpleOptions( position, "ui-checkboxradio-label" ); + }, + + _selectmenuOptions: function( position ) { + var direction = this.options.direction === "vertical"; + return { + width: direction ? "auto" : false, + classes: { + middle: { + "ui-selectmenu-button-open": "", + "ui-selectmenu-button-closed": "" + }, + first: { + "ui-selectmenu-button-open": "ui-corner-" + ( direction ? "top" : "tl" ), + "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "top" : "left" ) + }, + last: { + "ui-selectmenu-button-open": direction ? "" : "ui-corner-tr", + "ui-selectmenu-button-closed": "ui-corner-" + ( direction ? "bottom" : "right" ) + }, + only: { + "ui-selectmenu-button-open": "ui-corner-top", + "ui-selectmenu-button-closed": "ui-corner-all" + } + + }[ position ] + }; + }, + + _resolveClassesValues: function( classes, instance ) { + var result = {}; + $.each( classes, function( key ) { + var current = instance.options.classes[ key ] || ""; + current = String.prototype.trim.call( current.replace( controlgroupCornerRegex, "" ) ); + result[ key ] = ( current + " " + classes[ key ] ).replace( /\s+/g, " " ); + } ); + return result; + }, + + _setOption: function( key, value ) { + if ( key === "direction" ) { + this._removeClass( "ui-controlgroup-" + this.options.direction ); + } + + this._super( key, value ); + if ( key === "disabled" ) { + this._callChildMethod( value ? "disable" : "enable" ); + return; + } + + this.refresh(); + }, + + refresh: function() { + var children, + that = this; + + this._addClass( "ui-controlgroup ui-controlgroup-" + this.options.direction ); + + if ( this.options.direction === "horizontal" ) { + this._addClass( null, "ui-helper-clearfix" ); + } + this._initWidgets(); + + children = this.childWidgets; + + // We filter here because we need to track all childWidgets not just the visible ones + if ( this.options.onlyVisible ) { + children = children.filter( ":visible" ); + } + + if ( children.length ) { + + // We do this last because we need to make sure all enhancment is done + // before determining first and last + $.each( [ "first", "last" ], function( index, value ) { + var instance = children[ value ]().data( "ui-controlgroup-data" ); + + if ( instance && that[ "_" + instance.widgetName + "Options" ] ) { + var options = that[ "_" + instance.widgetName + "Options" ]( + children.length === 1 ? "only" : value + ); + options.classes = that._resolveClassesValues( options.classes, instance ); + instance.element[ instance.widgetName ]( options ); + } else { + that._updateCornerClass( children[ value ](), value ); + } + } ); + + // Finally call the refresh method on each of the child widgets. + this._callChildMethod( "refresh" ); + } + } +} ); + +/*! + * jQuery UI Checkboxradio 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Checkboxradio +//>>group: Widgets +//>>description: Enhances a form with multiple themeable checkboxes or radio buttons. +//>>docs: https://api.jqueryui.com/checkboxradio/ +//>>demos: https://jqueryui.com/checkboxradio/ +//>>css.structure: ../../themes/base/core.css +//>>css.structure: ../../themes/base/button.css +//>>css.structure: ../../themes/base/checkboxradio.css +//>>css.theme: ../../themes/base/theme.css + + +$.widget( "ui.checkboxradio", [ $.ui.formResetMixin, { + version: "1.14.1", + options: { + disabled: null, + label: null, + icon: true, + classes: { + "ui-checkboxradio-label": "ui-corner-all", + "ui-checkboxradio-icon": "ui-corner-all" + } + }, + + _getCreateOptions: function() { + var disabled, labels, labelContents; + var options = this._super() || {}; + + // We read the type here, because it makes more sense to throw a element type error first, + // rather then the error for lack of a label. Often if its the wrong type, it + // won't have a label (e.g. calling on a div, btn, etc) + this._readType(); + + labels = this.element.labels(); + + // If there are multiple labels, use the last one + this.label = $( labels[ labels.length - 1 ] ); + if ( !this.label.length ) { + $.error( "No label found for checkboxradio widget" ); + } + + this.originalLabel = ""; + + // We need to get the label text but this may also need to make sure it does not contain the + // input itself. + // The label contents could be text, html, or a mix. We wrap all elements + // and read the wrapper's `innerHTML` to get a string representation of + // the label, without the input as part of it. + labelContents = this.label.contents().not( this.element[ 0 ] ); + + if ( labelContents.length ) { + this.originalLabel += labelContents + .clone() + .wrapAll( "
      " ) + .parent() + .html(); + } + + // Set the label option if we found label text + if ( this.originalLabel ) { + options.label = this.originalLabel; + } + + disabled = this.element[ 0 ].disabled; + if ( disabled != null ) { + options.disabled = disabled; + } + return options; + }, + + _create: function() { + var checked = this.element[ 0 ].checked; + + this._bindFormResetHandler(); + + if ( this.options.disabled == null ) { + this.options.disabled = this.element[ 0 ].disabled; + } + + this._setOption( "disabled", this.options.disabled ); + this._addClass( "ui-checkboxradio", "ui-helper-hidden-accessible" ); + this._addClass( this.label, "ui-checkboxradio-label", "ui-button ui-widget" ); + + if ( this.type === "radio" ) { + this._addClass( this.label, "ui-checkboxradio-radio-label" ); + } + + if ( this.options.label && this.options.label !== this.originalLabel ) { + this._updateLabel(); + } else if ( this.originalLabel ) { + this.options.label = this.originalLabel; + } + + this._enhance(); + + if ( checked ) { + this._addClass( this.label, "ui-checkboxradio-checked", "ui-state-active" ); + } + + this._on( { + change: "_toggleClasses", + focus: function() { + this._addClass( this.label, null, "ui-state-focus ui-visual-focus" ); + }, + blur: function() { + this._removeClass( this.label, null, "ui-state-focus ui-visual-focus" ); + } + } ); + }, + + _readType: function() { + var nodeName = this.element[ 0 ].nodeName.toLowerCase(); + this.type = this.element[ 0 ].type; + if ( nodeName !== "input" || !/radio|checkbox/.test( this.type ) ) { + $.error( "Can't create checkboxradio on element.nodeName=" + nodeName + + " and element.type=" + this.type ); + } + }, + + // Support jQuery Mobile enhanced option + _enhance: function() { + this._updateIcon( this.element[ 0 ].checked ); + }, + + widget: function() { + return this.label; + }, + + _getRadioGroup: function() { + var group; + var name = this.element[ 0 ].name; + var nameSelector = "input[name='" + CSS.escape( name ) + "']"; + + if ( !name ) { + return $( [] ); + } + + if ( this.form.length ) { + group = $( this.form[ 0 ].elements ).filter( nameSelector ); + } else { + + // Not inside a form, check all inputs that also are not inside a form + group = $( nameSelector ).filter( function() { + return $( $( this ).prop( "form" ) ).length === 0; + } ); + } + + return group.not( this.element ); + }, + + _toggleClasses: function() { + var checked = this.element[ 0 ].checked; + this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); + + if ( this.options.icon && this.type === "checkbox" ) { + this._toggleClass( this.icon, null, "ui-icon-check ui-state-checked", checked ) + ._toggleClass( this.icon, null, "ui-icon-blank", !checked ); + } + + if ( this.type === "radio" ) { + this._getRadioGroup() + .each( function() { + var instance = $( this ).checkboxradio( "instance" ); + + if ( instance ) { + instance._removeClass( instance.label, + "ui-checkboxradio-checked", "ui-state-active" ); + } + } ); + } + }, + + _destroy: function() { + this._unbindFormResetHandler(); + + if ( this.icon ) { + this.icon.remove(); + this.iconSpace.remove(); + } + }, + + _setOption: function( key, value ) { + + // We don't allow the value to be set to nothing + if ( key === "label" && !value ) { + return; + } + + this._super( key, value ); + + if ( key === "disabled" ) { + this._toggleClass( this.label, null, "ui-state-disabled", value ); + this.element[ 0 ].disabled = value; + + // Don't refresh when setting disabled + return; + } + this.refresh(); + }, + + _updateIcon: function( checked ) { + var toAdd = "ui-icon ui-icon-background "; + + if ( this.options.icon ) { + if ( !this.icon ) { + this.icon = $( "" ); + this.iconSpace = $( " " ); + this._addClass( this.iconSpace, "ui-checkboxradio-icon-space" ); + } + + if ( this.type === "checkbox" ) { + toAdd += checked ? "ui-icon-check ui-state-checked" : "ui-icon-blank"; + this._removeClass( this.icon, null, checked ? "ui-icon-blank" : "ui-icon-check" ); + } else { + toAdd += "ui-icon-blank"; + } + this._addClass( this.icon, "ui-checkboxradio-icon", toAdd ); + if ( !checked ) { + this._removeClass( this.icon, null, "ui-icon-check ui-state-checked" ); + } + this.icon.prependTo( this.label ).after( this.iconSpace ); + } else if ( this.icon !== undefined ) { + this.icon.remove(); + this.iconSpace.remove(); + delete this.icon; + } + }, + + _updateLabel: function() { + + // Remove the contents of the label ( minus the icon, icon space, and input ) + var contents = this.label.contents().not( this.element[ 0 ] ); + if ( this.icon ) { + contents = contents.not( this.icon[ 0 ] ); + } + if ( this.iconSpace ) { + contents = contents.not( this.iconSpace[ 0 ] ); + } + contents.remove(); + + this.label.append( this.options.label ); + }, + + refresh: function() { + var checked = this.element[ 0 ].checked, + isDisabled = this.element[ 0 ].disabled; + + this._updateIcon( checked ); + this._toggleClass( this.label, "ui-checkboxradio-checked", "ui-state-active", checked ); + if ( this.options.label !== null ) { + this._updateLabel(); + } + + if ( isDisabled !== this.options.disabled ) { + this._setOptions( { "disabled": isDisabled } ); + } + } + +} ] ); + +var widgetsCheckboxradio = $.ui.checkboxradio; + + +/*! + * jQuery UI Button 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Button +//>>group: Widgets +//>>description: Enhances a form with themeable buttons. +//>>docs: https://api.jqueryui.com/button/ +//>>demos: https://jqueryui.com/button/ +//>>css.structure: ../../themes/base/core.css +//>>css.structure: ../../themes/base/button.css +//>>css.theme: ../../themes/base/theme.css + + +$.widget( "ui.button", { + version: "1.14.1", + defaultElement: "
@item.Content @if (trunked) { ... } - (@Html.DisplayFor(m => item.Author), + @Html.DisplayFor(m => item.Author) posté le @item.DateCreated.ToString("dddd d MMM yyyy à H:mm") @if ((item.DateModified - item.DateCreated).Minutes > 0){  diff --git a/src/Yavsc/Views/Shared/Components/Comment/BlogPost.cshtml b/src/Yavsc/Views/Shared/Components/Comment/BlogPost.cshtml deleted file mode 100644 index 10735153..00000000 --- a/src/Yavsc/Views/Shared/Components/Comment/BlogPost.cshtml +++ /dev/null @@ -1 +0,0 @@ -@model Comment diff --git a/src/Yavsc/Views/Shared/Components/Comment/Default.cshtml b/src/Yavsc/Views/Shared/Components/Comment/Default.cshtml new file mode 100644 index 00000000..d4ff0307 --- /dev/null +++ b/src/Yavsc/Views/Shared/Components/Comment/Default.cshtml @@ -0,0 +1,16 @@ +@model Comment + +
+ @Model.Content + + @if (Model.Children!=null) { +
+ @foreach (var comment in Model.Children) + { + @await this.Component.InvokeAsync("Comment", new { id = comment.Id}); + } +
+} +
+ diff --git a/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUser.cshtml b/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUser.cshtml index 8fc95062..a9e0e52e 100644 --- a/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUser.cshtml +++ b/src/Yavsc/Views/Shared/DisplayTemplates/ApplicationUser.cshtml @@ -1,14 +1,14 @@ @model ApplicationUser @{ var avuri = "/Avatars/"+Model.UserName+".s.png"; - var userPosted = Model.Posts!=null && Model.Posts.Count()>1; + var userPosted = Model.Posts!=null && Model.Posts.Count()>=1; }
-@if (userPosted) { - +@Model.UserName -}else { - Html.LabelFor(m=>m.UserName); +} else { + Html.DisplayFor(m=>m.UserName); }
diff --git a/src/Yavsc/Views/Shared/DisplayTemplates/Comment.cshtml b/src/Yavsc/Views/Shared/DisplayTemplates/Comment.cshtml deleted file mode 100644 index 6f217fae..00000000 --- a/src/Yavsc/Views/Shared/DisplayTemplates/Comment.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -@model Comment -
- @Model.Content -
- @if (Model.Children!=null && Model.Children.Count>0) { - foreach (var comment in Model.Children) { - @Html.DisplayFor(model=>comment,"Comment","Comment") - } } -
-
diff --git a/src/Yavsc/Views/Shared/Error.cshtml b/src/Yavsc/Views/Shared/Error.cshtml index d5a8de36..3bfd9196 100644 --- a/src/Yavsc/Views/Shared/Error.cshtml +++ b/src/Yavsc/Views/Shared/Error.cshtml @@ -12,14 +12,3 @@ Request ID: @Model.RequestId

} - -

Development Mode

-

- Swapping to Development environment will display more detailed information about the error that occurred. -

-

- The Development environment shouldn't be enabled for deployed applications. - It can result in displaying sensitive information from exceptions to end users. - For local debugging, enable the Development environment by setting the ASPNETCORE_ENVIRONMENT environment variable to Development - and restarting the app. -

diff --git a/src/Yavsc/Views/Shared/_Layout.cshtml b/src/Yavsc/Views/Shared/_Layout.cshtml index b3006a56..cbd3c27b 100644 --- a/src/Yavsc/Views/Shared/_Layout.cshtml +++ b/src/Yavsc/Views/Shared/_Layout.cshtml @@ -7,15 +7,16 @@ + - - + + + + @await RenderSectionAsync("header", false) -
@RenderSection("ctxmenu", required: false) @if (ViewData["Notify"] != null) @@ -35,15 +36,13 @@
@RenderBody()
-
- - - @await RenderSectionAsync("scripts", false) + +@await RenderSectionAsync("scripts", false) diff --git a/src/Yavsc/Views/_ViewImports.cshtml b/src/Yavsc/Views/_ViewImports.cshtml index 8b6f0199..170f5786 100755 --- a/src/Yavsc/Views/_ViewImports.cshtml +++ b/src/Yavsc/Views/_ViewImports.cshtml @@ -29,7 +29,6 @@ @using Yavsc.Helpers; @using PayPal.PayPalAPIInterfaceService.Model; -@using Yavsc.Models.Access; @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Yavsc diff --git a/src/Yavsc/Yavsc.csproj b/src/Yavsc/Yavsc.csproj index 7746b6f6..9b88949f 100644 --- a/src/Yavsc/Yavsc.csproj +++ b/src/Yavsc/Yavsc.csproj @@ -1,48 +1,45 @@ - + net8.0 enable enable WTFPL + 76e56fc2-1619-40d8-8393-365258b7a21d - + all - + all - - - + + - - - - - - + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + + - - - - - + - - + + + diff --git a/src/Yavsc/app.config b/src/Yavsc/app.config deleted file mode 100644 index 8460dd43..00000000 --- a/src/Yavsc/app.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/Yavsc/appsettings.json b/src/Yavsc/appsettings.json index 416d75aa..0a6d4832 100644 --- a/src/Yavsc/appsettings.json +++ b/src/Yavsc/appsettings.json @@ -9,13 +9,13 @@ }, "AllowedHosts": "*", "ConnectionStrings": { - "Default": "Server=[YOURSERVERNAME];Port=5432;Database=[YOURDBNAME];Username=[YOURDBUSERNAME];Password=[YOURDBPASSW];" + "DefaultConnection": "Server=[YOURSERVERNAME];Port=5432;Database=[YOURDBNAME];Username=[YOURDBUSERNAME];Password=[YOURDBPASSW];" }, "Site": { "Title": "Yavsc", "Slogan": "Yavsc!", "StyleSheet": "/css/default.css", - "Authority": "http://127.0.0.1:5000/", + "Authority": "https://127.0.0.1:5001/", "Owner": { "Name": "[Site owner's name]", "EMail": "[Site owner's e-mail address]" diff --git a/src/Yavsc/package.json b/src/Yavsc/package.json deleted file mode 100644 index 545fc0a6..00000000 --- a/src/Yavsc/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "yavsc", - "version": "1.0.7", - "description": "Yet Another Very Small Company", - "repository": { - "type": "Git", - "url": "https://github.com/pazof/yavsc" - }, - "license": "GPL-3.0", - "devDependencies": {}, - "dependencies": { - "paypal-permissions-sdk": "^1.0.10" - } -} diff --git a/src/Yavsc/wwwroot/css/site.css b/src/Yavsc/wwwroot/css/site.css index faf983f2..e62c7f4e 100644 --- a/src/Yavsc/wwwroot/css/site.css +++ b/src/Yavsc/wwwroot/css/site.css @@ -24,3 +24,14 @@ div.carousel-inner > div.item > div.carousel-caption-s { img.blogphoto { max-width: 100%; max-height: 100%; } + +.cmtdatetime { + font-style: italic; + font-size: x-small; + } + +.blogcomment { + display: inline-block; + padding: .3em; + border: solid black 1px; +} diff --git a/src/Yavsc/wwwroot/images/it/sofwarelibre.svg b/src/Yavsc/wwwroot/images/it/sofwarelibre.svg new file mode 100644 index 00000000..2f76d2ee --- /dev/null +++ b/src/Yavsc/wwwroot/images/it/sofwarelibre.svg @@ -0,0 +1,1126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + + + + + + + + + diff --git a/src/Yavsc/wwwroot/jquery-ui-1.14.1.custom.zip b/src/Yavsc/wwwroot/jquery-ui-1.14.1.custom.zip new file mode 100644 index 00000000..6a357a03 Binary files /dev/null and b/src/Yavsc/wwwroot/jquery-ui-1.14.1.custom.zip differ diff --git a/src/Yavsc/wwwroot/js/comment.js b/src/Yavsc/wwwroot/js/comment.js index 3ad257d1..889e7d87 100644 --- a/src/Yavsc/wwwroot/js/comment.js +++ b/src/Yavsc/wwwroot/js/comment.js @@ -1,10 +1,4 @@ -if (typeof jQuery === 'undefined') { - throw new Error('Bootstrap\'s JavaScript requires jQuery') -} - -+ -(function($) { - $.widget("psc.blogcomment", { +$.widget("psc.blogcomment", { options: { apictrlr: null, authorId: null, @@ -31,21 +25,22 @@ if (typeof jQuery === 'undefined') { var date = new Date(this.element.data("date")); var username = this.element.data("username"); this.editable = this.element.data("allow-edit"); - this.element.prepend('
' + username + '
' + + this.element.prepend('
' + date.toLocaleDateString(this.options.lang) + ' ' + date.toLocaleTimeString(this.options.lang) + '
') this.element.on("mouseenter", this.onMouseEnter); this.element.on("mouseleave", this.onMouseLeave); - this.ctlBtn = $('').on("click", function(ev) { _this.toggleCollapse(_this, ev) }).appendTo(_this.element); + this.ctlBtn = $('').on("click", function(ev) { _this.toggleCollapse(_this, ev) }).appendTo(_this.element); }, toggleCollapse: function(_this, ev) { _this.collapsed = !_this.collapsed; + var icon = $(_this.ctlBtn).children().first(); if (_this.collapsed) { - $(_this.ctlBtn).removeClass('glyphicon-collapse-down'); - $(_this.ctlBtn).addClass('glyphicon-collapse-up'); + icon.removeClass('ui-icon-plus'); + icon.addClass('ui-icon-minus'); } else { - $(_this.ctlBtn).removeClass('glyphicon-collapse-up'); - $(_this.ctlBtn).addClass('glyphicon-collapse-down'); + icon.removeClass('ui-icon-minus'); + icon.addClass('ui-icon-plus'); } if (_this.editable) { _this.toggleEdit(_this, ev) @@ -95,8 +90,6 @@ if (typeof jQuery === 'undefined') { }, 400); }, doDeleteComment: function(_this, ev) { - var cmtid = $(_this.element).data("id"); - var cmtapi = _this.options.apictrlr; $.ajax({ async: true, cache: false, @@ -110,17 +103,17 @@ if (typeof jQuery === 'undefined') { success: function(data) { _this.element.remove() }, - url: cmtapi + '/' + cmtid + url: _this.options.apictrlr + '/' + $(_this.element).data("id") }); }, doCoC: function(_this, ev) { - var postid = $('#cmtBtn').data('receiverid'); + var postId = this.element.data('receiver-id'); var comment = _this.cmtInput.val(); - var cmtid = $(_this.element).data("id"); + var cmtId = $(_this.element).data("id"); var data = { Content: comment, - PostId: postid, - ParentId: cmtid, + ReceiverId: postId, + ParentId: cmtId, AuthorId: _this.options.authorId }; @@ -141,11 +134,9 @@ if (typeof jQuery === 'undefined') { ) }, success: function(data) { - var comment = data.Content; _this.cmtInput.val(''); $('span.field-validation-valid[data-valmsg-for="Content"]').empty(); - var htmlcmt = htmlize(comment); - $('
' + htmlcmt + '
') + $('
' + comment + '
') .blogcomment().appendTo(_this.subCmts); }, url: _this.options.apictrlr @@ -155,7 +146,8 @@ if (typeof jQuery === 'undefined') { }); - $(document).ready(function() { + jQuery(function() { $("[data-type='blogcomment']").blogcomment(); }) -})(jQuery); \ No newline at end of file + + diff --git a/src/Yavsc/wwwroot/js/comment.min.js b/src/Yavsc/wwwroot/js/comment.min.js deleted file mode 100644 index 694e240c..00000000 --- a/src/Yavsc/wwwroot/js/comment.min.js +++ /dev/null @@ -1 +0,0 @@ -if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(l){l.widget("psc.blogcomment",{options:{apictrlr:null,authorId:null,authorName:null,omob:"#ffe08030",omof:"#501208",bgc:"#fff",fgc:"#000",lang:"fr-FR",allowCoc:!0},editable:!1,editting:!1,hideBtn:null,delBtn:null,cmtInput:null,cmtBtn:null,ctlBtn:null,collapsed:!1,subCmts:null,_create:function(){var e=this;this.element.addClass("blogcomment");var t=new Date(this.element.data("date")),o=this.element.data("username");this.editable=this.element.data("allow-edit"),this.element.prepend('
'+o+'
'+t.toLocaleDateString(this.options.lang)+" "+t.toLocaleTimeString(this.options.lang)+"
"),this.element.on("mouseenter",this.onMouseEnter),this.element.on("mouseleave",this.onMouseLeave),this.ctlBtn=l('').on("click",function(t){e.toggleCollapse(e,t)}).appendTo(e.element)},toggleCollapse:function(t,e){t.collapsed=!t.collapsed,t.collapsed?(l(t.ctlBtn).removeClass("glyphicon-collapse-down"),l(t.ctlBtn).addClass("glyphicon-collapse-up")):(l(t.ctlBtn).removeClass("glyphicon-collapse-up"),l(t.ctlBtn).addClass("glyphicon-collapse-down")),t.editable&&t.toggleEdit(t,e),t.options.allowCoc&&t.toggleComment(t,e)},toggleEdit:function(e,t){e.delBtn?(e.delBtn.remove(),e.delBtn=null):(e.delBtn=l(''),e.delBtn.on("click",function(t){e.doDeleteComment(e,t)}).appendTo(e.element))},toggleComment:function(e,t){e.cmtBtn?(e.cmtInput.remove(),e.cmtBtn.remove(),e.cmtBtn=null):(e.subCmts||(e.subCmts=l(e.element).children("div.subcomments"),0==e.subCmts.length&&(e.subCmts=l("
").addClass("subcomments"),e.subCmts.appendTo(e.element))),e.cmtInput=l(''),e.cmtInput.appendTo(e.element),e.cmtBtn=l(''),e.cmtBtn.on("click",function(t){e.doCoC(e,t)}).appendTo(e.element))},onMouseEnter:function(){l(this).animate({backgroundColor:l.psc.blogcomment.prototype.options.omob,color:l.psc.blogcomment.prototype.options.omof},400)},onMouseLeave:function(){l(this).animate({backgroundColor:l.psc.blogcomment.prototype.options.bgc,color:l.psc.blogcomment.prototype.options.fgc},400)},doDeleteComment:function(e,t){var o=l(e.element).data("id"),n=e.options.apictrlr;l.ajax({async:!0,cache:!1,type:"POST",method:"DELETE",error:function(t,e){l('span.field-validation-valid[data-valmsg-for="Content"]').html("Une erreur est survenue : "+t.status+"
").focus()},success:function(t){e.element.remove()},url:n+"/"+o})},doCoC:function(n,t){var e=l("#cmtBtn").data("receiverid"),o={Content:n.cmtInput.val(),PostId:e,ParentId:l(n.element).data("id"),AuthorId:n.options.authorId};l.ajax({async:!0,cache:!1,type:"POST",method:"POST",contentType:"application/json",data:JSON.stringify(o),error:function(t,e){console.log("err"),console.log(t),console.log(e),l('span.field-validation-valid[data-valmsg-for="Content"]').html("Une erreur est survenue : "+t.status+"
"+t.responseText+"
")},success:function(t){var e=t.Content;n.cmtInput.val(""),l('span.field-validation-valid[data-valmsg-for="Content"]').empty();var o=htmlize(e);l('
'+o+"
").blogcomment().appendTo(n.subCmts)},url:n.options.apictrlr})}}),l(document).ready(function(){l("[data-type='blogcomment']").blogcomment()})}(jQuery); \ No newline at end of file diff --git a/src/Yavsc/wwwroot/js/dash.all.min.js b/src/Yavsc/wwwroot/js/dash.all.min.js deleted file mode 100644 index 3883d0a5..00000000 --- a/src/Yavsc/wwwroot/js/dash.all.min.js +++ /dev/null @@ -1,19 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.dashjs=t():e.dashjs=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=104)}([function(e,t,n){"use strict";function r(e,t){for(var n=0;n0&&(r+=" ");for(var s=arguments.length,u=new Array(s>2?s-2:0),l=2;l=e&&g[e](r),p&&p.get().debug.dispatchEvent&&h.trigger(i.a.LOG,{message:r,level:e})}return t={getLogger:function(e){return{fatal:y.bind(e),error:E.bind(e),warn:_.bind(e),info:v.bind(e),debug:T.bind(e)}},setLogTimestampVisible:function(e){n=e},setCalleeNameVisible:function(e){a=e}},n=!0,a=!0,f=(new Date).getTime(),"undefined"!=typeof window&&window.console&&(g[o]=m(window.console.error),g[s]=m(window.console.error),g[u]=m(window.console.warn),g[l]=m(window.console.info),g[c]=m(window.console.debug)),t}f.__dashjs_factory_name="Debug";var d=a.a.getSingletonFactory(f);d.LOG_LEVEL_NONE=0,d.LOG_LEVEL_FATAL=o,d.LOG_LEVEL_ERROR=s,d.LOG_LEVEL_WARNING=u,d.LOG_LEVEL_INFO=l,d.LOG_LEVEL_DEBUG=c,a.a.updateSingletonFactory(f.__dashjs_factory_name,d),t.a=d},function(e,t,n){"use strict";var r=n(3),i=n(4);function a(){var e={};function t(t,n,r){var i=-1;return e[t]?(e[t].some((function(e,t){if(e&&e.callback===n&&(!r||r===e.scope))return i=t,!0})),i):i}return{on:function(n,r,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(!n)throw new Error("event type cannot be null or undefined");if(!r||"function"!=typeof r)throw new Error("listener must be a function: "+r);var o=a.priority||0;if(!(t(n,r,i)>=0)){e[n]=e[n]||[];var s={callback:r,scope:i,priority:o};i&&i.getStreamId&&(s.streamId=i.getStreamId()),i&&i.getType&&(s.mediaType=i.getType()),a&&a.mode&&(s.mode=a.mode);var u=e[n].some((function(t,r){if(t&&o>t.priority)return e[n].splice(r,0,s),!0}));u||e[n].push(s)}},off:function(n,r,i){if(n&&r&&e[n]){var a=t(n,r,i);a<0||(e[n][a]=null)}},trigger:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(t&&e[t]){if((n=n||{}).hasOwnProperty("type"))throw new Error("'type' is a reserved word for event dispatching");n.type=t,r.streamId&&(n.streamId=r.streamId),r.mediaType&&(n.mediaType=r.mediaType),e[t].filter((function(e){return!!e&&((!r.streamId||!e.streamId||e.streamId===r.streamId)&&((!r.mediaType||!e.mediaType||e.mediaType===r.mediaType)&&!(r.mode&&e.mode&&e.mode!==r.mode||!e.mode&&r.mode&&r.mode===i.a.EVENT_MODE_ON_RECEIVE)))})).forEach((function(e){return e&&e.callback.call(e.scope,n)}))}},reset:function(){e={}}}}a.__dashjs_factory_name="EventBus";var o=r.a.getSingletonFactory(a);o.EVENT_PRIORITY_LOW=0,o.EVENT_PRIORITY_HIGH=5e3,r.a.updateSingletonFactory(a.__dashjs_factory_name,o),t.a=o},function(e,t,n){"use strict";t.a=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.code=t||null,this.message=n||null,this.data=r||null}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var i=s(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return o(this,n)}}function o(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var u=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(n,e);var t=a(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE=10,e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE=11,e.XLINK_LOADER_LOADING_FAILURE_ERROR_CODE=12,e.SEGMENT_BASE_LOADER_ERROR_CODE=15,e.TIME_SYNC_FAILED_ERROR_CODE=16,e.FRAGMENT_LOADER_LOADING_FAILURE_ERROR_CODE=17,e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_CODE=18,e.URL_RESOLUTION_FAILED_GENERIC_ERROR_CODE=19,e.APPEND_ERROR_CODE=20,e.REMOVE_ERROR_CODE=21,e.DATA_UPDATE_FAILED_ERROR_CODE=22,e.CAPABILITY_MEDIASOURCE_ERROR_CODE=23,e.CAPABILITY_MEDIAKEYS_ERROR_CODE=24,e.DOWNLOAD_ERROR_ID_MANIFEST_CODE=25,e.DOWNLOAD_ERROR_ID_SIDX_CODE=26,e.DOWNLOAD_ERROR_ID_CONTENT_CODE=27,e.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE=28,e.DOWNLOAD_ERROR_ID_XLINK_CODE=29,e.MANIFEST_ERROR_ID_PARSE_CODE=31,e.MANIFEST_ERROR_ID_NOSTREAMS_CODE=32,e.TIMED_TEXT_ERROR_ID_PARSE_CODE=33,e.MANIFEST_ERROR_ID_MULTIPLEXED_CODE=34,e.MEDIASOURCE_TYPE_UNSUPPORTED_CODE=35,e.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE="parsing failed for ",e.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading manifest: ",e.XLINK_LOADER_LOADING_FAILURE_ERROR_MESSAGE="Failed loading Xlink element: ",e.SEGMENTS_UPDATE_FAILED_ERROR_MESSAGE="Segments update failed",e.SEGMENTS_UNAVAILABLE_ERROR_MESSAGE="no segments are available yet",e.SEGMENT_BASE_LOADER_ERROR_MESSAGE="error loading segment ranges from sidx",e.TIME_SYNC_FAILED_ERROR_MESSAGE="Failed to synchronize client and server time",e.FRAGMENT_LOADER_NULL_REQUEST_ERROR_MESSAGE="request is null",e.URL_RESOLUTION_FAILED_GENERIC_ERROR_MESSAGE="Failed to resolve a valid URL",e.APPEND_ERROR_MESSAGE="chunk is not defined",e.REMOVE_ERROR_MESSAGE="Removing data from the SourceBuffer",e.DATA_UPDATE_FAILED_ERROR_MESSAGE="Data update failed",e.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE="mediasource is not supported",e.CAPABILITY_MEDIAKEYS_ERROR_MESSAGE="mediakeys is not supported",e.TIMED_TEXT_ERROR_MESSAGE_PARSE="parsing error :",e.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE="Error creating source buffer of type : ",e}return n}(n(24).a));t.a=u},function(e,t,n){"use strict";n.d(t,"e",(function(){return a})),n.d(t,"c",(function(){return o})),n.d(t,"d",(function(){return s})),n.d(t,"a",(function(){return c})),n.d(t,"b",(function(){return f}));var r=n(27);function i(e,t){for(;e.lengthr&&o=a)}return!0}function c(e,t,n,r){var i,a,o;i=n.segmentDuration,isNaN(i)&&(i=n.adaptation.period.duration),a=parseFloat((n.adaptation.period.start+r*i).toFixed(5)),o=parseFloat((a+i).toFixed(5));var s=u(n,i,a,e.calcMediaTimeFromPresentationTime(a,n),e,o,t,r);return l(e,n,s,t)?s:null}function f(e,t,n,r,i,a,o,c,f,d){var h,p,g=r/a,m=i/a;return h=e.calcPresentationTimeFromMediaTime(g,n),l(e,n,p=u(n,m,h,g,e,h+m,t,f),t)?(p.replacementTime=d||r,o=s(o,"Number",p.replacementNumber),o=s(o,"Time",p.replacementTime),p.media=o,p.mediaRange=c,p):null}},function(e,t,n){"use strict";var r=n(3);function i(){var e,t=/^[a-z][a-z0-9+\-_.]*:/i,n=/^https?:\/\//i,r=/^https:\/\//i,i=/^([a-z][a-z0-9+\-_.]*:\/\/[^\/]+)\/?/i,a=function(e,t){try{return new window.URL(e,t).toString()}catch(t){return e}},o=function(e,t){var n=s;if(!t)return e;if(!c(e))return e;f(e)&&(n=u),d(e)&&(n=l);var r=n(t),i="/"!==r.charAt(r.length-1)&&"/"!==e.charAt(0)?"/":"";return[r,e].join(i)};function s(e){var t=e.indexOf("/"),n=e.lastIndexOf("/");return-1!==t?n===t+1?e:(-1!==e.indexOf("?")&&(e=e.substring(0,e.indexOf("?"))),e.substring(0,n+1)):""}function u(e){var t=e.match(i);return t?t[1]:""}function l(e){var n=e.match(t);return n?n[0]:""}function c(e){return!t.test(e)}function f(e){return c(e)&&"/"===e.charAt(0)}function d(e){return 0===e.indexOf("//")}return function(){try{new window.URL("x","http://y");e=a}catch(e){}finally{e=e||o}}(),{parseBaseUrl:s,parseOrigin:u,parseScheme:l,isRelative:c,isPathAbsolute:f,isSchemeRelative:d,isHTTPURL:function(e){return n.test(e)},isHTTPS:function(e){return r.test(e)},removeHostname:function(e){return/^(?:\w+\:\/\/)?([^\/]+)(.*)$/.exec(e)[2].substring(1)},resolve:function(t,n){return e(t,n)}}}i.__dashjs_factory_name="DefaultURLUtils";var a=r.a.getSingletonFactory(i);function o(){var e,t=[],n=this.context;function r(n,r,i){var a=function(n){var r;for(r=0;r0&&(t[a.substring(0,o)]=a.substring(o+2))}return t}},{key:"generateUuid",value:function(){var e=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"==t?n:3&n|8).toString(16)}))}},{key:"generateHashCode",value:function(e){var t=0;if(0===e.length)return t;for(var n=0;n=e-n}))}function m(e,t){t<=e+.5||(r=r.filter((function(n){var r=p(n);return isNaN(n.startTime)||n.startTime>=t-r||isNaN(n.duration)||n.startTime+n.duration<=e+r})))}function y(e,t,n){for(var r=e.length-1;r>=0;r--){var i=e[r],a=i.startTime,o=a+i.duration;if(n=isNaN(n)?p(i):n,!isNaN(a)&&!isNaN(o)&&t+n>=a&&t-n0&&m(n,t)}else g()},abortRequests:function(){n.debug("abort requests"),l.abort(),a=[]},executeRequest:function(e){switch(e.action){case i.a.ACTION_DOWNLOAD:E(e,"loading"),a.push(e),function(e){o.trigger(s.FRAGMENT_LOADING_STARTED,{request:e},{streamId:f.id,mediaType:d}),l.load(e)}(e);break;default:n.warn("Unknown request action.")}},reset:function(){o.off(s.LOADING_COMPLETED,_,this),o.off(s.LOADING_DATA_PROGRESS,v,this),o.off(s.LOADING_ABANDONED,T,this),l&&l.reset(),S()},resetInitialSettings:S,addExecutedRequest:function(e){r.push(e)}},n=c.getLogger(t),S(),o.on(s.LOADING_COMPLETED,_,t),o.on(s.LOADING_DATA_PROGRESS,v,t),o.on(s.LOADING_ABANDONED,T,t),t}a.__dashjs_factory_name="FragmentModel";var o=r.a.getClassFactory(a);o.FRAGMENT_MODEL_LOADING="loading",o.FRAGMENT_MODEL_EXECUTED="executed",o.FRAGMENT_MODEL_CANCELED="canceled",o.FRAGMENT_MODEL_FAILED="failed",r.a.updateClassFactory(a.__dashjs_factory_name,o),t.a=o},function(e,t,n){"use strict";var r=n(3),i=n(41);function a(e){e=e||{};var t,n,r=this.context;return t=Object(i.a)(r).getInstance(),{load:function(i){var a=t.getLoader(i&&i.request?i.request.url:null);(n=a(r).create({errHandler:e.errHandler,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,dashMetrics:e.dashMetrics,boxParser:e.boxParser?e.boxParser:null,constants:e.constants?e.constants:null,dashConstants:e.dashConstants?e.dashConstants:null,urlUtils:e.urlUtils?e.urlUtils:null,requestTimeout:isNaN(e.requestTimeout)?0:e.requestTimeout,errors:e.errors})).load(i)},abort:function(){n&&n.abort()}}}a.__dashjs_factory_name="URLLoader";var o=r.a.getClassFactory(a);t.a=o},function(e,t,n){"use strict";var r=n(6);function i(e,t){for(var n=0;n0?n[n.length-1]:null}}}s.__dashjs_factory_name="IsoFile";var u=o.a.getClassFactory(s),l=n(22),c=n.n(l);var f=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.lastCompletedOffset=t,this.found=n,this.size=r};function d(){var e,t,n=this.context;function i(e){if(!e)return null;void 0===e.fileStart&&(e.fileStart=0);var t=c.a.parseBuffer(e),r=u(n).create();return r.setData(t),r}function a(e,t){return e[t+3]>>>0|e[t+2]<<8>>>0|e[t+1]<<16>>>0|e[t]<<24>>>0}function o(e,t){return String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t++])+String.fromCharCode(e[t])}return t={parse:i,findLastTopIsoBoxCompleted:function(e,t,n){if(void 0===n&&(n=0),!t||n+8>=t.byteLength)return new f(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,s=0;n=0?r=new f(n,!0,u):s=n+u),n+=u}return r||new f(s,!1)},getMediaTimescaleFromMoov:function(e){var t=i(e),n=t?t.getBox("mdhd"):void 0;return n?n.timescale:NaN},getSamplesInfo:function(e){if(!e||0===e.byteLength)return{sampleList:[],lastSequenceNumber:NaN,totalDuration:NaN,numSequences:NaN};var t,n,r,a,o,s,u,l,c,f,d,h,p,g,m,y,E=i(e),_=E.getBoxes("moof"),v=E.getBoxes("mfhd");m=E.getBoxes("moof").length,g=v[v.length-1].sequence_number,n=0,o=[];var T=-1,S=-1;for(f=0;f<_.length;f++){var A=_[f],b=A.getChildBoxes("traf");for(l=0;lS&&(T++,S+=M.entries[T].sample_delta),u==S){O.subSizes=[];var P=M.entries[T];for(h=0;h=t.byteLength)return new f(0,!1);for(var r,i=t instanceof ArrayBuffer?new Uint8Array(t):t,s=0;n=0?r=new f(n,!0,u,l):s=n+u),n+=u}return r||new f(s,!1)}},e=Object(r.a)(n).getInstance().getLogger(t),t}d.__dashjs_factory_name="BoxParser";t.a=o.a.getSingletonFactory(d)},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){ -/*! codem-isoboxer v0.3.6 https://github.com/madebyhiro/codem-isoboxer/blob/master/LICENSE.txt */ -var r={parseBuffer:function(e){return new i(e).parse()},addBoxProcessor:function(e,t){"string"==typeof e&&"function"==typeof t&&(a.prototype._boxProcessors[e]=t)},createFile:function(){return new i},createBox:function(e,t,n){var r=a.create(e);return t&&t.append(r,n),r},createFullBox:function(e,t,n){var i=r.createBox(e,t,n);return i.version=0,i.flags=0,i},Utils:{}};r.Utils.dataViewToString=function(e,t){var n=t||"utf-8";if("undefined"!=typeof TextDecoder)return new TextDecoder(n).decode(e);var r=[],i=0;if("utf-8"===n)for(;i>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},r.Utils.appendBox=function(e,t,n){if(t._offset=e._cursor.offset,t._root=e._root?e._root:e,t._raw=e._raw,t._parent=e,-1!==n)if(null!=n){var r,i=-1;if("number"==typeof n)i=n;else{if("string"==typeof n)r=n;else{if("object"!=typeof n||!n.type)return void e.boxes.push(t);r=n.type}for(var a=0;a>3,t},a.prototype._readUint=function(e){var t,n,r=null,i=this._cursor.offset-this._raw.byteOffset;switch(e){case 8:r=this._raw.getUint8(i);break;case 16:r=this._raw.getUint16(i);break;case 24:r=((t=this._raw.getUint16(i))<<8)+(n=this._raw.getUint8(i+2));break;case 32:r=this._raw.getUint32(i);break;case 64:t=this._raw.getUint32(i),n=this._raw.getUint32(i+4),r=t*Math.pow(2,32)+n}return this._cursor.offset+=e>>3,r},a.prototype._readString=function(e){for(var t="",n=0;n0?e:this._raw.byteLength-(this._cursor.offset-this._offset);if(t>0){var n=new Uint8Array(this._raw.buffer,this._cursor.offset,t);return this._cursor.offset+=t,n}return null},a.prototype._readUTF8String=function(){var e=this._raw.byteLength-(this._cursor.offset-this._offset),t=null;return e>0&&(t=new DataView(this._raw.buffer,this._cursor.offset,e),this._cursor.offset+=e),t?r.Utils.dataViewToString(t):t},a.prototype._parseBox=function(){if(this._parsing=!0,this._cursor.offset=this._offset,this._offset+8>this._raw.buffer.byteLength)this._root._incomplete=!0;else{switch(this._procField("size","uint",32),this._procField("type","string",4),1===this.size&&this._procField("largesize","uint",64),"uuid"===this.type&&this._procFieldArray("usertype",16,"uint",8),this.size){case 0:this._raw=new DataView(this._raw.buffer,this._offset,this._raw.byteLength-this._cursor.offset+8);break;case 1:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.largesize);break;default:this._offset+this.size>this._raw.buffer.byteLength?(this._incomplete=!0,this._root._incomplete=!0):this._raw=new DataView(this._raw.buffer,this._offset,this.size)}this._incomplete||(this._boxProcessors[this.type]&&this._boxProcessors[this.type].call(this),-1!==this._boxContainers.indexOf(this.type)?this._parseContainerBox():this._data=this._readData())}},a.prototype._parseFullBox=function(){this.version=this._readUint(8),this.flags=this._readUint(24)},a.prototype._parseContainerBox=function(){for(this.boxes=[];this._cursor.offset-this._raw.byteOffset>3}else this.size+=e>>3},a.prototype._writeUint=function(e,t){if(this._rawo){var n,r,i=this._cursor.offset-this._rawo.byteOffset;switch(e){case 8:this._rawo.setUint8(i,t);break;case 16:this._rawo.setUint16(i,t);break;case 24:n=(16776960&t)>>8,r=255&t,this._rawo.setUint16(i,n),this._rawo.setUint8(i+2,r);break;case 32:this._rawo.setUint32(i,t);break;case 64:r=t-(n=Math.floor(t/Math.pow(2,32)))*Math.pow(2,32),this._rawo.setUint32(i,n),this._rawo.setUint32(i+4,r)}this._cursor.offset+=e>>3}else this.size+=e>>3},a.prototype._writeString=function(e,t){for(var n=0;n>10&31),96+(this.language>>5&31),96+(31&this.language))),this._procField("pre_defined","uint",16)},a.prototype._boxProcessors.mehd=function(){this._procFullBox(),this._procField("fragment_duration","uint",1==this.version?64:32)},a.prototype._boxProcessors.mfhd=function(){this._procFullBox(),this._procField("sequence_number","uint",32)},a.prototype._boxProcessors.mfro=function(){this._procFullBox(),this._procField("mfra_size","uint",32)},a.prototype._boxProcessors.mp4a=a.prototype._boxProcessors.enca=function(){this._procFieldArray("reserved1",6,"uint",8),this._procField("data_reference_index","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procField("channelcount","uint",16),this._procField("samplesize","uint",16),this._procField("pre_defined","uint",16),this._procField("reserved3","uint",16),this._procField("samplerate","template",32),this._procField("esds","data",-1)},a.prototype._boxProcessors.mvhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("timescale","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procField("rate","template",32),this._procField("volume","template",16),this._procField("reserved1","uint",16),this._procFieldArray("reserved2",2,"uint",32),this._procFieldArray("matrix",9,"template",32),this._procFieldArray("pre_defined",6,"uint",32),this._procField("next_track_ID","uint",32)},a.prototype._boxProcessors.payl=function(){this._procField("cue_text","utf8")},a.prototype._boxProcessors.pssh=function(){this._procFullBox(),this._procFieldArray("SystemID",16,"uint",8),this._procField("DataSize","uint",32),this._procFieldArray("Data",this.DataSize,"uint",8)},a.prototype._boxProcessors.schm=function(){this._procFullBox(),this._procField("scheme_type","uint",32),this._procField("scheme_version","uint",32),1&this.flags&&this._procField("scheme_uri","string",-1)},a.prototype._boxProcessors.sdtp=function(){this._procFullBox();var e=-1;this._parsing&&(e=this._raw.byteLength-(this._cursor.offset-this._raw.byteOffset)),this._procFieldArray("sample_dependency_table",e,"uint",8)},a.prototype._boxProcessors.sidx=function(){this._procFullBox(),this._procField("reference_ID","uint",32),this._procField("timescale","uint",32),this._procField("earliest_presentation_time","uint",1==this.version?64:32),this._procField("first_offset","uint",1==this.version?64:32),this._procField("reserved","uint",16),this._procField("reference_count","uint",16),this._procEntries("references",this.reference_count,(function(e){this._parsing||(e.reference=(1&e.reference_type)<<31,e.reference|=2147483647&e.referenced_size,e.sap=(1&e.starts_with_SAP)<<31,e.sap|=(3&e.SAP_type)<<28,e.sap|=268435455&e.SAP_delta_time),this._procEntryField(e,"reference","uint",32),this._procEntryField(e,"subsegment_duration","uint",32),this._procEntryField(e,"sap","uint",32),this._parsing&&(e.reference_type=e.reference>>31&1,e.referenced_size=2147483647&e.reference,e.starts_with_SAP=e.sap>>31&1,e.SAP_type=e.sap>>28&7,e.SAP_delta_time=268435455&e.sap)}))},a.prototype._boxProcessors.smhd=function(){this._procFullBox(),this._procField("balance","uint",16),this._procField("reserved","uint",16)},a.prototype._boxProcessors.ssix=function(){this._procFullBox(),this._procField("subsegment_count","uint",32),this._procEntries("subsegments",this.subsegment_count,(function(e){this._procEntryField(e,"ranges_count","uint",32),this._procSubEntries(e,"ranges",e.ranges_count,(function(e){this._procEntryField(e,"level","uint",8),this._procEntryField(e,"range_size","uint",24)}))}))},a.prototype._boxProcessors.stsd=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procSubBoxes("entries",this.entry_count)},a.prototype._boxProcessors.subs=function(){this._procFullBox(),this._procField("entry_count","uint",32),this._procEntries("entries",this.entry_count,(function(e){this._procEntryField(e,"sample_delta","uint",32),this._procEntryField(e,"subsample_count","uint",16),this._procSubEntries(e,"subsamples",e.subsample_count,(function(e){this._procEntryField(e,"subsample_size","uint",1===this.version?32:16),this._procEntryField(e,"subsample_priority","uint",8),this._procEntryField(e,"discardable","uint",8),this._procEntryField(e,"codec_specific_parameters","uint",32)}))}))},a.prototype._boxProcessors.tenc=function(){this._procFullBox(),this._procField("default_IsEncrypted","uint",24),this._procField("default_IV_size","uint",8),this._procFieldArray("default_KID",16,"uint",8)},a.prototype._boxProcessors.tfdt=function(){this._procFullBox(),this._procField("baseMediaDecodeTime","uint",1==this.version?64:32)},a.prototype._boxProcessors.tfhd=function(){this._procFullBox(),this._procField("track_ID","uint",32),1&this.flags&&this._procField("base_data_offset","uint",64),2&this.flags&&this._procField("sample_description_offset","uint",32),8&this.flags&&this._procField("default_sample_duration","uint",32),16&this.flags&&this._procField("default_sample_size","uint",32),32&this.flags&&this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.tfra=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._parsing||(this.reserved=0,this.reserved|=(48&this.length_size_of_traf_num)<<4,this.reserved|=(12&this.length_size_of_trun_num)<<2,this.reserved|=3&this.length_size_of_sample_num),this._procField("reserved","uint",32),this._parsing&&(this.length_size_of_traf_num=(48&this.reserved)>>4,this.length_size_of_trun_num=(12&this.reserved)>>2,this.length_size_of_sample_num=3&this.reserved),this._procField("number_of_entry","uint",32),this._procEntries("entries",this.number_of_entry,(function(e){this._procEntryField(e,"time","uint",1===this.version?64:32),this._procEntryField(e,"moof_offset","uint",1===this.version?64:32),this._procEntryField(e,"traf_number","uint",8*(this.length_size_of_traf_num+1)),this._procEntryField(e,"trun_number","uint",8*(this.length_size_of_trun_num+1)),this._procEntryField(e,"sample_number","uint",8*(this.length_size_of_sample_num+1))}))},a.prototype._boxProcessors.tkhd=function(){this._procFullBox(),this._procField("creation_time","uint",1==this.version?64:32),this._procField("modification_time","uint",1==this.version?64:32),this._procField("track_ID","uint",32),this._procField("reserved1","uint",32),this._procField("duration","uint",1==this.version?64:32),this._procFieldArray("reserved2",2,"uint",32),this._procField("layer","uint",16),this._procField("alternate_group","uint",16),this._procField("volume","template",16),this._procField("reserved3","uint",16),this._procFieldArray("matrix",9,"template",32),this._procField("width","template",32),this._procField("height","template",32)},a.prototype._boxProcessors.trex=function(){this._procFullBox(),this._procField("track_ID","uint",32),this._procField("default_sample_description_index","uint",32),this._procField("default_sample_duration","uint",32),this._procField("default_sample_size","uint",32),this._procField("default_sample_flags","uint",32)},a.prototype._boxProcessors.trun=function(){this._procFullBox(),this._procField("sample_count","uint",32),1&this.flags&&this._procField("data_offset","int",32),4&this.flags&&this._procField("first_sample_flags","uint",32),this._procEntries("samples",this.sample_count,(function(e){256&this.flags&&this._procEntryField(e,"sample_duration","uint",32),512&this.flags&&this._procEntryField(e,"sample_size","uint",32),1024&this.flags&&this._procEntryField(e,"sample_flags","uint",32),2048&this.flags&&this._procEntryField(e,"sample_composition_time_offset",1===this.version?"int":"uint",32)}))},a.prototype._boxProcessors["url "]=a.prototype._boxProcessors["urn "]=function(){this._procFullBox(),"urn "===this.type&&this._procField("name","string",-1),this._procField("location","string",-1)},a.prototype._boxProcessors.vlab=function(){this._procField("source_label","utf8")},a.prototype._boxProcessors.vmhd=function(){this._procFullBox(),this._procField("graphicsmode","uint",16),this._procFieldArray("opcolor",3,"uint",16)},a.prototype._boxProcessors.vttC=function(){this._procField("config","utf8")},a.prototype._boxProcessors.vtte=function(){}},function(e,t,n){"use strict";var r=n(3);function i(){return{modifyRequestURL:function(e){return e},modifyRequestHeader:function(e){return e}}}i.__dashjs_factory_name="RequestModifier",t.a=r.a.getSingletonFactory(i)},function(e,t,n){"use strict";function r(e,t){for(var n=0;n1)for(var n=1;n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&T.a.indexOf(n[0].schemeIdUri)>=0)return t===r.a.IMAGE}if(e.ContentComponent_asArray&&e.ContentComponent_asArray.length>0){if(e.ContentComponent_asArray.length>1)return t===r.a.MUXED;if(e.ContentComponent_asArray[0].contentType===t)return!0}var a=t===r.a.TEXT?new RegExp("(ttml|vtt|wvtt|stpp)"):new RegExp(t);if(e.Representation_asArray&&e.Representation_asArray.length){var o=e.Representation_asArray[0].codecs;if(a.test(o))return!0}if(e.hasOwnProperty(i.a.MIME_TYPE))return a.test(e.mimeType);if(e.Representation_asArray)for(var s,u=0;u0){var t=e.Representation_asArray[0];if(t.hasOwnProperty(i.a.SEGMENT_TEMPLATE)||t.hasOwnProperty(i.a.SEGMENT_TIMELINE)||t.hasOwnProperty(i.a.SEGMENT_LIST)||t.hasOwnProperty(i.a.SEGMENT_BASE))return!0}return!1}function R(e){return b(e,r.a.AUDIO)}function N(e){return b(e,r.a.VIDEO)}function w(e){return b(e,r.a.TEXT)}function C(e){return b(e,r.a.IMAGE)}function D(){return function(e,t){return e.bandwidth-t.bandwidth}}function O(e){return e&&Array.isArray(e.Representation_asArray)&&e.Representation_asArray.sort((function(e,t){return e.bandwidth-t.bandwidth})),e}function M(e,t){return e&&e.Period_asArray&&A(t)&&e.Period_asArray[t]?e.Period_asArray[t].AdaptationSet_asArray:[]}function P(e){return e&&e.Period_asArray?e.Period_asArray:[]}function L(e){var t=!1;return e&&e.hasOwnProperty("type")&&(t=e.type===i.a.DYNAMIC),t}function F(e){return e&&e.EssentialProperty_asArray&&e.EssentialProperty_asArray.length?e.EssentialProperty_asArray.map((function(e){return{schemeIdUri:e.schemeIdUri,value:e.value}})):null}function x(e){if(!e||!e.S_asArray)return NaN;var t=e.S_asArray[0],n=e.S_asArray[1];return t.hasOwnProperty("d")?t.d:n.t-t.t}function U(e,t){if(!e)throw new Error("Period cannot be null or undefined");var n=l.DEFAULT_ID+"_"+t;return e.hasOwnProperty(i.a.ID)&&e.id.length>0&&"__proto__"!==e.id&&(n=e.id),n}function B(e,t){var n,a=[];if(!e)return a;for(n=0;n0&&A(e)?r[e]:null},getIndexForAdaptation:function(e,t,n){if(!e)return-1;for(var r=M(t,n),i=0;i0&&A(e)?n[e]:null},getCodec:function(e,t,n){var r=null;if(e&&e.Representation_asArray&&e.Representation_asArray.length>0){var i=A(t)&&t>=0&&t0?e.Representation_asArray[0].mimeType:null},getKID:function(e){return e&&e.hasOwnProperty(i.a.CENC_DEFAULT_KID)?e[i.a.CENC_DEFAULT_KID]:null},getLabelsForAdaptation:function(e){if(!e||!Array.isArray(e.Label_asArray))return[];for(var t=[],n=0;n0&&(n=-1!==e.profiles.indexOf(t)),n},getDuration:function(e){return e&&e.hasOwnProperty(i.a.MEDIA_PRESENTATION_DURATION)?e.mediaPresentationDuration:e&&"dynamic"==e.type?Number.POSITIVE_INFINITY:Number.MAX_SAFE_INTEGER||Number.MAX_VALUE},getBandwidth:function(e){return e&&e.bandwidth?e.bandwidth:NaN},getManifestUpdatePeriod:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=NaN;return e&&e.hasOwnProperty(i.a.MINIMUM_UPDATE_PERIOD)&&(n=e.minimumUpdatePeriod),isNaN(n)?n:Math.max(n-t,1)},getPublishTime:function(e){return e&&e.hasOwnProperty(i.a.PUBLISH_TIME)?new Date(e[i.a.PUBLISH_TIME]):null},getRepresentationCount:function(e){return e&&Array.isArray(e.Representation_asArray)?e.Representation_asArray.length:0},getBitrateListForAdaptation:function(e){var t=O(e);return(t&&Array.isArray(t.Representation_asArray)?t.Representation_asArray:[]).map((function(e){return{bandwidth:e.bandwidth,width:e.width||0,height:e.height||0,scanType:e.scanType||null,id:e.id||null}}))},getRepresentationFor:function(e,t){return t&&t.Representation_asArray&&t.Representation_asArray.length>0&&A(e)?t.Representation_asArray[e]:null},getRepresentationsForAdaptation:function(e){var t,n,r,a,s=[],u=function(e){if(e&&e.period&&A(e.period.index)){var t=e.period.mpd.manifest.Period_asArray[e.period.index];if(t&&t.AdaptationSet_asArray&&A(e.index))return O(t.AdaptationSet_asArray[e.index])}}(e);if(u&&u.Representation_asArray){if(e&&e.period&&A(e.period.index)){var l=k(e.period.mpd.manifest);l&&(n=l[0])}for(var c=0,f=u.Representation_asArray.length;c=0&&e.value){var t=e.value.split("x");2!==t.length||isNaN(t[0])||isNaN(t[1])||(r.tilesHor=parseInt(t[0],10),r.tilesVert=parseInt(t[1],10))}})),t?m.updateSegmentData(e).then((function(t){!function(e,t,n){var r=[],i=function(e,t){var n,r,i,a,o=[],s=0;for(n=0,r=e.segments.length;ne)return i=t.url,!0})),i?n(i):t.segments.some((function(i){if(i.mediaStartTime<=e&&i.mediaStartTime+i.duration>e){var a=T.resolve(t.path);return y.load({method:"get",url:a.url,request:{range:i.mediaRange,responseType:"arraybuffer"},onload:function(e){var t=E.getSamplesInfo(e.target.response),a=new Blob([e.target.response.slice(t.sampleList[0].offset,t.sampleList[0].offset+t.sampleList[0].size)],{type:"image/jpeg"}),o=window.URL.createObjectURL(a);r.push({start:i.mediaStartTime,end:i.mediaStartTime+i.duration,url:o}),n&&n(o)}}),!0}}))}}(r,e,t)})):(r.startNumber=e.startNumber,r.segmentDuration=e.segmentDuration,r.timescale=e.timescale,r.templateUrl=function(e){var t=w.isRelative(e.media)?w.resolve(e.media,T.resolve(e.path).url):e.media;if(!t)return"";return Object(u.c)(t,e.id)}(e)),r.tilesHor>0&&r.tilesVert>0&&(r.widthPerTile=r.width/r.tilesHor,r.heightPerTile=r.height/r.tilesVert,n.push(r))}function D(){n=[],p=-1,g=null}return t={getTracks:function(){return n},addTracks:function(){if(S&&v&&(g=v.getMediaInfoForType(S,r.a.IMAGE))){var e=v.getVoRepresentations(g);e&&e.length>0&&e.forEach((function(e){(e.segmentInfoType===i.a.SEGMENT_TEMPLATE&&e.segmentDuration>0&&e.media||e.segmentInfoType===i.a.SEGMENT_TIMELINE)&&C(e),e.segmentInfoType===i.a.SEGMENT_BASE&&C(e,!0)})),n.length>0&&n.sort((function(e,t){return e.bitrate-t.bitrate}))}},reset:D,setTrackByIndex:function(e){n&&0!==n.length&&(e>=n.length&&(e=n.length-1),p=e)},getCurrentTrack:function(){return p<0?null:n[p]},getCurrentTrackIndex:function(){return p},getThumbnailRequestForTime:function(e){for(var t,r=v.getVoRepresentations(g),i=0;it)return!1;if(e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.numberOfSegments)&&!isNaN(a.index)&&a.index>=e.mediaFinishedInformation.numberOfSegments-1){if(!l||e.segmentInfoType===u.a.SEGMENT_TEMPLATE)return!0;if(l&&e.segmentInfoType===u.a.SEGMENT_LIST&&e.adaptation.period.nextPeriodId)return!0}return!!(l&&e.adaptation.period.nextPeriodId&&e.segmentInfoType===u.a.SEGMENT_TIMELINE&&e.mediaFinishedInformation&&!isNaN(e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment)&&a&&!isNaN(a.mediaStartTime)&&!isNaN(a.duration)&&a.mediaStartTime+a.duration>=e.mediaFinishedInformation.mediaTimeOfLastSignaledSegment-.05)},reset:function(){v(),f.off(o.a.DYNAMIC_TO_STATIC,b,t)},getNextSegmentRequestIdempotent:function(e,t){var n=a?a.index+1:0,r=m.getSegmentByIndex(t,n,a?a.mediaStartTime:-1);return r?S(e,r):null},getValidSeekTimeCloseToTargetTime:function(e,t,n,r){try{if(isNaN(e)||!t||!n)return NaN;if(e<0&&(e=0),isNaN(r)&&(r=.5),A(t,n,e))return e;for(var i=n.adaptation.period.start,a=n.adaptation.period.start+n.adaptation.period.duration,o=Math.min(e+r,a),s=Math.max(e-r,i),u=NaN,l=null;o<=a||s>=i;){var c=null,f=null;if(o<=a&&(c=A(t,n,o)),s>=i&&(f=A(t,n,s)),f){u=s,l=f;break}if(c){u=o,l=c;break}o+=r,s-=r}if(l){var d=l.startTime+l.duration;return e>=l.startTime&&d-e>r?e:e=i-.5*f.d/d&&(l=!0),!1})),u},getSegmentByTime:function(e,r){if(o(),!e)return null;void 0===r&&(r=null);var i=null,u=n.calcMediaTimeFromPresentationTime(r,e);return s(e,(function(r,o,s,l,c,f,d,h){if(u0)for(o=0;o=i&&t-n=n&&console.log(this.time+" ["+e+"] "+t)}},l=function(e){for(var t=[],n=0;n32&&(u.log("ERROR","Too large cursor position "+this.pos),this.pos=32)},moveCursor:function(e){var t=this.pos+e;if(e>1)for(var n=this.pos+1;n=144&&this.backSpace();var t=n(e);this.pos>=32?u.log("ERROR","Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!"):(this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1))},clearFromPos:function(e){var t;for(t=e;t<32;t++)this.chars[t].reset()},clear:function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},clearToEndOfRow:function(){this.clearFromPos(this.pos)},getTextString:function(){for(var e=[],t=!0,n=0;n<32;n++){var r=this.chars[n].uchar;" "!==r&&(t=!1),e.push(r)}return t?"":e.join("")},setPenStyles:function(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}};var h=function(){this.rows=[];for(var e=0;e<15;e++)this.rows.push(new d);this.currRow=14,this.nrRollUpRows=null,this.reset()};h.prototype={reset:function(){for(var e=0;e<15;e++)this.rows[e].clear();this.currRow=14},equals:function(e){for(var t=!0,n=0;n<15;n++)if(!this.rows[n].equals(e.rows[n])){t=!1;break}return t},copy:function(e){for(var t=0;t<15;t++)this.rows[t].copy(e.rows[t])},isEmpty:function(){for(var e=!0,t=0;t<15;t++)if(!this.rows[t].isEmpty()){e=!1;break}return e},backSpace:function(){this.rows[this.currRow].backSpace()},clearToEndOfRow:function(){this.rows[this.currRow].clearToEndOfRow()},insertChar:function(e){this.rows[this.currRow].insertChar(e)},setPen:function(e){this.rows[this.currRow].setPenStyles(e)},moveCursor:function(e){this.rows[this.currRow].moveCursor(e)},setCursor:function(e){u.log("INFO","setCursor: "+e),this.rows[this.currRow].setCursor(e)},setPAC:function(e){u.log("INFO","pacData = "+JSON.stringify(e));var t=e.row-1;this.nrRollUpRows&&t0&&(n=e?"["+t.join(" | ")+"]":t.join("\n")),n},getTextAndFormat:function(){return this.rows}};var p=function(e,t){this.chNr=e,this.outputFilter=t,this.mode=null,this.verbose=0,this.displayedMemory=new h,this.nonDisplayedMemory=new h,this.lastOutputScreen=new h,this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null};p.prototype={modes:["MODE_ROLL-UP","MODE_POP-ON","MODE_PAINT-ON","MODE_TEXT"],reset:function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.currRollUpRow=this.displayedMemory.rows[14],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.lastCueEndTime=null},getHandler:function(){return this.outputFilter},setHandler:function(e){this.outputFilter=e},setPAC:function(e){this.writeScreen.setPAC(e)},setBkgData:function(e){this.writeScreen.setBkgData(e)},setMode:function(e){e!==this.mode&&(this.mode=e,u.log("INFO","MODE="+e),"MODE_POP-ON"==this.mode?this.writeScreen=this.nonDisplayedMemory:(this.writeScreen=this.displayedMemory,this.writeScreen.reset()),"MODE_ROLL-UP"!==this.mode&&(this.displayedMemory.nrRollUpRows=null,this.nonDisplayedMemory.nrRollUpRows=null),this.mode=e)},insertChars:function(e){for(var t=0;t=46,t.italics)t.foreground="white";else{var n=Math.floor(e/2)-16;t.foreground=["white","green","blue","cyan","red","yellow","magenta"][n]}u.log("INFO","MIDROW: "+JSON.stringify(t)),this.writeScreen.setPen(t)},outputDataUpdate:function(){var e=u.time;null!==e&&this.outputFilter&&(this.outputFilter.updateData&&this.outputFilter.updateData(e,this.displayedMemory),null!==this.cueStartTime||this.displayedMemory.isEmpty()?this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.lastOutputScreen),this.cueStartTime=this.displayedMemory.isEmpty()?null:e):this.cueStartTime=e,this.lastOutputScreen.copy(this.displayedMemory))},cueSplitAtTime:function(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}};var g=function(e,t,n){this.field=e||1,this.outputs=[t,n],this.channels=[new p(1,t),new p(2,n)],this.currChNr=-1,this.lastCmdA=null,this.lastCmdB=null,this.bufferedData=[],this.startTime=null,this.lastTime=null,this.dataCounters={padding:0,char:0,cmd:0,other:0}};g.prototype={getHandler:function(e){return this.channels[e].getHandler()},setHandler:function(e,t){this.channels[e].setHandler(t)},addData:function(e,t){var n,r,i,a=!1;this.lastTime=e,u.setTime(e);for(var o=0;o=16&&r<=31&&r===this.lastCmdA&&i===this.lastCmdB)this.lastCmdA=null,this.lastCmdB=null,u.log("DEBUG","Repeated command ("+l([r,i])+") is dropped");else if(0!==r||0!==i){if(u.log("DATA","["+l([t[o],t[o+1]])+"] -> ("+l([r,i])+")"),(n=this.parseCmd(r,i))||(n=this.parseMidrow(r,i)),n||(n=this.parsePAC(r,i)),n||(n=this.parseBackgroundAttributes(r,i)),!n)if(a=this.parseChars(r,i))if(this.currChNr&&this.currChNr>=0)this.channels[this.currChNr-1].insertChars(a);else u.log("WARNING","No channel found yet. TEXT-MODE?");n?this.dataCounters.cmd+=2:a?this.dataCounters.char+=2:(this.dataCounters.other+=2,u.log("WARNING","Couldn't parse cleaned data "+l([r,i])+" orig: "+l([t[o],t[o+1]])))}else this.dataCounters.padding+=2},parseCmd:function(e,t){var n=null;if(!((20===e||21===e||28===e||29===e)&&32<=t&&t<=47)&&!((23===e||31===e)&&33<=t&&t<=35))return!1;n=20===e||21===e||23===e?1:2;var r=this.channels[n-1];return 20===e||21===e||28===e||29===e?32===t?r.cc_RCL():33===t?r.cc_BS():34===t?r.cc_AOF():35===t?r.cc_AON():36===t?r.cc_DER():37===t?r.cc_RU(2):38===t?r.cc_RU(3):39===t?r.cc_RU(4):40===t?r.cc_FON():41===t?r.cc_RDC():42===t?r.cc_TR():43===t?r.cc_RTD():44===t?r.cc_EDM():45===t?r.cc_CR():46===t?r.cc_ENM():47===t&&r.cc_EOC():r.cc_TO(t-32),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},parseMidrow:function(e,t){var n=null;if((17===e||25===e)&&32<=t&&t<=47){if((n=17===e?1:2)!==this.currChNr)return u.log("ERROR","Mismatch channel in midrow parsing"),!1;var r=this.channels[n-1];return r.insertChars([32]),r.cc_MIDROW(t),u.log("DEBUG","MIDROW ("+l([e,t])+")"),this.lastCmdA=e,this.lastCmdB=t,!0}return!1},parsePAC:function(e,t){var n,s=null;if(!((17<=e&&e<=23||25<=e&&e<=31)&&64<=t&&t<=127)&&!((16===e||24===e)&&64<=t&&t<=95))return!1;n=e<=23?1:2,s=64<=t&&t<=95?1===n?r[e]:a[e]:1===n?i[e]:o[e];var u=this.interpretPAC(s,t);return this.channels[n-1].setPAC(u),this.lastCmdA=e,this.lastCmdB=t,this.currChNr=n,!0},interpretPAC:function(e,t){var n=t,r={color:null,italics:!1,indent:null,underline:!1,row:e};return n=t>95?t-96:t-64,r.underline=1==(1&n),n<=13?r.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(n/2)]:n<=15?(r.italics=!0,r.color="white"):r.indent=4*Math.floor((n-16)/2),r},parseChars:function(e,t){var r=null,i=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),17<=a&&a<=19){var o=t;o=17===a?t+80:18===a?t+112:t+144,u.log("INFO","Special char '"+n(o)+"' in channel "+r),i=[o],this.lastCmdA=e,this.lastCmdB=t}else 32<=e&&e<=127&&(i=0===t?[e]:[e,t],this.lastCmdA=null,this.lastCmdB=null);if(i){var s=l(i);u.log("DEBUG","Char codes = "+s.join(","))}return i},parseBackgroundAttributes:function(e,t){var n,r,i;return((16===e||24===e)&&32<=t&&t<=47||(23===e||31===e)&&45<=t&&t<=47)&&(n={},16===e||24===e?(r=Math.floor((t-32)/2),n.background=s[r],t%2==1&&(n.background=n.background+"_semi")):45===t?n.background="transparent":(n.foreground="black",47===t&&(n.underline=!0)),i=e<24?1:2,this.channels[i-1].setBkgData(n),this.lastCmdA=e,this.lastCmdB=t,!0)},reset:function(){for(var e=0;e=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n/g,">").replace(/"/g,""").replace(/'/g,"'"):e}function u(e,t,n,r){for(var i=0;i0&&u(e.arrayAccessFormPaths,t,n,r)&&(t[n]=[t[n]])}function c(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),r=t[5].split(".");if(n.setHours(t[3],t[4],r[0]),r.length>1&&n.setMilliseconds(r[1]),t[6]&&t[7]){var i=60*t[6]+Number(t[7]);i=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*i:i),n.setMinutes(n.getMinutes()-i-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function f(n,r,i,a){return!(r==t&&e.xmlElementsFilter.length>0)||u(e.xmlElementsFilter,n,i,a)}function d(s,h){if(s.nodeType==a){for(var p=new Object,g=s.childNodes,m=0;m0){var i=r.split(".#")[0];return u(e.datetimeAccessFormPaths,t,n,i)?c(t):t}return t}(p.__text,_,h+"."+_)),null!=p["#cdata-section"]&&(p.__cdata=p["#cdata-section"],delete p["#cdata-section"],"property"==e.arrayAccessForm&&delete p["#cdata-section_asArray"]),0==p.__cnt&&"text"==e.emptyNodeForm?p="":1==p.__cnt&&null!=p.__text?p=p.__text:1!=p.__cnt||null==p.__cdata||e.keepCData?p.__cnt>1&&null!=p.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==p.__text||""==p.__text.trim())&&delete p.__text:p=p.__cdata,delete p.__cnt,!e.enableToStringFunc||null==p.__text&&null==p.__cdata||(p.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),p}if(s.nodeType==n||s.nodeType==r)return s.nodeValue}function h(t,n,r,i){var a="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=r)for(var o=0;o":">"}function p(e,t){return""}function g(t,n){return"property"==e.arrayAccessForm&&(r=n.toString(),i="_asArray",-1!==r.indexOf(i,r.length-i.length))||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function;var r,i}function m(e){var t=0;if(e instanceof Object)for(var n in e)g(e,n)||t++;return t}function y(t,n,r){return 0==e.jsonPropertiesFilter.length||""==r||u(e.jsonPropertiesFilter,t,n,r)}function E(t){var n=[];if(t instanceof Object)for(var r in t)-1==r.toString().indexOf("__")&&0==r.toString().indexOf(e.attributePrefix)&&n.push(r);return n}function _(t){var n="";return t instanceof Object?n+=function(t){var n="";return null!=t.__cdata&&(n+=""),null!=t.__text&&(e.escapeMode?n+=s(t.__text):n+=t.__text),n}(t):null!=t&&(e.escapeMode?n+=s(t):n+=t),n}function v(e,t){return""===e?t:e+"."+t}function T(e,t,n,r){var i="";if(0==e.length)i+=h(e,t,n,!0);else for(var a=0;a0)for(var r in e)if(!g(e,r)&&(""==t||y(e,r,v(t,r)))){var i=e[r],a=E(i);if(null==i||null==i)n+=h(i,r,a,!0);else if(i instanceof Object)if(i instanceof Array)n+=T(i,r,a,t);else if(i instanceof Date)n+=h(i,r,a,!1),n+=i.toISOString(),n+=p(i,r);else{m(i)>0||null!=i.__text||null!=i.__cdata?(n+=h(i,r,a,!1),n+=S(i,v(t,r)),n+=p(i,r)):n+=h(i,r,a,!0)}else n+=h(i,r,a,!1),n+=_(i),n+=p(i,r)}return n+=_(e)}this.parseXmlString=function(e){var t;window.ActiveXObject||window;if(void 0===e)return null;if(window.DOMParser){var n=new window.DOMParser;try{(t=n.parseFromString(e,"text/xml")).getElementsByTagNameNS("*","parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("")+2)),(t=new ActiveXObject("Microsoft.XMLDOM")).async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?c(e):e},this.xml2json=function(e){return d(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return S(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}}},function(e,t,n){"use strict";var r=n(3),i=n(25),a=n(15),o=n(1);function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;var n=[],r=!0,i=!1,a=void 0;try{for(var o,s=e[Symbol.iterator]();!(r=(o=s.next()).done)&&(n.push(o.value),!t||n.length!==t);r=!0);}catch(e){i=!0,a=e}finally{try{r||null==s.return||s.return()}finally{if(i)throw a}}return n}(e,t)||u(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){if(e){if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);nt/4/e.length}))).length>1){var n=0,r=(e[e.length-1].ts-e[0].ts)/e.length;return e.forEach((function(t,i){var a=e[i+1];if(a){var o=a.ts-t.ts;n+=o=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}(r.headers.keys());try{for(p.s();!(a=p.n()).done;){var g=a.value;c+=g+": "+r.headers.get(g)+"\r\n"}}catch(e){p.e(e)}finally{p.f()}if(e.response.responseHeaders=c,!r.body)return r.arrayBuffer().then((function(t){e.response.response=t;var n={loaded:t.byteLength,total:t.byteLength,stream:!1};e.progress(n),e.onload(),e.onend()}));var m,y,T=parseInt(r.headers.get("Content-Length"),10),S=0,A=!1,b=new Uint8Array,I=0;if(E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_AAST&&i){var R=n,N=0,w=s(r.body.tee(),2),C=w[0],D=w[1];m=C.getReader(),y=[],m.read().then((function r(a){var o=a.value,s=a.done;if(N=Date.now(),o&&o.length){var u=N-R,l=o.length;y.push({chunkDownloadTimeRelativeMS:N-n,chunkDownloadDurationMS:u,chunkBytes:l,kbps:Math.round(8*l/(u/1e3)),bufferLevel:t.getCurrentBufferLevel(h.mediaType)})}if(s){var f=N-n,d=y.reduce((function(e,t){return e+t.chunkBytes}),0);return i.addMeasurement(h,f,y,_,v,c),void e.progress({loaded:d,total:d,lengthComputable:!0,time:i.getEstimatedDownloadDurationMS(h),stream:!0})}return R=Date.now(),m.read().then(r)})),e.reader=D.getReader()}else e.reader=r.body.getReader();var O=[],M=[],P=[],L=!0;f(e,(function t(n){var r=n.value;if(n.done){if(b){if(E!==o.a.ABR_FETCH_THROUGHPUT_CALCULATION_AAST){var i=null;E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&(i=function(e,t){try{var n,r;n=e.filter((function(t,n){return n1){for(var a=0,o=0,s=0;s1)i.push(8*r[s].bytes/u);else{0===o&&(o=n[s].ts);var l=r[s].ts-o;l>1?(i.push(8*a/l),a=0,o=0):a+=r[s].bytes}}if(i.length>0)return i.reduce((function(e,t){return e+t}),0)/i.length}return null}catch(e){return null}}(M,P)),e.progress({loaded:S,total:isNaN(T)?S:T,lengthComputable:!0,time:d(O,S),throughput:i,stream:!0})}e.response.response=b.buffer}return e.onload(),void e.onend()}if(r&&r.length>0){if(b=function(e,t){if(0===e.length)return t;var n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}(b,r),S+=r.length,O.push({ts:Date.now(),bytes:r.length}),E===o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING&&L)l.findLastTopIsoBoxCompleted(["moof"],b,I).found&&(L=!1,M.push({ts:performance.now(),bytes:r.length}));var a=l.findLastTopIsoBoxCompleted(["moov","mdat"],b,I);if(a.found){var s,u=a.lastCompletedOffset+a.size;E!==o.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING||L||(L=!0,P.push({ts:performance.now(),bytes:b.length})),u===b.length?(s=b,b=new Uint8Array):(s=new Uint8Array(b.subarray(0,u)),b=b.subarray(u)),e.progress({data:s.buffer,lengthComputable:!1,noTrace:!0}),I=0}else I=a.lastCompletedOffset,A||(e.progress({lengthComputable:!1,noTrace:!0}),A=!0)}f(e,t)}))})).catch((function(t){e.onerror&&e.onerror(t)}))}))},abort:function(e){if(e.abortController)e.abortController.abort();else if(e.reader)try{e.reader.cancel(),e.onabort()}catch(e){}},calculateDownloadedTime:d,setup:function(e){t=e.dashMetrics}}}c.__dashjs_factory_name="FetchLoader";var f=r.a.getClassFactory(c),d=n(5),h=n(8),p=n(36),g=n(14),m=n(6),y=n(7),E=n(2);function _(){var e,t,n=this.context,r={};function i(){t=Object(m.a)(n).getInstance().getLogger(e)}function a(e){for(var t={},n=0,r=0,i=0,a=0,o=e.length,s=0;se.bitrate&&(n=!1):t=e.bitrate})),n}return e={setup:i,addMeasurement:function(e,t,n,i,o){e&&e.mediaType&&!r[e.mediaType]&&(r[e.mediaType]=[]);var s=e.mediaInfo.bitrateList.find((function(t){return t.id===e.representationId}));r[e.mediaType].push({index:e.index,repId:e.representationId,mediaType:e.mediaType,requestTimeMS:i,adjustedAvailabilityStartTimeMS:e.availabilityStartTime.getTime(),segDurationMS:1e3*e.duration,chunksDurationMS:n.reduce((function(e,t){return e+t.chunkDownloadDurationMS}),0),segmentBytes:n.reduce((function(e,t){return e+t.chunkBytes}),0),bitrate:s&&s.bandwidth,bitrateList:e.mediaInfo.bitrateList,chunkMeasurements:n,fetchDownloadDurationMS:t,throughputCapacityDelayMS:o,getEstimatedBufferLevel:a(n.slice(1))}),r[e.mediaType].length>10&&r[e.mediaType].shift()},getThroughputCapacityDelayMS:function(e,t){var n=r[e.mediaType]&&r[e.mediaType].slice(-3);return!n||n.length<3?0:o(n)?t/4>250?250:t/4:0},getEstimatedDownloadDurationMS:function(e){var n=r[e.mediaType].slice(-1).pop(),i=r[e.mediaType].slice(-3),a=n.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;n.bufferLevelAtSegmentStart=n.getEstimatedBufferLevel(a/2),n.bufferLevelAtSegmentEnd=n.getEstimatedBufferLevel(a);var s=o(i),u=s?.6:.8;if(n.isBufferStable&&1.05*n.segDurationMS.2*n.chunkMeasurements.length){var g=c/f,m=n.segmentBytes/g;return n.fetchDownloadDurationMSn.bitrate)return y=e.bandwidth,!0})),y===n.bitrate?n.fetchDownloadDurationMS*u:u*n.segmentBytes*8*1e3/y}},i(),e}_.__dashjs_factory_name="LowLatencyThroughputModel";var v=r.a.getSingletonFactory(_);function T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e){e=e||{};var t,n,r,s,u,l,c,_,S,A=this.context,b=e.errHandler,I=e.dashMetrics,R=e.mediaPlayerModel,N=e.requestModifier,w=e.boxParser,C=e.errors,D=e.requestTimeout||0,O=Object(y.a)(A).getInstance(),M=Object(a.a)(A).getInstance();function P(e,t){var a,p=e.request,m=[],y=!0,v=!0,T=new Date,S=T,C=0;if(!N||!I||!b)throw new Error("config object is not correct or missing");var L,F=function(e){if(v=!1,p.requestStartDate=T,p.requestEndDate=new Date,p.firstByteDate=p.firstByteDate||T,!p.checkExistenceOnly){var t=a.response?a.response.responseURL:null,n=a.response?a.response.status:null,r=a.response&&a.response.getAllResponseHeaders?a.response.getAllResponseHeaders():a.response?a.response.responseHeaders:[];I.addHttpRequest(p,t,n,r,e?m:null),p.type===d.a.MPD_TYPE&&I.addManifestUpdate(p)}},x=function(){if(-1!==n.indexOf(a)&&(n.splice(n.indexOf(a),1),v))if(F(!1),t>0){try{if(M.get().streaming.utcSynchronization.enableBackgroundSyncAfterSegmentDownloadError&&p.type===d.a.MEDIA_SEGMENT_TYPE)R.getRetryAttemptsForType(d.a.MEDIA_SEGMENT_TYPE)===t&&O.trigger(E.a.ATTEMPT_BACKGROUND_SYNC)}catch(e){}t--;var r={config:e};s.push(r),r.timeout=setTimeout((function(){-1!==s.indexOf(r)&&(s.splice(s.indexOf(r),1),P(e,t))}),R.getRetryIntervalsForType(p.type))}else{if(p.type===d.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE)return;b.error(new h.a(u[p.type],p.url+" is not available",{request:p,response:a.response})),e.error&&e.error(p,"error",a.response.statusText),e.complete&&e.complete(p,a.response.statusText)}};M.get().streaming.lowLatencyEnabled&&window.fetch&&"arraybuffer"===p.responseType&&p.type===d.a.MEDIA_SEGMENT_TYPE?(L=f(A).create({requestModifier:N,lowLatencyThroughputModel:c,boxParser:w})).setup({dashMetrics:I}):L=Object(i.a)(A).create({requestModifier:N});var U=null,B=N.modifyRequestURL(p.url);if(M.get().streaming.cmcd&&M.get().streaming.cmcd.enabled){var k=M.get().streaming.cmcd.mode;if(k===o.a.CMCD_MODE_QUERY){var G=function(e){try{var t=[],n=l.getQueryParameter(e);return n&&t.push(n),t}catch(e){return[]}}(p);B=g.a.addAditionalQueryParameterToUrl(B,G)}else k===o.a.CMCD_MODE_HEADER&&(U=l.getHeaderParameters(p))}p.url=B;var j=p.checkExistenceOnly?d.a.HEAD:d.a.GET,Y=R.getXHRWithCredentialsForType(p.type);a={url:B,method:j,withCredentials:Y,request:p,onload:function(){a.response.status>=200&&a.response.status<=299&&(F(!0),e.success&&e.success(a.response.response,a.response.statusText,a.response.responseURL),e.complete&&e.complete(p,a.response.statusText))},onend:x,onerror:x,progress:function(t){var n=new Date;y&&(y=!1,(!t.lengthComputable||t.lengthComputable&&t.total!==t.loaded)&&(p.firstByteDate=n)),t.lengthComputable&&(p.bytesLoaded=t.loaded,p.bytesTotal=t.total),t.noTrace||(m.push({s:S,d:t.time?t.time:n.getTime()-S.getTime(),b:[t.loaded?t.loaded-C:0],t:t.throughput}),S=n,C=t.loaded),e.progress&&t&&e.progress(t)},onabort:function(){e.abort&&e.abort(p)},ontimeout:function(e){var t;if(e.lengthComputable){var n=e.loaded/e.total*100;t="Request timeout: loaded: "+e.loaded+", out of: "+e.total+" : "+n.toFixed(3)+"% Completed"}else t="Request timeout: non-computable download size";_.warn(t)},loader:L,timeout:D,headers:U};var H=(new Date).getTime();if(isNaN(p.delayLoadingTime)||H>=p.delayLoadingTime)n.push(a),L.load(a);else{var K={httpRequest:a};r.push(K),K.delayTimeout=setTimeout((function(){if(-1!==r.indexOf(K)){r.splice(r.indexOf(K),1);try{T=new Date,S=T,n.push(K.httpRequest),L.load(K.httpRequest)}catch(e){K.httpRequest.onerror()}}}),p.delayLoadingTime-H)}}return t={load:function(e){e.request?P(e,R.getRetryAttemptsForType(e.request.type)):e.error&&e.error(e.request,"error")},abort:function(){s.forEach((function(e){clearTimeout(e.timeout),e.config.request&&e.config.abort&&e.config.abort(e.config.request)})),s=[],r.forEach((function(e){return clearTimeout(e.delayTimeout)})),r=[],n.forEach((function(e){e.request.type!==d.a.MSS_FRAGMENT_INFO_SEGMENT_TYPE&&(e.onloadend=e.onerror=e.onprogress=void 0,e.loader.abort(e))})),n=[]}},_=Object(m.a)(A).getInstance().getLogger(t),n=[],r=[],s=[],l=Object(p.a)(A).getInstance(),c=v(A).getInstance(),T(S={},d.a.MPD_TYPE,C.DOWNLOAD_ERROR_ID_MANIFEST_CODE),T(S,d.a.XLINK_EXPANSION_TYPE,C.DOWNLOAD_ERROR_ID_XLINK_CODE),T(S,d.a.INIT_SEGMENT_TYPE,C.DOWNLOAD_ERROR_ID_INITIALIZATION_CODE),T(S,d.a.MEDIA_SEGMENT_TYPE,C.DOWNLOAD_ERROR_ID_CONTENT_CODE),T(S,d.a.INDEX_SEGMENT_TYPE,C.DOWNLOAD_ERROR_ID_CONTENT_CODE),T(S,d.a.BITSTREAM_SWITCHING_SEGMENT_TYPE,C.DOWNLOAD_ERROR_ID_CONTENT_CODE),T(S,d.a.OTHER_TYPE,C.DOWNLOAD_ERROR_ID_CONTENT_CODE),u=S,t}S.__dashjs_factory_name="HTTPLoader";var A=r.a.getClassFactory(S);function b(){var e;function t(){e={}}function n(){t()}return n(),{getLoader:function(t){for(var n in e)if(e.hasOwnProperty(n)&&t.startsWith(n))return e[n];return A},registerLoader:function(t,n){e[t]=n},unregisterLoader:function(t){e[t]&&delete e[t]},unregisterAllLoader:t,reset:n}}b.__dashjs_factory_name="SchemeLoaderFactory";var I=r.a.getSingletonFactory(b);t.a=I},function(e,t,n){(function(e){function n(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===n(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===n(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===n(e)},t.isError=function(e){return"[object Error]"===n(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=e.isBuffer}).call(this,n(60).Buffer)},function(e,t,n){(function(e){function n(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}function r(e,t){if(e.filter)return e.filter(t);for(var n=[],r=0;r=-1&&!i;a--){var o=a>=0?arguments[a]:e.cwd();if("string"!=typeof o)throw new TypeError("Arguments to path.resolve must be strings");o&&(t=o+"/"+t,i="/"===o.charAt(0))}return(i?"/":"")+(t=n(r(t.split("/"),(function(e){return!!e})),!i).join("/"))||"."},t.normalize=function(e){var a=t.isAbsolute(e),o="/"===i(e,-1);return(e=n(r(e.split("/"),(function(e){return!!e})),!a).join("/"))||a||(e="."),e&&o&&(e+="/"),(a?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(r(e,(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,n){function r(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=t.resolve(e).substr(1),n=t.resolve(n).substr(1);for(var i=r(e.split("/")),a=r(n.split("/")),o=Math.min(i.length,a.length),s=o,u=0;u=1;--a)if(47===(t=e.charCodeAt(a))){if(!i){r=a;break}}else i=!1;return-1===r?n?"/":".":n&&1===r?"/":e.slice(0,r)},t.basename=function(e,t){var n=function(e){"string"!=typeof e&&(e+="");var t,n=0,r=-1,i=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!i){n=t+1;break}}else-1===r&&(i=!1,r=t+1);return-1===r?"":e.slice(n,r)}(e);return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},t.extname=function(e){"string"!=typeof e&&(e+="");for(var t=-1,n=0,r=-1,i=!0,a=0,o=e.length-1;o>=0;--o){var s=e.charCodeAt(o);if(47!==s)-1===r&&(i=!1,r=o+1),46===s?-1===t?t=o:1!==a&&(a=1):-1!==t&&(a=-1);else if(!i){n=o+1;break}}return-1===t||-1===r||0===a||1===a&&t===r-1&&t===n+1?"":e.slice(t,r)};var i="b"==="ab".substr(-1)?function(e,t,n){return e.substr(t,n)}:function(e,t,n){return t<0&&(t=e.length+t),e.substr(t,n)}}).call(this,n(26))},function(e,t,n){t.generateISD=n(74).generateISD,t.fromXML=n(75).fromXML,t.renderHTML=n(91).render},function(e,t,n){"use strict";var r=n(3),i=n(13);function a(){return{customTimeRangeArray:[],length:0,add:function(e,t){var n=0;for(n=0;nthis.customTimeRangeArray[n].start;n++);for(this.customTimeRangeArray.splice(n,0,{start:e,end:t}),n=0;n=this.customTimeRangeArray[n].end)this.customTimeRangeArray.splice(n,1),n--;else{if(e>this.customTimeRangeArray[n].start&&tthis.customTimeRangeArray[n].start&&ethis.customTimeRangeArray[n].start&&t=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].start},end:function(e){return Object(i.a)(e),e>=this.customTimeRangeArray.length||e<0?NaN:this.customTimeRangeArray[e].end}}}a.__dashjs_factory_name="CustomTimeRanges",t.a=r.a.getClassFactory(a)},function(e,t,n){"use strict";n.d(t,"b",(function(){return s}));var r=n(3),i=n(29),a=n(1),o=[{codec:"avc1",compatibleCodecs:["avc3"]},{codec:"avc3",compatibleCodecs:["avc1"]}];function s(){var e="WebKitMediaSource"in window,t="MediaSource"in window;return e||t}function u(){var e,t,n;return e={setConfig:function(e){e&&e.settings&&(t=e.settings)},supportsMediaSource:s,supportsEncryptedMedia:function(){return n},supportsCodec:function(e,n){return n!==a.a.AUDIO&&n!==a.a.VIDEO?Promise.resolve(!0):function(e,n){return t.get().streaming.capabilities.useMediaCapabilitiesApi&&navigator.mediaCapabilities&&navigator.mediaCapabilities.decodingInfo&&(e.codec&&n===a.a.AUDIO||n===a.a.VIDEO&&e.codec&&e.width&&e.height&&e.bitrate&&e.framerate)}(e,n)?function(e,t){return new Promise((function(n){if(e&&e.codec){var r={type:"media-source"};r[t]={},r[t].contentType=e.codec,r[t].width=e.width,r[t].height=e.height,r[t].bitrate=parseInt(e.bitrate),r[t].framerate=parseFloat(e.framerate),navigator.mediaCapabilities.decodingInfo(r).then((function(e){n(e.supported)})).catch((function(){n(!1)}))}else n(!1)}))}(e,n):function(e){return new Promise((function(t){if(e&&e.codec){var n=e.codec;e.width&&e.height&&(n+=';width="'+e.width+'";height="'+e.height+'"'),"MediaSource"in window&&MediaSource.isTypeSupported(n)||"WebKitMediaSource"in window&&WebKitMediaSource.isTypeSupported(n)?t(!0):t(!1)}else t(!1)}))}(e)},setEncryptedMediaSupported:function(e){n=e},supportsEssentialProperty:function(e){try{return-1!==i.a.indexOf(e.schemeIdUri)}catch(e){return!0}},codecRootCompatibleWithCodec:function(e,t){for(var n,r=e.split(".")[0],i=0===t.indexOf(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:null;return parseFloat((D(e)-U()).toFixed(5))}function D(e){var t=e||g;return t.start+t.duration}function O(){g&&o&&o.getElement()?o.play():E=!0}function M(){return g&&o?o.isPaused():null}function P(){g&&o&&o.pause()}function L(){return g&&o?o.isSeeking():null}function F(){return g&&o?o.isStalled():null}function x(e,n,r){g&&o&&(e!==(isNaN(T)?o.getTime():T)&&((S=!0===r)||(T=e,w.trigger(c.a.PLAYBACK_SEEK_ASKED)),t.info("Requesting seek to time: "+e+(S?" (internal)":"")),o.setCurrentTime(e,n)))}function U(){return g&&o?o.getTime():null}function B(){var e=U();if(m&&!isNaN(v)){var t=v/1e3;e>t&&(e-=t)}return e}function k(){return g&&o?o.getPlaybackRate():null}function G(){return g&&o?o.getEnded():null}function j(){return m}function Y(){if(!m||isNaN(v))return NaN;var e=B();if(isNaN(e)||0===e)return 0;var t=(new Date).getTime()+1e3*s.getClientTimeOffset();return Math.max(((t-v-1e3*e)/1e3).toFixed(3),0)}function H(){P(),E=!1,p=0,v=0,T=NaN,o&&(w.off(c.a.DATA_UPDATE_COMPLETED,z,this),w.off(c.a.LOADING_PROGRESS,me,this),w.off(h.a.BUFFER_LEVEL_STATE_CHANGED,ye,this),w.off(h.a.PLAYBACK_PROGRESS,fe,this),w.off(h.a.PLAYBACK_TIME_UPDATED,fe,this),w.off(h.a.PLAYBACK_ENDED,le,this),w.off(h.a.STREAM_INITIALIZING,_e,this),w.off(h.a.REPRESENTATION_SWITCH,ve,this),o.setPlaybackRate(1,!0),V(),o.removeEventListener("canplay",X),o.removeEventListener("canplaythrough",Q),o.removeEventListener("play",$),o.removeEventListener("waiting",Z),o.removeEventListener("playing",J),o.removeEventListener("pause",ee),o.removeEventListener("error",ce),o.removeEventListener("seeking",te),o.removeEventListener("seeked",ne),o.removeEventListener("timeupdate",re),o.removeEventListener("progress",ie),o.removeEventListener("ratechange",ae),o.removeEventListener("loadedmetadata",oe),o.removeEventListener("loadeddata",se),o.removeEventListener("stalled",Ee),o.removeEventListener("ended",ue)),f=null,o=null,g=null,m=null}function K(e,t){var n=r.getCurrentDVRInfo(t),i=n?n.range:null;return i?e>i.end?Math.max(i.end-p,i.start):e>0&&e+.25_+500)&&(_=e,re())):W())}),R.get().streaming.wallclockTimeUpdateInterval)}}function V(){clearInterval(f),f=null}function W(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!M()&&m&&0!==o.getReadyState()&&!L()){e||(e=n.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO);var r=B(),i=K(r,e),s=!isNaN(i)&&i!==r;s&&!L()&&(F()||b)&&(t.debug("UpdateCurrentTime: Seek to actual time: ".concat(i," from currentTime: ").concat(r)),x(i))}}function z(e){var t=i.convertRepresentationToRepresentationInfo(e.currentRepresentation),n=t?t.mediaInfo.streamInfo:null;null!==n&&g.id===n.id&&(g=n)}function X(){w.trigger(c.a.CAN_PLAY)}function Q(){w.trigger(c.a.CAN_PLAY_THROUGH)}function $(){t.info("Native video element event: play"),W(),q(),w.trigger(c.a.PLAYBACK_STARTED,{startTime:U()})}function Z(){t.info("Native video element event: waiting"),w.trigger(c.a.PLAYBACK_WAITING,{playingTime:U()})}function J(){t.info("Native video element event: playing"),w.trigger(c.a.PLAYBACK_PLAYING,{playingTime:U()})}function ee(){t.info("Native video element event: pause"),w.trigger(c.a.PLAYBACK_PAUSED,{ended:G()})}function te(){if(S)S=!1;else{var e=U();isNaN(T)||T===e||(e=T),T=NaN,t.info("Seeking to: "+e),q(),w.trigger(c.a.PLAYBACK_SEEKING,{seekTime:e,streamId:g.id})}}function ne(){t.info("Native video element event: seeked"),w.trigger(c.a.PLAYBACK_SEEKED)}function re(){g&&w.trigger(c.a.PLAYBACK_TIME_UPDATED,{timeToEnd:C(),time:U(),streamId:g.id})}function ie(){w.trigger(c.a.PLAYBACK_PROGRESS,{streamId:g.id})}function ae(){var e=k();t.info("Native video element event: ratechange: ",e),w.trigger(c.a.PLAYBACK_RATE_CHANGED,{playbackRate:e})}function oe(){t.info("Native video element event: loadedmetadata"),w.trigger(c.a.PLAYBACK_METADATA_LOADED),q()}function se(){t.info("Native video element event: loadeddata"),w.trigger(c.a.PLAYBACK_LOADED_DATA)}function ue(){t.info("Native video element event: ended"),P(),V();var e=n?n.getActiveStreamInfo():null;e&&w.trigger(c.a.PLAYBACK_ENDED,{isLast:e.isLast})}function le(e){if(f&&e.isLast){t.info("onPlaybackEnded -- PLAYBACK_ENDED but native video element didn't fire ended");var n=e.seekTime?e.seekTime:D();o.setCurrentTime(n),P(),V()}}function ce(e){var t=e.target||e.srcElement;w.trigger(c.a.PLAYBACK_ERROR,{error:t.error})}function fe(){m&&de()&&R.get().streaming.liveCatchup.playbackRate>0&&!M()&&!L()&&(function(){try{if(de()&&R.get().streaming.liveCatchup.playbackRate>0&&U()>0){var e=pe(),t=Y(),n=y.getLiveDelay(),r=y.getLiveCatchupLatencyThreshold(),i=R.get().streaming.liveCatchup.minDrift;if(e===a.a.LIVE_CATCHUP_MODE_LOLP){var o=he(),s=R.get().streaming.liveCatchup.playbackBufferMin;return function(e,t,n,r,i,a){try{var o=Math.abs(e-t);return(isNaN(a)||e<=a)&&(o>n||rr&&(isNaN(n)||e<=n)}catch(e){return!1}}(t,n,r,i)}}catch(e){return!1}}()?function(){if(o){var e,i=o.getPlaybackRate(),s=R.get().streaming.liveCatchup.playbackRate,u=Y(),l=y.getLiveDelay(),c=he();if(pe()===a.a.LIVE_CATCHUP_MODE_LOLP){R.get().streaming.liveCatchup.minDrift;var f=R.get().streaming.liveCatchup.playbackBufferMin;e=function(e,n,r,i,a,o,s){var u,l=e;if(or/2&&(b=!1);Math.abs(s-u)<=I&&(u=null);return{newRate:u}}(s,u,l,0,f,c,i)}else e=function(e,t,n,r,i){var a=e,o=t-n,s=5*o,u=2*a/(1+Math.pow(Math.E,-s)),l=1-a+u;b&&(r>n/2?b=!1:o>0&&(l=1));Math.abs(i-l)<=I&&(l=null);return{newRate:l}}(s,u,l,c,i);var d=e.newRate;d&&o.setPlaybackRate(d);var h=u-l;R.get().streaming.liveCatchup.maxDrift>0&&!A&&h>R.get().streaming.liveCatchup.maxDrift?(t.info("Low Latency catchup mechanism. Latency too high, doing a seek to live point"),A=!0,p=n&&n.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,x(((g=r.getCurrentDVRInfo(p))?g.range:null).end-y.getLiveDelay(),!0,!1)):A=!1}var p,g}():ge())}function de(){return R.get().streaming.liveCatchup.enabled||R.get().streaming.lowLatencyEnabled}function he(){var e=null;return n.getActiveStreamProcessors().forEach((function(t){var n=t.getBufferLevel();e=null===e?n:Math.min(e,n)})),e}function pe(){var e=R.get().streaming.liveCatchup.playbackBufferMin;return R.get().streaming.liveCatchup.mode!==a.a.LIVE_CATCHUP_MODE_LOLP||null===e||isNaN(e)?a.a.LIVE_CATCHUP_MODE_DEFAULT:a.a.LIVE_CATCHUP_MODE_LOLP}function ge(){o&&o.setPlaybackRate(1)}function me(e){if(!1===e.stream&&R.get().streaming.lowLatencyEnabled&&!isNaN(e.request.duration)){var n=1.2*e.request.duration;n>y.getLiveDelay()&&(t.warn("Browser does not support fetch API with StreamReader. Increasing live delay to be 20% higher than segment duration:",n.toFixed(2)),R.update({streaming:{delay:{liveDelay:n}}}))}}function ye(e){e.streamId===g.id&&(de()?e.state!==u.BUFFER_EMPTY||L()||b||(b=!0,ge()):R.get().streaming.buffer.setStallState&&o.setStallState(e.mediaType,e.state===u.BUFFER_EMPTY))}function Ee(e){w.trigger(c.a.PLAYBACK_STALLED,{e:e})}function _e(e){var n;(n=e.mediaInfo)&&n.supplementalProperties&&"true"===n.supplementalProperties[a.a.SUPPLEMENTAL_PROPERTY_LL_SCHEME]&&(t.debug("Low Latency critical SupplementalProperty set: Enabling low Latency"),R.update({streaming:{lowLatencyEnabled:!0}}))}function ve(e){var t=n.getActiveStreamInfo();if(R.get().streaming.lowLatencyEnabledByManifest&&e&&t&&e.currentRepresentation&&e.streamId&&e.streamId===t.id&&e.mediaType&&(e.mediaType===a.a.VIDEO||e.mediaType===a.a.AUDIO)){var r=!e.currentRepresentation.availabilityTimeComplete;r&&R.update({streaming:{lowLatencyEnabled:r}})}}return e={initialize:function(e,t){g=e,!0!==t&&function(){o.addEventListener("canplay",X),o.addEventListener("canplaythrough",Q),o.addEventListener("play",$),o.addEventListener("waiting",Z),o.addEventListener("playing",J),o.addEventListener("pause",ee),o.addEventListener("error",ce),o.addEventListener("seeking",te),o.addEventListener("seeked",ne),o.addEventListener("timeupdate",re),o.addEventListener("progress",ie),o.addEventListener("ratechange",ae),o.addEventListener("loadedmetadata",oe),o.addEventListener("loadeddata",se),o.addEventListener("stalled",Ee),o.addEventListener("ended",ue),m=g.manifestInfo.isDynamic,A=!1,b=!1,S=!1;var e="undefined"!=typeof navigator?navigator.userAgent.toLowerCase():"",t=/safari/.test(e)&&!/chrome/.test(e);I=t?.25:.02,w.on(c.a.DATA_UPDATE_COMPLETED,z,this),w.on(c.a.LOADING_PROGRESS,me,this),w.on(h.a.BUFFER_LEVEL_STATE_CHANGED,ye,this),w.on(h.a.PLAYBACK_PROGRESS,fe,this),w.on(h.a.PLAYBACK_TIME_UPDATED,fe,this),w.on(h.a.PLAYBACK_ENDED,le,this,{priority:l.a.EVENT_PRIORITY_HIGH}),w.on(h.a.STREAM_INITIALIZING,_e,this),w.on(h.a.REPRESENTATION_SWITCH,ve,this),E&&(E=!1,O())}()},setConfig:function(e){e&&(e.streamController&&(n=e.streamController),e.dashMetrics&&(r=e.dashMetrics),e.mediaPlayerModel&&(y=e.mediaPlayerModel),e.adapter&&(i=e.adapter),e.videoModel&&(o=e.videoModel),e.timelineConverter&&(s=e.timelineConverter),e.settings&&(R=e.settings))},getTimeToStreamEnd:C,getBufferLevel:he,getTime:U,getNormalizedTime:B,getPlaybackRate:k,getPlayedRanges:function(){return g&&o?o.getPlayedRanges():null},getEnded:G,getIsDynamic:j,getStreamController:function(){return n},computeAndSetLiveDelay:function(e,n){var r,o,s,u=!isNaN(e)&&isFinite(e)?e:NaN,l=i.getSuggestedPresentationDelay();if(R.get().streaming.delay.applyServiceDescription&&isNaN(R.get().streaming.delay.liveDelay)&&isNaN(R.get().streaming.delay.liveDelayFragmentCount)&&function(e){if(!e||!e.serviceDescriptions)return;for(var n=null,r=0;r0&&(t.debug("Apply LL properties coming from service description. Target Latency (ms):",n.latency.target),R.update({streaming:{delay:{liveDelay:n.latency.target/1e3},liveCatchup:{minDrift:(n.latency.target+500)/1e3,maxDrift:n.latency.max>n.latency.target?(n.latency.max-n.latency.target+500)/1e3:void 0}}})),n.playbackRate&&n.playbackRate.max>1&&(t.debug("Apply LL properties coming from service description. Max PlaybackRate:",n.playbackRate.max),R.update({streaming:{liveCatchup:{playbackRate:n.playbackRate.max-1}}})))}(n),r=y.getLiveDelay()?y.getLiveDelay():null===R.get().streaming.delay.liveDelayFragmentCount||isNaN(R.get().streaming.delay.liveDelayFragmentCount)||isNaN(u)?!0===R.get().streaming.delay.useSuggestedPresentationDelay&&null!==l&&!isNaN(l)&&l>0?l:isNaN(u)?n&&!isNaN(n.minBufferTime)?4*n.minBufferTime:4*g.manifestInfo.minBufferTime:4*u:u*R.get().streaming.delay.liveDelayFragmentCount,null!==(s=i.getAvailabilityStartTime())&&(v=s),n&&n.dvrWindowSize>0){var c=Math.max(n.dvrWindowSize-10,n.dvrWindowSize/2);o=Math.min(r,c)}else o=r;return p=o,o},getLiveDelay:function(){return p},getCurrentLiveLatency:Y,play:O,isPaused:M,pause:P,isSeeking:L,getStreamEndTime:D,seek:x,reset:H,updateCurrentTime:W,getAvailabilityStartTime:function(){return v}},t=Object(d.a)(N).getInstance().getLogger(e),H(),e}p.__dashjs_factory_name="PlaybackController";var g=f.a.getSingletonFactory(p),m=n(18),y=n(8),E=n(9),_=n(15),v=n(5);function T(e){var t,n,r,i,o,s,u=this.context,l=Object(_.a)(u).getInstance(),f=e.textController,h=e.eventBus,p=[],g=[],m=!1,T=e.mediaSource,S=null;function A(e){return new Promise((function(t){P((function(){i.changeType&&i.changeType(e),t()}))}))}function b(e){return i=f.getTextSourceBuffer(e),Promise.resolve()}function I(){if("function"==typeof i.addEventListener)try{i.addEventListener("updateend",O,!1),i.addEventListener("error",M,!1),i.addEventListener("abort",M,!1)}catch(e){s=setInterval(O,50)}else s=setInterval(O,50)}function R(e){return new Promise((function(t){i&&l.get().streaming.buffer.useAppendWindow?P((function(){try{if(!i)return void t();var n=T.duration,a=0;e&&!isNaN(e.start)&&!isNaN(e.duration)&&isFinite(e.duration)&&(n=e.start+e.duration),e&&!isNaN(e.start)&&(a=e.start),i.appendWindowEnd===n&&i.appendWindowStart===a||(i.appendWindowStart=0,i.appendWindowEnd=n+.01,i.appendWindowStart=Math.max(a-.1,0),r.debug("Updated append window for ".concat(o.type,". Set start to ").concat(i.appendWindowStart," and end to ").concat(i.appendWindowEnd))),t()}catch(e){r.warn("Failed to set append window"),t()}})):t()}))}function N(e){return new Promise((function(t){i?P((function(){try{i.timestampOffset===e||isNaN(e)||(i.timestampOffset=e,r.debug("Set MSE timestamp offset to ".concat(e))),t()}catch(e){t()}})):t()}))}function w(){return new Promise((function(e){P((function(){var t=i.appendWindowStart,n=i.appendWindowEnd;i&&(i.abort(),i.appendWindowStart=t,i.appendWindowEnd=n),e()}))}))}function C(){if(!m&&g.length>0){m=!0;var e=g[0];g.splice(0,1);var t=function(){m=!1,g.length>0&&C.call(this),e&&e.data&&e.data.segmentType&&e.data.segmentType!==v.a.INIT_SEGMENT_TYPE&&delete e.data.bytes,e.promise.resolve({chunk:e.data})};try{S=e.request,0===e.data.bytes.byteLength?t.call(this):(i.appendBuffer?i.appendBuffer(e.data.bytes):i.append(e.data.bytes,e.data),P(t.bind(this)))}catch(t){r.fatal('SourceBuffer append failed "'+t+'"'),g.length>0?C():m=!1,delete e.data.bytes,e.promise.reject({chunk:e.data,error:new y.a(t.code,t.message)})}}}function D(){p.length>0&&(i.updating||(p.shift()(),D()))}function O(){i.updating||D()}function M(e){var t,r,i=e.target||{};t=c.a.SOURCE_BUFFER_ERROR,r={error:i,lastRequestAppended:S}||{},h.trigger(t,r,{streamId:o.streamInfo.id,mediaType:n})}function P(e){p.push(e),i.updating||D()}return t={getType:function(){return n},getAllBufferRanges:function(){try{return i.buffered}catch(e){return r.error("getAllBufferRanges exception: "+e.message),null}},getBuffer:function(){return i},append:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return new Promise((function(r,i){e?(g.push({data:e,promise:{resolve:r,reject:i},request:n}),P(C.bind(t))):i({chunk:e,error:new y.a(E.a.APPEND_ERROR_CODE,E.a.APPEND_ERROR_MESSAGE)})}))},remove:function(e){return new Promise((function(t,n){var r=e.start,a=e.end;r>=0&&a>r?P((function(){try{i.remove(r,a),P((function(){t({from:r,to:a,unintended:!1}),e.resolve&&e.resolve()}))}catch(t){n({from:r,to:a,unintended:!1,error:new y.a(E.a.REMOVE_ERROR_CODE,E.a.REMOVE_ERROR_MESSAGE)}),e.reject&&e.reject(t)}})):t()}))},abort:function(){return new Promise((function(e){try{g=[],"open"===T.readyState?P((function(){i&&i.abort(),e()})):i&&i.setTextTrack&&"ended"===T.readyState?(i.abort(),e()):e()}catch(t){e()}}))},reset:function(){if(i){try{p=[],function(){try{"function"==typeof i.removeEventListener&&(i.removeEventListener("updateend",O,!1),i.removeEventListener("error",M,!1),i.removeEventListener("abort",M,!1)),clearInterval(s)}catch(e){r.error(e)}}(),m=!1,g=[],i.getClassName&&"TextSourceBuffer"===i.getClassName()||(r.debug("Removing sourcebuffer from media source"),T.removeSourceBuffer(i))}catch(e){}i=null}S=null},updateTimestampOffset:N,initializeForStreamSwitch:function(e,t,r){n=(o=e).type;var a=o.codec;!function(e){i=e.getBuffer()}(r),I();var s=[];return s.push(w),s.push(R(o.streamInfo)),s.push(A(a)),t&&void 0!==t.MSETimeOffset&&s.push(N(t.MSETimeOffset)),Promise.all(s)},initializeForFirstUse:function(e,t,r){n=(o=t).type;var s=o.codec;try{if(s.match(/application\/mp4;\s*codecs="(stpp|wvtt).*"/i))return b(e);i=T.addSourceBuffer(s),I();var u=[];return u.push(R(o.streamInfo)),r&&void 0!==r.MSETimeOffset&&u.push(N(r.MSETimeOffset)),Promise.all(u)}catch(t){return o.type==a.a.TEXT&&!o.isFragmented||-1!==s.indexOf('codecs="stpp')||-1!==s.indexOf('codecs="vtt')?b(e):Promise.reject(t)}},updateAppendWindow:R,changeType:A},r=Object(d.a)(u).getInstance().getLogger(t),t}T.__dashjs_factory_name="SourceBufferSink";var S=f.a.getClassFactory(T);function A(){var e={};return{save:function(t){var n=t.streamId,r=t.representationId;e[n]=e[n]||{},e[n][r]=t},extract:function(t,n){return e&&e[t]&&e[t][n]?e[t][n]:null},reset:function(){e={}}}}A.__dashjs_factory_name="InitCache";var b=f.a.getSingletonFactory(A);function I(e){e=e||{};var t,n,r,i,o,s,f,p,g,_,T,A,I,R,N,w,C,D,O=this.context,M=Object(l.a)(O).getInstance(),P=e.errHandler,L=e.fragmentModel,F=e.representationController,x=e.adapter,U=e.textController,B=e.abrController,k=e.playbackController,G=e.streamInfo,j=e.type,Y=e.settings;function H(e){s=e}function K(e){return x.convertRepresentationToRepresentationInfo(F.getRepresentationForQuality(e))}function q(e,t,n){var r=K(n);return t&&t[j]&&(j===a.a.VIDEO||j===a.a.AUDIO)?g.initializeForStreamSwitch(e,r,t[j]):g.initializeForFirstUse(G,e,r)}function V(e){Y.get().streaming.cacheInitSegments&&(n.info("Init fragment finished loading saving to",j+"'s init cache"),N.save(e.chunk)),n.debug("Append Init fragment",j," with representationId:",e.chunk.representationId," and quality:",e.chunk.quality,", data size:",e.chunk.bytes.byteLength),z(e.chunk)}function W(e){z(e.chunk,e.request)}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;g.append(e,t).then((function(e){Q(e)})).catch((function(e){Q(e)})),e.mediaInfo.type===a.a.VIDEO&&Ee(c.a.VIDEO_CHUNK_RECEIVED,{chunk:e})}function X(e){if(e&&e.length>0)for(var t=0,r=e.length;t0){var e=Math.max(.2*o,1),t=o-e,r=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQuality,.9*t),i=Math.min(Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm,.9*t),a={streaming:{buffer:{bufferToKeep:parseFloat(e.toFixed(5)),bufferTimeAtTopQuality:parseFloat(r.toFixed(5)),bufferTimeAtTopQualityLongForm:parseFloat(i.toFixed(5))}}};Y.update(a)}}(),void(22!==e.error.code&&ye()||(n.warn("Clearing playback buffer to overcome quota exceed situation"),Ee(c.a.QUOTA_EXCEEDED,{criticalBufferLevel:o,quotaExceededTime:e.chunk.start}),ue(se())));if(g&&(re(),R=!1,(T=e.chunk)&&T.endFragment)){T&&!isNaN(T.index)&&(f=Math.max(T.index,f),ie());var t=g.getAllBufferRanges();T.segmentType===v.a.MEDIA_SEGMENT_TYPE&&(X(t),J(),function(){if(isNaN(D))return;if(j!==a.a.AUDIO&&j!==a.a.VIDEO)return void(D=NaN);var e=k.getTime(),t=ne(D,0);if(e===D&&t)return void(D=NaN);var n=F.getCurrentRepresentation().segmentDuration;if(!(t=ne(D,n)))return;Y.get().streaming.buffer.enableSeekDecorrelationFix&&Math.abs(e-D)>n?D<=t.end&&(k.seek(Math.max(D,t.start),!1,!0),D=NaN):en){var i=Math.max(0,e-n),a=L.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:e,threshold:.01})[0];if(a&&(i=Math.min(a.startTime,i)),i>0)return{start:r,end:i}}return null}(e,n),i=function(e,t){var n=t.end(t.length-1)+.5,r=G.manifestInfo.duration>=Y.get().streaming.buffer.longFormContentDurationThreshold?Y.get().streaming.buffer.bufferTimeAtTopQualityLongForm:Y.get().streaming.buffer.bufferTimeAtTopQuality;if(n-e>r){var i=e+r,a=L.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:e,threshold:.01})[0];if(a&&(i=Math.max(a.startTime+a.duration,i)),i=a&&e=p-1,t=k.getTimeToStreamEnd(G)-i<=0;!e&&!t||r||(ge(!0),n.debug("checkIfBufferingCompleted trigger BUFFERING_COMPLETED for stream id ".concat(G.id," and type ").concat(j)))}function ae(){j!==a.a.AUDIO&&j!==a.a.VIDEO||((!Y.get().streaming.lowLatencyEnabled&&i=Y.get().streaming.buffer.stallThreshold||Y.get().streaming.lowLatencyEnabled&&i>0)&&oe(u.BUFFER_LOADED))}function oe(e){_===e||e===u.BUFFER_EMPTY&&0===k.getTime()||j===a.a.TEXT&&!U.isTextEnabled()||(_=e,Ee(c.a.BUFFER_LEVEL_STATE_CHANGED,{state:e}),Ee(e===u.BUFFER_LOADED?c.a.BUFFER_LOADED:c.a.BUFFER_EMPTY),n.debug(e===u.BUFFER_LOADED?"Got enough buffer to start":"Waiting for more buffer before starting playback"))}function se(){var e=[],t=g.getAllBufferRanges();if(!t||0===t.length)return e;var n=k.getTime(),r=Math.max(0,n-Y.get().streaming.buffer.bufferToKeep),i=L.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:n,threshold:.01})[0];if(i)r=Math.min(i.startTime,r);else if(0===n&&k.getIsDynamic())return[];if(t.start(0)<=r){for(var a={start:0,end:r},o=0;o=Y.get().streaming.buffer.bufferPruningInterval&&(A=0,g&&j!==a.a.TEXT&&(r||ue(se())))}function pe(){ae()}function ge(e){r!==e&&((r=e)?Ee(c.a.BUFFERING_COMPLETED):p=Number.POSITIVE_INFINITY)}function me(){try{var e,t,n=g.getAllBufferRanges(),r=0;if(!n)return r;for(t=0,e=n.length;t1&&void 0!==arguments[1]?arguments[1]:[];return new Promise((function(r,i){if(N&&e&&s){var a=B.getQualityFor(j,G.id);g=S(O).create({mediaSource:s,textController:U,eventBus:M}),q(e,t,a).then((function(){return fe(K(a))})).then((function(){r(g)})).catch((function(e){n.fatal("Caught error on create SourceBuffer: "+e),P.error(new y.a(E.a.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,E.a.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+j)),i(e)}))}else r(null)}))},getBuffer:function(){return g},getBufferLevel:function(){return i},getRangeAt:ne,setMediaSource:H,getMediaSource:function(){return s},appendInitSegmentFromCache:function(e){var t=N.extract(G.id,e);return!!t&&(n.info("Append Init fragment",j," with representationId:",t.representationId," and quality:",t.quality,", data size:",t.bytes.byteLength),z(t),!0)},getIsBufferingCompleted:function(){return r},setIsBufferingCompleted:ge,getIsPruningInProgress:function(){return I},reset:function(e,t){M.off(c.a.INIT_FRAGMENT_LOADED,V,this),M.off(c.a.MEDIA_FRAGMENT_LOADED,W,this),M.off(c.a.WALLCLOCK_TIME_UPDATED,he,this),M.off(h.a.PLAYBACK_PLAYING,te,this),M.off(h.a.PLAYBACK_PROGRESS,J,this),M.off(h.a.PLAYBACK_TIME_UPDATED,J,this),M.off(h.a.PLAYBACK_RATE_CHANGED,pe,this),M.off(h.a.PLAYBACK_STALLED,ee,this),_e(e,t)},prepareForPlaybackSeek:function(){return r&&ge(!1),g.abort()},prepareForReplacementTrackSwitch:function(e){return new Promise((function(t,n){g.abort().then((function(){return de()})).then((function(){return g.changeType(e)})).then((function(){return $()})).then((function(){ge(!1),t()})).catch((function(e){n(e)}))}))},prepareForNonReplacementTrackSwitch:function(e){return new Promise((function(t,n){de().then((function(){return g.changeType(e)})).then((function(){t()})).catch((function(e){n(e)}))}))},prepareForReplacementQualitySwitch:function(){return new Promise((function(e,t){g.abort().then((function(){return de()})).then((function(){return $()})).then((function(){ge(!1),e()})).catch((function(e){t(e)}))}))},updateAppendWindow:de,getAllRangesWithSafetyFactor:Z,getContinuousBufferTimeForTargetTime:function(e){try{var t=e,n=g.getAllBufferRanges();if(!n||0===n.length)return e;for(var r=0;t===e&&r=i&&t<=a&&(t=a),r+=1}return t}catch(e){}},clearBuffers:ue,pruneAllSafely:$,updateBufferTimestampOffset:fe,setSeekTarget:function(e){D=e},segmentRequestingCompleted:function(e){isNaN(e)||(p=e,ie())}},n=Object(d.a)(O).getInstance().getLogger(t),N=b(O).getInstance(),_e(),t}I.__dashjs_factory_name="BufferController";var R=f.a.getClassFactory(I);function N(e){e=e||{};var t,n,r,i,a,o,s=this.context,u=Object(l.a)(s).getInstance(),f=e.textController,d=e.errHandler,h=e.streamInfo,p=e.type;function g(e){i=e}function m(e){var t,r,i;n!==e&&((n=e)&&(t=c.a.BUFFERING_COMPLETED,i=r||{},u.trigger(t,i,{streamId:h.id,mediaType:p})))}function _(e){e.chunk.bytes&&!n&&(o.save(e.chunk),a.append(e.chunk),m(!0))}return t={initialize:function(e){g(e)},getStreamId:function(){return h.id},getType:function(){return p},getBufferControllerType:function(){return"NotFragmentedTextBufferController"},createBufferSink:function(e){return new Promise((function(t,n){try{(a=S(s).create({mediaSource:i,textController:f,eventBus:u})).initializeForFirstUse(h,e),r||(a.getBuffer()&&"function"==typeof a.getBuffer().initialize&&a.getBuffer().initialize(),r=!0),t(a)}catch(e){d.error(new y.a(E.a.MEDIASOURCE_TYPE_UNSUPPORTED_CODE,E.a.MEDIASOURCE_TYPE_UNSUPPORTED_MESSAGE+p)),n(e)}}))},getBuffer:function(){return a},getBufferLevel:function(){return 0},getRangeAt:function(){return null},getAllRangesWithSafetyFactor:function(){return[]},getContinuousBufferTimeForTargetTime:function(){return Number.POSITIVE_INFINITY},setMediaSource:g,getMediaSource:function(){return i},appendInitSegmentFromCache:function(e){return null!==o.extract(h.id,e)},getIsBufferingCompleted:function(){return n},setIsBufferingCompleted:m,getIsPruningInProgress:function(){return!1},reset:function(e){u.off(c.a.INIT_FRAGMENT_LOADED,_,t),!e&&a&&(a.abort(),a.reset(),a=null)},clearBuffers:function(){return Promise.resolve()},prepareForPlaybackSeek:function(){return Promise.resolve()},prepareForReplacementTrackSwitch:function(){return n=!1,Promise.resolve()},setSeekTarget:function(){},updateAppendWindow:function(){return Promise.resolve()},pruneAllSafely:function(){return Promise.resolve()},updateBufferTimestampOffset:function(){return Promise.resolve()},segmentRequestingCompleted:function(){}},r=!1,i=null,n=!1,o=b(s).getInstance(),u.on(c.a.INIT_FRAGMENT_LOADED,_,t),t}N.__dashjs_factory_name="NotFragmentedTextBufferController";var w=f.a.getClassFactory(N);function C(e){e=e||{};var t,n,r,i,o,s,f,p,g,y,E,_,v,T=this.context,S=Object(l.a)(T).getInstance(),A=e.dashMetrics,b=e.mediaPlayerModel,I=e.fragmentModel,R=e.abrController,N=e.playbackController,w=e.textController,C=e.type,D=e.bufferController,O=e.settings;function M(e){if(!D.getIsBufferingCompleted()){P();var t=isNaN(e)?0:e;s=setTimeout(L,t)}}function P(){s&&(clearTimeout(s),s=null)}function L(){try{if(function(){try{return C===a.a.TEXT&&!w.isTextEnabled()}catch(e){return!1}}())return void P();if(function(){try{return i&&(isNaN(y)||E||(e=n.id,t=R.getMaxAllowedIndexFor(C,e),!(!isNaN(g)&&g==t||(r.info("Top quality "+C+" index has changed from "+g+" to "+t),g=t,0)))||function(){if(!C||!i)return!0;return A.getCurrentBufferLevel(C)=O.get().streaming.buffer.longFormContentDurationThreshold?O.get().streaming.buffer.bufferTimeAtTopQualityLongForm:O.get().streaming.buffer.bufferTimeAtTopQuality:b.getStableBufferTime()}catch(e){return b.getStableBufferTime()}}():e}function x(){U(!0)}function U(e){if(N&&I){var t=I.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:N.getTime(),threshold:0})[0];t&&N.getTime()>=t.startTime&&((!p.mediaInfo||t.mediaInfo.type===p.mediaInfo.type&&t.mediaInfo.id!==p.mediaInfo.id)&&e&&S.trigger(c.a.TRACK_CHANGE_RENDERED,{mediaType:C,oldMediaInfo:p.mediaInfo,newMediaInfo:t.mediaInfo,streamId:n.id}),t.quality===p.quality&&t.adaptationIndex===p.adaptationIndex||!e||(r.debug("Quality change rendered for streamId ".concat(n.id," and type ").concat(C)),S.trigger(c.a.QUALITY_CHANGE_RENDERED,{mediaType:C,oldQuality:p.quality,newQuality:t.quality,streamId:n.id})),p={mediaInfo:t.mediaInfo,quality:t.quality,adaptationIndex:t.adaptationIndex})}}function B(e){r.debug("Appended bytes for ".concat(e.mediaType," and stream id ").concat(n.id)),(isNaN(e.index)||isNaN(y))&&(y=e.quality,r.info("["+C+"] lastInitializedRepresentationInfo changed to "+e.quality)),M(0)}function k(){I.abortRequests(),P()}function G(){O.get().streaming.scheduling.scheduleWhilePaused||M()}function j(e){A.updatePlayListTraceMetrics({playbackspeed:e.playbackRate.toString()})}function Y(){v=!0,o=0,y=NaN,p={mediaInfo:void 0,quality:NaN,adaptationIndex:NaN},g=NaN,E=!1,_=!1}return t={initialize:function(e){f=e,S.on(c.a.BYTES_APPENDED_END_FRAGMENT,B,t),S.on(c.a.URL_RESOLUTION_FAILED,k,t),S.on(h.a.PLAYBACK_STARTED,G,t),S.on(h.a.PLAYBACK_RATE_CHANGED,j,t),S.on(h.a.PLAYBACK_TIME_UPDATED,x,t)},getType:function(){return C},getStreamId:function(){return n.id},setCurrentRepresentation:function(e){i=e},setTimeToLoadDelay:function(e){o=e},getTimeToLoadDelay:function(){return o},setSwitchTrack:function(e){E=e},getSwitchStrack:function(){return E},startScheduleTimer:M,clearScheduleTimer:P,reset:function(){S.off(c.a.BYTES_APPENDED_END_FRAGMENT,B,t),S.off(c.a.URL_RESOLUTION_FAILED,k,t),S.off(h.a.PLAYBACK_STARTED,G,t),S.off(h.a.PLAYBACK_RATE_CHANGED,j,t),S.off(h.a.PLAYBACK_TIME_UPDATED,x,t),P(),U(!1),Y(),n=null},getBufferTarget:F,getPlaybackController:function(){return N},setCheckPlaybackQuality:function(e){v=e},setInitSegmentRequired:function(e){_=e}},r=Object(d.a)(T).getInstance().getLogger(t),Y(),n=e.streamInfo,t}C.__dashjs_factory_name="ScheduleController";var D=f.a.getClassFactory(C),O=n(54),M=n(13),P=n(31),L=n(23),F=n(11),x=n(20);function U(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var B=function e(){U(this,e),this.start=null,this.mstart=null,this.starttype=null,this.trace=[]};B.INITIAL_PLAYOUT_START_REASON="initial_playout",B.SEEK_START_REASON="seek",B.RESUME_FROM_PAUSE_START_REASON="resume",B.METRICS_COLLECTION_START_REASON="metrics_collection_start";var k=function e(){U(this,e),this.representationid=null,this.subreplevel=null,this.start=null,this.mstart=null,this.duration=null,this.playbackspeed=null,this.stopreason=null};k.REPRESENTATION_SWITCH_STOP_REASON="representation_switch",k.REBUFFERING_REASON="rebuffering",k.USER_REQUEST_STOP_REASON="user_request",k.END_OF_PERIOD_STOP_REASON="end_of_period",k.END_OF_CONTENT_STOP_REASON="end_of_content",k.METRICS_COLLECTION_STOP_REASON="metrics_collection_end",k.FAILURE_STOP_REASON="failure";var G=n(32);function j(e){e=e||{};var t,n,r,i,s,f,h,p,g,_,T,S,A,b,I=this.context,N=Object(l.a)(I).getInstance(),C=e.streamInfo,U=e.type,B=e.errHandler,j=e.mimeType,Y=e.timelineConverter,H=e.adapter,K=e.manifestModel,q=e.mediaPlayerModel,V=e.fragmentModel,W=e.abrController,z=e.playbackController,X=e.mediaController,Q=e.textController,$=e.dashMetrics,Z=e.settings,J=e.boxParser,ee=e.segmentBlacklistController;function te(){return C.id}function ne(){return U}function re(){return H.getIsTextTrack(p.getData())}function ie(){s=[],i=null,b=0,g=!1,T=!1,_=!1}function ae(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.sender)if(T)ce();else if((!re()||Q.isTextEnabled())&&f&&e.representationId&&!f.appendInitSegmentFromCache(e.representationId)){var n=p.getCurrentRepresentation();if(0===n.range)return void oe();var r=S?S.getInitRequest(i,n):null;r?V.executeRequest(r):t&&(h.setInitSegmentRequired(!0),ce())}}function oe(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(T||f.getIsPruningInProgress())ce();else{var n=le();n?(g=!1,se(n)):ue(t)}}function se(e){isNaN(e.startTime+e.duration)||(b=e.startTime+e.duration),e.delayLoadingTime=(new Date).getTime()+h.getTimeToLoadDelay(),h.setTimeToLoadDelay(0),!function(e){var t=e.url;e.range&&(t=t.concat("_",e.range));return ee.contains(t)}(e)?(n.debug("Next fragment request url for stream id ".concat(C.id," and media type ").concat(U," is ").concat(e.url)),V.executeRequest(e)):(n.warn("Fragment request url ".concat(e.url," for stream id ").concat(C.id," and media type ").concat(U," is on the ignore list and will be skipped")),ce())}function ue(e){var t=p.getCurrentRepresentation();if(Z.get().streaming.gaps.enableSeekFix&&!r&&g&&z.isSeeking()){var a=S.getValidSeekTimeCloseToTargetTime(b,i,t,Z.get().streaming.gaps.threshold);if(!isNaN(a))return void z.seek(a,!1,!1)}if(S.isLastSegmentRequested(t,b)){var o=S.getCurrentIndex();return n.debug("Segment requesting for stream ".concat(C.id," has finished")),N.trigger(c.a.STREAM_REQUESTING_COMPLETED,{segmentIndex:o},{streamId:C.id,mediaType:U}),f.segmentRequestingCompleted(o),void h.clearScheduleTimer()}e&&ce()}function le(){var e,t=Re();if(isNaN(b)||ne()===a.a.TEXT&&!Q.isTextEnabled())return null;var n=g;if(S){var r=p&&t?p.getRepresentationForQuality(t.quality):null;e=n?S.getSegmentRequestForTime(i,r,b):S.getNextSegmentRequest(i,r)}return e}function ce(){h.startScheduleTimer(Z.get().streaming.lowLatencyEnabled?Z.get().streaming.scheduling.lowLatencyTimeout:Z.get().streaming.scheduling.defaultTimeout)}function fe(){T=!0}function de(){T=!1}function he(e){e.error||(h.setCurrentRepresentation(H.convertRepresentationToRepresentationInfo(e.currentRepresentation)),f.getIsBufferingCompleted()||f.updateBufferTimestampOffset(e.currentRepresentation))}function pe(e){$.addBufferState(U,e.state,h.getBufferTarget()),e.state!==u.BUFFER_EMPTY||z.isSeeking()||(n.info("Buffer is empty! Stalling!"),$.pushPlayListTraceMetrics(new Date,k.REBUFFERING_REASON))}function ge(e){V.syncExecutedRequestsWithBufferedRange(f.getBuffer().getAllBufferRanges(),C.duration),e.quotaExceeded&&e.from>z.getTime()&&Me(e.from),e.hasEnoughSpaceToAppend&&e.quotaExceeded&&h.startScheduleTimer()}function me(e){if(e&&e.lastRequestAppended&&e.lastRequestAppended.url){var t=e.lastRequestAppended.url;e.lastRequestAppended.range&&(t=t.concat("_",e.lastRequestAppended.range)),n.warn("Blacklisting segment with url ".concat(t)),ee.add(t)}}function ye(){De(),_=!1}function Ee(e){n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has been aborted"),z.isSeeking()||h.getSwitchStrack()||_||(n.info("onFragmentLoadingAbandoned request: "+e.request.url+" has to be downloaded again, origin is not seeking process or switch track call"),e.request&&e.request.isInitializationRequest()?h.setInitSegmentRequired(!0):Me(e.request.startTime+e.request.duration/2),h.startScheduleTimer(0))}function _e(e){n.info("OnFragmentLoadingCompleted for stream id "+C.id+" and media type "+U+" - Url:",e.request?e.request.url:"undefined",e.request.range?", Range:"+e.request.range:""),re()&&h.startScheduleTimer(0),e.error&&e.request.serviceLocation&&function(e){if(n.info("Fragment loading completed with an error"),!e||!e.request||!e.request.type)return;e.request.type===v.a.INIT_SEGMENT_TYPE?ae({representationId:e.request.representationId,sender:{}},!1):e.request.type===v.a.MEDIA_SEGMENT_TYPE&&(Me(e.request.startTime+e.request.duration/2),oe({},!1))}(e)}function ve(){Me(z.getTime()),Ie().startScheduleTimer()}function Te(e){var t=e.currentTrackInfo;if(t){var n=s.find((function(e){return e.index===t.index&&e.lang===t.lang}));n&&be(n).then((function(){f.setIsBufferingCompleted(!1),Me(z.getTime()),h.setInitSegmentRequired(!0),h.startScheduleTimer()}))}}function Se(e){Me(e.quotaExceededTime),h.clearScheduleTimer()}function Ae(){return f?f.getBuffer():null}function be(e){e===i||e&&i&&e.type!==i.type||(i=e);var t=H.getRealAdaptation(C,i),n=H.getVoRepresentations(i);if(p){var r,o=p.getData(),s=W.getMaxAllowedIndexFor(U,C.id),u=W.getMinAllowedIndexFor(U,C.id),l=null;return null!==o&&o.id===t.id||U===a.a.TEXT?r=W.getQualityFor(U,C.id):(l=W.getThroughputHistory().getAverageThroughput(U)||W.getInitialBitrateFor(U,C.id),r=W.getQualityForBitrate(i,l,C.id)),void 0!==u&&rs&&(r=s),p.updateData(t,n,U,i.isFragmented,r)}return Promise.resolve()}function Ie(){return h}function Re(e){var t;return void 0!==e?(Object(M.a)(e),t=p?p.getRepresentationForQuality(e):null):t=p?p.getCurrentRepresentation():null,H.convertRepresentationToRepresentationInfo(t)}function Ne(){return!!f&&f.getIsBufferingCompleted()}function we(e){var t=e.chunk,n=t.bytes,r=t.quality,i=Re(r),a=p&&i?p.getRepresentationForQuality(i.quality):null;if(i&&a){var o=H.getEventsFor(i.mediaInfo),s=H.getEventsFor(i,a);if(o&&o.length>0||s&&s.length>0){var u=function(e,t,n,r){try{for(var i={},a=[],o=n.concat(r),s=0,u=o.length;sZ.get().streaming.buffer.stallThreshold;if(f.getIsBufferingCompleted()&&!t)return f.prepareForNonReplacementTrackSwitch(i.codec).then((function(){N.trigger(c.a.BUFFERING_COMPLETED,{},{streamId:C.id,mediaType:U})})).catch((function(){N.trigger(c.a.BUFFERING_COMPLETED,{},{streamId:C.id,mediaType:U})})),void e();h.clearScheduleTimer(),h.setSwitchTrack(!0),t?(N.trigger(c.a.BUFFER_REPLACEMENT_STARTED,{mediaType:U,streamId:C.id},{mediaType:U,streamId:C.id}),V.abortRequests(),f.prepareForReplacementTrackSwitch(i.codec).then((function(){var e=Re();return f.updateBufferTimestampOffset(e)})).then((function(){Ce(),e()})).catch((function(){Ce(),e()}))):f.prepareForNonReplacementTrackSwitch(i.codec).then((function(){De(),e()})).catch((function(){De(),e()}))}))},prepareQualityChange:function(e){n.debug("Preparing quality switch for type ".concat(U));var t=e.newQuality;_=!0,h.clearScheduleTimer();var r=Re(t);h.setCurrentRepresentation(r),p.prepareQualityChange(t),V.abortRequests(),f.updateBufferTimestampOffset(r).then((function(){e.reason&&e.reason.forceReplace?(N.trigger(c.a.BUFFER_REPLACEMENT_STARTED,{mediaType:U,streamId:C.id},{mediaType:U,streamId:C.id}),f.prepareForReplacementQualitySwitch().then((function(){Ce(),_=!1})).catch((function(){Ce(),_=!1}))):Z.get().streaming.buffer.fastSwitchEnabled?function(e){var t=z.getTime(),n=V.getRequests({state:m.a.FRAGMENT_MODEL_EXECUTED,time:t+1.5,threshold:0})[0];if(n&&!re()){var r=f.getBufferLevel(),i=W.getAbandonmentStateFor(C.id,U);if(n.quality=1.5&&i!==u.ABANDON_LOAD)Me(t+1.5),h.setCheckPlaybackQuality(!1),h.startScheduleTimer();else ye()}else h.startScheduleTimer();_=!1}(r):ye(),$.pushPlayListTraceMetrics(new Date,k.REPRESENTATION_SWITCH_STOP_REASON),$.createPlaylistTraceMetrics(r.id,1e3*z.getTime(),z.getPlaybackRate())}))},getMediaInfo:function(){return i},getMediaSource:function(){return f.getMediaSource()},setMediaSource:function(e){f.setMediaSource(e)},getBuffer:Ae,setExplicitBufferingTime:Me,finalisePlayList:function(e,t){$.pushPlayListTraceMetrics(e,t)},probeNextRequest:function(){var e=Re(),t=p&&e?p.getRepresentationForQuality(e.quality):null;return S.getNextSegmentRequestIdempotent(i,t)},prepareInnerPeriodPlaybackSeeking:function(e){return new Promise((function(t){h.clearScheduleTimer(),V.abortRequests(),f.prepareForPlaybackSeek().then((function(){var t=f.getAllRangesWithSafetyFactor(e.seekTime);return f.clearBuffers(t)})).then((function(){var n=f.getContinuousBufferTimeForTargetTime(e.seekTime);if(!isNaN(C.duration)&&isFinite(C.duration)&&n>=C.start+C.duration)f.setIsBufferingCompleted(!0),t();else{Me(n),f.setSeekTarget(n);var r=[];r.push(f.updateAppendWindow());var i=Re();r.push(f.updateBufferTimestampOffset(i)),Promise.all(r).then((function(){h.setInitSegmentRequired(!0),h.setCheckPlaybackQuality(!1),h.startScheduleTimer(),t()}))}})).catch((function(e){n.error(e)}))}))},prepareOuterPeriodPlaybackSeeking:function(){return new Promise((function(e,t){try{h.clearScheduleTimer(),V.abortRequests(),f.prepareForPlaybackSeek().then((function(){return f.pruneAllSafely()})).then((function(){e()}))}catch(e){t(e)}}))},reset:function(e,n){S&&S.reset(),f&&(f.reset(e,n),f=null),h&&(h.reset(),h=null),p&&(p.reset(),p=null),A&&(A=null),W&&W.unRegisterStreamType(te(),U),N.off(c.a.DATA_UPDATE_COMPLETED,he,t),N.off(c.a.INIT_FRAGMENT_NEEDED,ae,t),N.off(c.a.MEDIA_FRAGMENT_NEEDED,oe,t),N.off(c.a.MEDIA_FRAGMENT_LOADED,we,t),N.off(c.a.BUFFER_LEVEL_STATE_CHANGED,pe,t),N.off(c.a.BUFFER_CLEARED,ge,t),N.off(c.a.SEEK_TARGET,Oe,t),N.off(c.a.FRAGMENT_LOADING_ABANDONED,Ee,t),N.off(c.a.FRAGMENT_LOADING_COMPLETED,_e,t),N.off(c.a.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ve,t),N.off(c.a.SET_NON_FRAGMENTED_TEXT,Te,t),N.off(c.a.QUOTA_EXCEEDED,Se,t),N.off(c.a.MANIFEST_UPDATED,fe,t),N.off(c.a.STREAMS_COMPOSED,de,t),N.off(c.a.SOURCE_BUFFER_ERROR,me,t),ie(),U=null,C=null}},n=Object(d.a)(I).getInstance().getLogger(t),ie(),N.on(c.a.DATA_UPDATE_COMPLETED,he,t,{priority:l.a.EVENT_PRIORITY_HIGH}),N.on(c.a.INIT_FRAGMENT_NEEDED,ae,t),N.on(c.a.MEDIA_FRAGMENT_NEEDED,oe,t),N.on(c.a.MEDIA_FRAGMENT_LOADED,we,t),N.on(c.a.BUFFER_LEVEL_STATE_CHANGED,pe,t),N.on(c.a.BUFFER_CLEARED,ge,t),N.on(c.a.SEEK_TARGET,Oe,t),N.on(c.a.FRAGMENT_LOADING_ABANDONED,Ee,t),N.on(c.a.FRAGMENT_LOADING_COMPLETED,_e,t),N.on(c.a.QUOTA_EXCEEDED,Se,t),N.on(c.a.SET_FRAGMENTED_TEXT_AFTER_DISABLED,ve,t),N.on(c.a.SET_NON_FRAGMENTED_TEXT,Te,t),N.on(c.a.MANIFEST_UPDATED,fe,t),N.on(c.a.STREAMS_COMPOSED,de,t),N.on(c.a.SOURCE_BUFFER_ERROR,me,t),t}j.__dashjs_factory_name="StreamProcessor";var Y=f.a.getClassFactory(j),H=n(55),K=n(58);function q(e){e=e||{};var t,n,r,i=this.context,o=Object(l.a)(i).getInstance(),s=e.errHandler,u=e.mediaPlayerModel,f=e.dashMetrics,p=Object(d.a)(i).getInstance(),g=e.streamInfo;function y(){return g.id}function _(){for(var e in r)r[e].reset();r={}}function v(e){if(e.sender){var t=e.request,r=e.response,i=t.isInitializationRequest(),s=t.mediaInfo.streamInfo;if(e.error&&(t.mediaType===a.a.AUDIO||t.mediaType===a.a.VIDEO||t.mediaType===a.a.TEXT&&t.mediaInfo.isFragmented)&&o.trigger(c.a.SERVICE_LOCATION_BLACKLIST_ADD,{entry:e.request.serviceLocation}),r&&s){var u=function(e,t,n,r){var i=new H.a;return i.streamId=n,i.mediaInfo=t.mediaInfo,i.segmentType=t.type,i.start=t.startTime,i.duration=t.duration,i.end=i.start+i.duration,i.bytes=e,i.index=t.index,i.quality=t.quality,i.representationId=t.representationId,i.endFragment=r,i}(r,t,g.id,e.type!==c.a.FRAGMENT_LOADING_PROGRESS);o.trigger(i?c.a.INIT_FRAGMENT_LOADED:c.a.MEDIA_FRAGMENT_LOADED,{chunk:u,request:t},{streamId:s.id,mediaType:t.mediaType})}else n.warn("No "+t.mediaType+" bytes to push or stream is inactive.")}}return t={getStreamId:y,getModel:function(t){var n=r[t];return n||(n=Object(m.a)(i).create({streamInfo:g,type:t,dashMetrics:f,fragmentLoader:Object(K.a)(i).create({dashMetrics:f,mediaPlayerModel:u,errHandler:s,requestModifier:Object(L.a)(i).getInstance(),settings:e.settings,boxParser:e.boxParser,eventBus:o,events:c.a,errors:E.a,dashConstants:e.dashConstants,urlUtils:e.urlUtils,streamId:y()}),debug:p,eventBus:o,events:c.a}),r[t]=n),n},reset:function(){o.off(h.a.FRAGMENT_LOADING_COMPLETED,v,this),o.off(h.a.FRAGMENT_LOADING_PROGRESS,v,this),_()}},n=p.getLogger(t),_(),o.on(h.a.FRAGMENT_LOADING_COMPLETED,v,t),o.on(h.a.FRAGMENT_LOADING_PROGRESS,v,t),t}q.__dashjs_factory_name="FragmentController";var V=f.a.getClassFactory(q);var W=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=null,this.width=null,this.height=null,this.x=null,this.y=null},z=n(29);var X=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.mediaType=null,this.bitrate=null,this.width=null,this.height=null,this.scanType=null,this.qualityIndex=NaN},Q=n(10);function $(e){var t,n,r=this.context,i=e.streamInfo;function o(e){n.setTrackByIndex(e)}function s(){n&&n.reset()}return t={getStreamId:function(){return i.id},initialize:function(){n.addTracks();var e=n.getTracks();e&&e.length>0&&o(0)},provide:function(e,t){if("function"==typeof t){var r,i,a=n.getCurrentTrack();if(!a||a.segmentDuration<=0||null==e)t(null);else{(i=n.getThumbnailRequestForTime(e))&&(a.segmentDuration=i.duration),r=e%a.segmentDuration;var o=Math.floor(r*a.tilesHor*a.tilesVert/a.segmentDuration),s=new W;if(s.width=Math.floor(a.widthPerTile),s.height=Math.floor(a.heightPerTile),s.x=Math.floor(o%a.tilesHor)*a.widthPerTile,s.y=Math.floor(o/a.tilesHor)*a.heightPerTile,"readThumbnail"in a)return a.readThumbnail(e,(function(e){s.url=e,t(s)}));if(i)s.url=i.url,a.segmentDuration=NaN;else{var u=Math.floor(e/a.segmentDuration);s.url=function(e,t){var n=t+e.startNumber,r=Object(Q.d)(e.templateUrl,"Number",n);return r=Object(Q.d)(r,"Time",(n-1)*e.segmentDuration*e.timescale),r=Object(Q.d)(r,"Bandwidth",e.bandwidth),Object(Q.e)(r)}(a,u)}t(s)}}},setTrackByIndex:o,getCurrentTrackIndex:function(){return n.getCurrentTrackIndex()},getBitrateList:function(){var e=n.getTracks(),t=0;return e.map((function(e){var n=new X;return n.mediaType=a.a.IMAGE,n.qualityIndex=t++,n.bitrate=e.bitrate,n.width=e.width,n.height=e.height,n}))},reset:s},s(),n=Object(z.b)(r).create({streamInfo:i,adapter:e.adapter,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:e.debug,eventBus:e.eventBus,events:e.events,dashConstants:e.dashConstants,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController}),t}$.__dashjs_factory_name="ThumbnailController";var Z=f.a.getClassFactory($);function J(e){var t;e=e||{};var n=[],r=Object(l.a)(this.context).getInstance(),i=e.updateEventName,a=e.addBlacklistEventName;function o(e){-1===n.indexOf(e)&&(n.push(e),r.trigger(i,{entry:e}))}function s(e){o(e.entry)}return t={add:o,contains:function(e){return!!(n.length&&e&&e.length)&&-1!==n.indexOf(e)},reset:function(){n=[]}},a&&r.on(a,s,t),t}J.__dashjs_factory_name="BlackListController";var ee=f.a.getClassFactory(J),te=[a.a.VIDEO,a.a.AUDIO,a.a.TEXT,a.a.MUXED,a.a.IMAGE];function ne(e){e=e||{};var t,n,r,i,s,u,f,h,p,g,m,_,v,T,S,A,b,I,R=this.context,N=Object(l.a)(R).getInstance(),w=Object(F.a)(R).getInstance(),C=e.manifestModel,D=e.mediaPlayerModel,O=e.dashMetrics,M=e.manifestUpdater,P=e.adapter,L=e.timelineConverter,U=e.capabilities,B=e.errHandler,k=e.abrController,G=e.playbackController,j=e.eventController,H=e.mediaController,K=e.protectionController,q=e.textController,W=e.videoModel,z=e.streamInfo,X=e.settings;function Q(t,i){return new Promise((function(s,u){se(),g=!0,le();var l,d=W.getElement();te.forEach((function(i){(i!==a.a.VIDEO||!d||d&&/^VIDEO$/i.test(d.nodeName))&&function(t,i){var s,u=P.getAllMediaInfoForType(z,t),l=[],d=null;if(!u||0===u.length)return void n.info("No "+t+" data.");t===a.a.VIDEO&&(f=!0);t===a.a.AUDIO&&(h=!0);for(var p=0,g=u.length;p0&&(H.setInitialMediaSettingsForType(t,z),q.setInitialSettings(H.getInitialSettings(t)),q.addMediaInfosToBuffer(z,t,l));if(0===(u=u.filter((function(e){return!e.isEmbedded}))).length)return;if(t===a.a.IMAGE)return void(_=Z(R).create({streamInfo:z,adapter:P,baseURLController:e.baseURLController,timelineConverter:e.timelineConverter,debug:A,eventBus:N,events:c.a,dashConstants:o.a,dashMetrics:e.dashMetrics,segmentBaseController:e.segmentBaseController})).initialize();N.trigger(c.a.STREAM_INITIALIZING,{streamInfo:z,mediaInfo:d}),H.setInitialMediaSettingsForType(t,z);var y=function(t,n){var i=t&&t.length>0?t[0]:null,o=m.getModel(i?i.type:null),s=i?i.type:null,u=i?i.mimeType:null,l=i?i.isFragmented:null,c=Y(R).create({streamInfo:z,type:s,mimeType:u,timelineConverter:L,adapter:P,manifestModel:C,mediaPlayerModel:D,fragmentModel:o,dashMetrics:e.dashMetrics,baseURLController:e.baseURLController,segmentBaseController:e.segmentBaseController,abrController:k,playbackController:G,mediaController:H,textController:q,errHandler:B,settings:X,boxParser:S,segmentBlacklistController:v});c.initialize(n,f,l),r.push(c);for(var d=0;d0&&e.Representation[0].ContentProtection)}function _e(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!e||!e.hasOwnProperty("getStreamInfo"))return!1;var r=e.getStreamInfo(),i=n?n.getStreamInfo():oe();if(!r||!i)return!1;var a=P.getAdaptationForType(r.index,t,r),o=P.getAdaptationForType(i.index,t,i);if(!a||!o)return!a&&!o;var s=a&&o&&a.mimeType===o.mimeType,u=o.Representation_asArray.map((function(e){return e.codecs})),l=a.Representation_asArray.map((function(e){return e.codecs})),c=l.some((function(e){return u.indexOf(e)>-1})),f=l.some((function(e){return u.some((function(t){return U.codecRootCompatibleWithCodec(t,e)}))}));return c||f&&s}function ve(e){T=e}function Te(){return T}return t={initialize:function(){N.on(c.a.BUFFERING_COMPLETED,fe,t),N.on(c.a.DATA_UPDATE_COMPLETED,de,t),N.on(c.a.INBAND_EVENTS,he,t),K&&(N.on(c.a.KEY_ERROR,ue,t),N.on(c.a.SERVER_CERTIFICATE_UPDATED,ue,t),N.on(c.a.LICENSE_REQUEST_COMPLETE,ue,t),N.on(c.a.KEY_SYSTEM_SELECTED,ue,t),N.on(c.a.KEY_SESSION_CREATED,ue,t),N.on(c.a.KEY_STATUSES_CHANGED,ue,t)),q.initializeForStream(z),N.trigger(c.a.STREAM_UPDATED,{streamInfo:z})},getStreamId:function(){return z?z.id:null},activate:function(e,t){return new Promise((function(n,r){if(!s)return Te()?(s=!0,N.trigger(c.a.STREAM_ACTIVATED,{streamInfo:z}),void n(t)):void function(e,t){return Q(e,t)}(e,t).then((function(e){s=!0,N.trigger(c.a.STREAM_ACTIVATED,{streamInfo:z}),n(e)})).catch((function(e){r(e)}));n(t)}))},deactivate:J,getIsActive:function(){return s},getDuration:function(){return z?z.duration:NaN},getStartTime:ie,getId:ae,getStreamInfo:oe,getHasAudioTrack:function(){return h},getHasVideoTrack:function(){return f},startPreloading:function(e,t){return new Promise((function(i,a){Te()?a():(n.info("[startPreloading] Preloading next stream with id ".concat(ae())),ve(!0),Q(e,t).then((function(){for(var e=0;e0;){var e=I.pop(),t=e.newMediaInfo,r=pe(e.oldMediaInfo);if(!r)return;n.push(r.prepareTrackSwitch()),r.selectMediaInfo(t)}return Promise.all(n)})).then((function(){g=!1,ce(),N.trigger(c.a.STREAM_UPDATED,{streamInfo:z}),t()}))}))},reset:function(e){m&&(m.reset(),m=null),k&&z&&k.clearDataForStream(z.id),v&&(v.reset(),v=null),ne(e),z=null,N.off(c.a.DATA_UPDATE_COMPLETED,de,t),N.off(c.a.BUFFERING_COMPLETED,fe,t),N.off(c.a.INBAND_EVENTS,he,t),K&&(N.off(c.a.KEY_ERROR,ue,t),N.off(c.a.SERVER_CERTIFICATE_UPDATED,ue,t),N.off(c.a.LICENSE_REQUEST_COMPLETE,ue,t),N.off(c.a.KEY_SYSTEM_SELECTED,ue,t),N.off(c.a.KEY_SESSION_CREATED,ue,t),N.off(c.a.KEY_STATUSES_CHANGED,ue,t))},getProcessors:me,setMediaSource:function(e){for(var t=0;t1&&void 0!==arguments[1]?arguments[1]:null;return _e(e,a.a.VIDEO,t)&&_e(e,a.a.AUDIO,t)},isProtectionCompatible:function(e){return!e||ye(a.a.VIDEO,e)&&ye(a.a.AUDIO,e)},getPreloaded:Te,getIsEndedEventSignaled:function(){return b},setIsEndedEventSignaled:re,getAdapter:function(){return P},getHasFinishedBuffering:function(){return u},setPreloaded:ve,startScheduleControllers:function(){for(var e=r.length,t=0;t0&&void 0!==arguments[0]&&arguments[0];s=!0;var t=f.getValue(),n=t.url,r=p.getPatchLocation(t),i=p.getLocation(t);r&&!e?n=r:i&&(n=i),v.isRelative(n)&&(n=v.resolve(n,t.url)),u.load(n)}function I(e){if(e){if(p.getIsPatch(e)){var r=e;e=f.getValue();var u=p.isPatchValid(e,r),l=u;if(u){var d=p.getPublishTime(e);l=p.applyPatchToManifest(e,r);var h=p.getPublishTime(e);l=d.getTime()!=h.getTime()}if(!l)return t.debug("Patch provided is invalid, performing full manifest refresh"),void b(!0);e.loadedTime=new Date}}else(e=f.getValue()).loadedTime=new Date;if(f.getValue()&&f.getValue().type===o.a.DYNAMIC&&e.type===o.a.STATIC)return _.trigger(c.a.DYNAMIC_TO_STATIC),s=!1,void(a=!0);f.setValue(e);var g=new Date,m=(g.getTime()-e.loadedTime.getTime())/1e3;1e3*(n=p.getManifestUpdatePeriod(e,m))>2147483647&&(n=2147483.647),_.trigger(c.a.MANIFEST_UPDATED,{manifest:e}),t.info("Manifest has been refreshed at "+g+"["+g.getTime()/1e3+"] "),i||A()}function R(){i||(s?A(m.get().streaming.manifestUpdateRetryInterval):b())}function N(e){e.error?e.error.code===E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE&&g.error(e.error):I(e.manifest)}function w(){i=!1,A()}function C(){(i=!m.get().streaming.scheduling.scheduleWhilePaused)&&S()}function D(){s=!1}return e={initialize:function(){T(),_.on(c.a.STREAMS_COMPOSED,D,this),_.on(h.a.PLAYBACK_STARTED,w,this),_.on(h.a.PLAYBACK_PAUSED,C,this),_.on(c.a.INTERNAL_MANIFEST_LOADED,N,this)},setManifest:function(e){I(e)},refreshManifest:b,setConfig:function(e){e&&(e.manifestModel&&(f=e.manifestModel),e.adapter&&(p=e.adapter),e.manifestLoader&&(u=e.manifestLoader),e.errHandler&&(g=e.errHandler),e.settings&&(m=e.settings))},reset:function(){_.off(h.a.PLAYBACK_STARTED,w,this),_.off(h.a.PLAYBACK_PAUSED,C,this),_.off(c.a.STREAMS_COMPOSED,D,this),_.off(c.a.INTERNAL_MANIFEST_LOADED,N,this),T()}},t=Object(d.a)(y).getInstance().getLogger(e),e}ie.__dashjs_factory_name="ManifestUpdater";var ae=f.a.getClassFactory(ie);function oe(){var e,t,n,r,i,a,o,s,u,f,h,p,g,m,_,T,S=this.context,A=Object(l.a)(S).getInstance(),b=Object(F.a)(S).getInstance();function I(){s=[],u=[],f=null,h=null,g=null,p=NaN,n=!1,r=!1,m=i.get().streaming.utcSynchronization.timeBetweenSyncAttempts}function R(){n||r||!g||!g.value||!g.schemeIdUri||isNaN(p)||isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)||(h&&(Date.now()-h)/1e3<30||(s=[],r=!0,function e(t){try{if(t<=0)return void k();var n=Date.now();a[g.schemeIdUri](g.value,(function(r){var i=Date.now(),a=N(n,i,r);s.push(a),e(t-1)}),(function(){k()}))}catch(e){k()}}(isNaN(i.get().streaming.utcSynchronization.backgroundAttempts)?2:i.get().streaming.utcSynchronization.backgroundAttempts)))}function N(e,t,n){return n-(t-(t-e)/2)}function w(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:NaN,t=isNaN(e);t&&i.get().streaming.utcSynchronization.useManifestDateHeaderTimeSource?U():B(t,e)}function C(e){var t=Date.parse(e);return isNaN(t)&&(t=function(e){var t,n,r=/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2})(?::([0-9]*)(\.[0-9]*)?)?(?:([+\-])([0-9]{2})([0-9]{2}))?/.exec(e);return t=Date.UTC(parseInt(r[1],10),parseInt(r[2],10)-1,parseInt(r[3],10),parseInt(r[4],10),parseInt(r[5],10),r[6]&&(parseInt(r[6],10)||0),r[7]&&1e3*parseFloat(r[7])||0),r[9]&&r[10]&&(n=60*parseInt(r[9],10)+parseInt(r[10],10),t+=("+"===r[8]?-1:1)*n*60*1e3),new Date(t).getTime()}(e)),t}function D(e){return Date.parse(e)}function O(e){return Date.parse(e)}function M(e,t,n){n()}function P(e,t,n){var r=C(e);isNaN(r)?n():t(r)}function L(e,t,n,r,i){var a,o,s=!1,u=new XMLHttpRequest,l=i?v.a.HEAD:v.a.GET,c=t.match(/\S+/g);if(t=c.shift(),a=function(){s||(s=!0,c.length?L(e,c.join(" "),n,r,i):r())},o=function(){var t,r;200===u.status&&(t=i?u.getResponseHeader("Date"):u.response,r=e(t),isNaN(r)||(n(r),s=!0))},b.isRelative(t)){var f=T.resolve();f&&(t=b.resolve(t,f.url))}u.open(l,t),u.timeout=5e3,u.onload=o,u.onloadend=a,u.send()}function x(e,t,n){L(O,e,t,n,!0)}function U(){var e=o.getLatestMPDRequestHeaderValueByID("Date"),t=null!==e?new Date(e).getTime():Number.NaN;isNaN(t)?B(!0):B(!1,t-Date.now())}function B(e,r){if(isNaN(p)||isNaN(r)||e||function(e){try{var n,r=G(e),a=isNaN(m)?30:m,o=isNaN(i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor)?2:i.get().streaming.utcSynchronization.timeBetweenSyncAttemptsAdjustmentFactor,s=isNaN(i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts)?600:i.get().streaming.utcSynchronization.maximumTimeBetweenSyncAttempts,u=isNaN(i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts)?2:i.get().streaming.utcSynchronization.minimumTimeBetweenSyncAttempts;r?(n=Math.min(a*o,s),t.debug("Increasing timeBetweenSyncAttempts to ".concat(n))):(n=Math.max(a/o,u),t.debug("Decreasing timeBetweenSyncAttempts to ".concat(n))),m=n}catch(e){}}(r),!e&&!isNaN(r)){f=Date.now(),n=!1;var a=isNaN(p);p=r,a&&R(),t.debug("Completed UTC sync. Setting client - server offset to ".concat(r))}e&&(g=null,n=!1,_.error(new y.a(E.a.TIME_SYNC_FAILED_ERROR_CODE,E.a.TIME_SYNC_FAILED_ERROR_MESSAGE))),A.trigger(c.a.UPDATE_TIME_SYNC_OFFSET,{offset:r}),A.trigger(c.a.TIME_SYNCHRONIZATION_COMPLETED)}function k(){if(s&&0!==s.length){var e=s.reduce((function(e,t){return e+t}),0)/s.length;G(e)?t.debug("Completed background UTC sync. Offset is within allowed threshold and is not adjusted."):(t.debug("Completed background UTC sync. Setting client - server offset to ".concat(e)),p=e,A.trigger(c.a.UPDATE_TIME_SYNC_OFFSET,{offset:p})),r=!1,h=Date.now()}}function G(e){try{if(isNaN(p))return!0;var t=i.get().streaming.utcSynchronization.maximumAllowedDrift&&!isNaN(i.get().streaming.utcSynchronization.maximumAllowedDrift)?i.get().streaming.utcSynchronization.maximumAllowedDrift:100;return e>=p-t&&e<=p+t}catch(e){return!0}}return e={initialize:function(){I(),a={"urn:mpeg:dash:utc:http-head:2014":x,"urn:mpeg:dash:utc:http-xsdate:2014":L.bind(null,C),"urn:mpeg:dash:utc:http-iso:2014":L.bind(null,D),"urn:mpeg:dash:utc:direct:2014":P,"urn:mpeg:dash:utc:http-head:2012":x,"urn:mpeg:dash:utc:http-xsdate:2012":L.bind(null,C),"urn:mpeg:dash:utc:http-iso:2012":L.bind(null,D),"urn:mpeg:dash:utc:direct:2012":P,"urn:mpeg:dash:utc:http-ntp:2014":M,"urn:mpeg:dash:utc:ntp:2014":M,"urn:mpeg:dash:utc:sntp:2014":M}},attemptSync:function(e,t){u=e,n||(!function(e){try{if(!e)return!1;var t=isNaN(m)?30:m;return!(f&&t&&!isNaN(t))||(Date.now()-f)/1e3>=t}catch(e){return!0}}(t)?A.trigger(c.a.TIME_SYNCHRONIZATION_COMPLETED):(n=!0,function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=t||0;if(!u||0===u.length||n>=u.length)return void w();var r=u[n];if(r)if(a.hasOwnProperty(r.schemeIdUri)){var i=(new Date).getTime();a[r.schemeIdUri](r.value,(function(e){var t=(new Date).getTime(),n=N(i,t,e);g=r,w(n)}),(function(){e(n+1)}))}else e(n+1);else w()}()))},setConfig:function(e){e&&(e.dashMetrics&&(o=e.dashMetrics),e.baseURLController&&(T=e.baseURLController),e.errHandler&&(_=e.errHandler),e.settings&&(i=e.settings))},reset:function(){I(),A.off(c.a.ATTEMPT_BACKGROUND_SYNC,R,e)}},t=Object(d.a)(S).getInstance().getLogger(e),A.on(c.a.ATTEMPT_BACKGROUND_SYNC,R,e),e}oe.__dashjs_factory_name="TimeSyncController";var se=f.a.getSingletonFactory(oe);se.HTTP_TIMEOUT_MS=5e3,f.a.updateSingletonFactory(oe.__dashjs_factory_name,se);var ue=se;function le(){var e,t,n,r=this.context;return e={createMediaSource:function(){var e="WebKitMediaSource"in window;return"MediaSource"in window?t=new MediaSource:e&&(t=new WebKitMediaSource),t},attachMediaSource:function(e){var n=window.URL.createObjectURL(t);return e.setSource(n),n},detachMediaSource:function(e){e.setSource(null)},setDuration:function e(r){t&&"open"===t.readyState&&(null===r&&isNaN(r)||t.duration!==r&&(!function(e){for(var t=e.sourceBuffers,n=0;n=0&&e2&&void 0!==arguments[2]&&arguments[2],r=e.eventStream.schemeIdUri,i=e.eventStream.value,a=e.id,o=p;t[r]||(t[r]=[]);var s=t[r].findIndex((function(e){return(!i||e.eventStream.value&&e.eventStream.value===i)&&e.id===a}));return-1===s?(t[r].push(e),o=m):n&&(t[r][s]=e,o=g),o}function A(e){try{if(1==e.eventStream.value){var t,n=e.calculatedPresentationTime;t=4294967295==e.calculatedPresentationTime?NaN:e.calculatedPresentationTime+e.duration,E.trigger(h.a.MANIFEST_VALIDITY_CHANGED,{id:e.id,validUntil:n,newDuration:t,newManifestValidAfter:NaN},{mode:h.a.EVENT_MODE_ON_START})}}catch(e){}}function b(){try{if(!c){c=!0;var e=s.getTime(),t=e-a;t=a>0?Math.max(0,t):0,I(r,t,e),I(n,t,e),a=e,c=!1}}catch(e){c=!1}}function I(e,n,r){try{N(e,(function(i){if(void 0!==i){var a=isNaN(i.duration)?0:i.duration;i.calculatedPresentationTime<=r&&i.calculatedPresentationTime+n+a>=r?w(i,e,h.a.EVENT_MODE_ON_START):(function(e,t,n){try{return e-t>n}catch(e){return!1}}(r,a+n,i.calculatedPresentationTime)||function(e){try{var t=e.eventStream.period.start+e.eventStream.period.duration;return e.calculatedPresentationTime>t}catch(e){return!1}}(i))&&(t.debug("Deleting event ".concat(i.id," as it is expired or invalid")),C(e,i))}}))}catch(e){}}function R(e){try{var t=s.getTime();N(e,(function(n){var r=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.duration)?n.eventStream.period.duration:NaN,i=n.eventStream&&n.eventStream.period&&!isNaN(n.eventStream.period.start)?n.eventStream.period.start:NaN;if(!isNaN(r)&&!isNaN(i)){var a=n.calculatedPresentationTime;Math.abs(a-t)<300&&w(n,e,h.a.EVENT_MODE_ON_START)}}))}catch(e){}}function N(e,t){try{if(e)for(var n=Object.keys(e),r=0;re.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&function(e){D=D.filter((function(n){var r=e.filter((function(e){return e.id===n.getId()})).length>0||n.getId()===O.getId();return r||(t.debug("Removing stream ".concat(n.getId())),n.reset(!0)),r}))}(e);for(var n=[],r=0,i=e.length;r0&&n.forEach((function(t){t&&e.push(t)})),e}),[]).reduce((function(e,t){var n=f.convertRepresentationToRepresentationInfo(t);return n&&n.fragmentDuration&&!isNaN(n.fragmentDuration)&&e.push(n.fragmentDuration),e}),[]);n=Math.max.apply(Math,ge(i))}return isFinite(n)?n:NaN}catch(e){return NaN}}(n,o);K.computeAndSetLiveDelay(s,o)}var u=function(){var e;if(f.getIsDynamic()){var n=p.getCurrentDVRInfo(),r=n&&n.range?n.range.end:0;e=r-K.getLiveDelay();var i=n?n.range:null;if(i){var a=Ue(!0);isNaN(a)||(t.info("Start time from URI parameters: "+a),e=Math.max(Math.min(e,a),i.start))}}else{var o=$e()[0].getStreamInfo();e=o.start;var s=Ue(!1);isNaN(s)||(t.info("Start time from URI parameters: "+s),e=Math.max(e,s))}return e}(),l=Ae(u),d=null!==l?l:D[0];ie.trigger(c.a.INITIAL_STREAM_SWITCH,{startTime:u}),fe(d,null,u),z||(z=setInterval((function(){!U&&K.getTimeToStreamEnd()<=0&&!K.isSeeking()&&ie.trigger(c.a.PLAYBACK_ENDED,{isLast:Ke().isLast})}),200))}(e),ie.trigger(c.a.STREAMS_COMPOSED),Me()})).catch((function(e){throw e}))}catch(e){w.error(new y.a(E.a.MANIFEST_ERROR_ID_NOSTREAMS_CODE,e.message+"nostreamscomposed",s.getValue())),j=!0,Xe()}}()}function se(){J=!0}function le(e){var t=qe(e.id);return t?t.updateData(e):(t=re(ne).create({manifestModel:s,mediaPlayerModel:q,dashMetrics:p,manifestUpdater:i,adapter:f,timelineConverter:C,capabilities:n,capabilitiesFilter:r,errHandler:w,baseURLController:_,segmentBaseController:v,textController:P,abrController:S,playbackController:K,eventController:I,mediaController:A,protectionController:M,videoModel:H,streamInfo:e,settings:Z}),D.push(t),t.initialize(),Promise.resolve())}function fe(e,n,r){try{if(U||!e||n===e&&e.getIsActive())return;U=!0,ie.trigger(c.a.STREAM_SWITCH_STARTED,{fromStreamInfo:n?n.getStreamInfo():null,toStreamInfo:e.getStreamInfo()});var i=!1;O=e,n&&(i=Te(e,n),n.deactivate(i)),r=isNaN(r)?!i&&n?e.getStreamInfo().start:NaN:r,t.info("Switch to stream ".concat(e.getId(),". Seektime is ").concat(r,", current playback time is ").concat(K.getTime(),". Seamless period switch is set to ").concat(i)),Q=Q.filter((function(e){return e.getId()!==O.getId()})),K.initialize(Ke(),!!n),H.getElement()&&de(r,i)}catch(e){U=!1}}function de(e,n){var r;function i(){if(Y&&"open"===Y.readyState){t.debug("MediaSource is open!"),window.URL.revokeObjectURL(r),Y.removeEventListener("sourceopen",i),Y.removeEventListener("webkitsourceopen",i),xe();var a=p.getCurrentDVRInfo();g.setSeekable(a.range.start,a.range.end),me(e,n)}}function a(){Y.addEventListener("sourceopen",i,!1),Y.addEventListener("webkitsourceopen",i,!1),r=g.attachMediaSource(H),t.debug("MediaSource attached to element. Waiting on open...")}Y?n?me(e,n):(g.detachMediaSource(H),a()):(Y=g.createMediaSource(),a())}function me(e,t){O.activate(Y,t?X:void 0,e).then((function(t){if(t){var n=Object.keys(t);n.length>0&&t[n[0]].getBuffer().changeType&&($=!0),X=t}isNaN(e)||(ie.trigger(c.a.SEEK_TARGET,{time:e},{streamId:O.getId()}),K.seek(e,!1,!0),O.startScheduleControllers()),U=!1,ie.trigger(c.a.PERIOD_SWITCH_COMPLETED,{toStreamInfo:Ke()})}))}function ye(e){var t=K.getTime(),n=e.seekTime,r=Ae(n);r&&r!==O?r&&r!==O&&(Ee(t,n,r),function(e,t){var n=e&&!isNaN(e.seekTime)?e.seekTime:NaN,r=O.getProcessors().map((function(t){return t.prepareOuterPeriodPlaybackSeeking(e)}));Promise.all(r).then((function(){fe(t,O,n)})).catch((function(e){w.error(e)}))}(e,r)):(Ee(t,n),function(e){O.getProcessors().forEach((function(t){return t.prepareInnerPeriodPlaybackSeeking(e)})),je(k.USER_REQUEST_STOP_REASON)}(e)),Ye(B.SEEK_START_REASON)}function Ee(e,t){_e()}function _e(){Q&&Q.length>0&&(Q.forEach((function(e){e.deactivate(!0)})),Q=[])}function ve(e){e.newMediaInfo.streamInfo.id===O.getId()&&(_e(),O.prepareTrackChange(e))}function Te(e,t){try{return Z.get().streaming.buffer.reuseExistingSourceBuffers&&(t.isProtectionCompatible(e)||J)&&($||t.isMediaCodecCompatible(e,t))}catch(e){return!1}}function Se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(Y&&!e.getPreloaded()){var n=Te(e,t);n&&e.startPreloading(Y,X).then((function(){Q.push(e)}))}}function Ae(e){if(isNaN(e))return null;for(var t=D.length,n=0;nK.getLiveDelay())&&(W=!1,Ye(B.INITIAL_PLAYOUT_START_REASON),K.play())}e&&e.mediaType&&p.addBufferLevel(e.mediaType,new Date,1e3*e.bufferLevel)}function Re(e){e.streamInfo.id===O.getId()&&e.reason&&e.reason.forceReplace&&_e(),qe(e.streamInfo.id).prepareQualityChange(e)}function Ne(){f.getIsDynamic()&&be()}function we(){if(ke()){var e=H.getPlaybackQuality();e&&p.addDroppedFrames(e)}}function Ce(){t.debug("[onPlaybackStarted]"),!W&&V&&(V=!1,Ye(B.RESUME_FROM_PAUSE_START_REASON))}function De(e){t.debug("[onPlaybackPaused]"),e.ended||(V=!0,je(k.USER_REQUEST_STOP_REASON))}function Oe(e){t.debug("Stream with id ".concat(e.streamInfo.id," finished buffering"));var n=e.streamInfo.isLast;Y&&n?(t.info("[onStreamBufferingCompleted] calls signalEndOfStream of mediaSourceController."),g.signalEndOfStream(Y)):Me()}function Me(){if(O&&O.getHasFinishedBuffering())for(var e=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;try{var t=e||(O||null);if(t){var n=t.getStreamInfo();return D.filter((function(e){var t=e.getStreamInfo();return t.start>n.start&&n.id!==t.id}))}}catch(e){return[]}}(O),t=0;t0&&void 0!==arguments[0]?arguments[0]:null,t=e||(O||null);if(!t)return null;var n=t.getStreamInfo(),r=n.start,i=0,a=-1,o=NaN;for(;i0&&(isNaN(o)||l=0)return D[a];return null}();n?(t.debug("StreamController onEnded, found next stream with id ".concat(n.getStreamInfo().id,". Switching from ").concat(O.getStreamInfo().id," to ").concat(n.getStreamInfo().id)),fe(n,O,NaN)):(t.debug("StreamController no next stream found"),O.setIsEndedEventSignaled(!1)),je(n?k.END_OF_PERIOD_STOP_REASON:k.END_OF_CONTENT_STOP_REASON)}e&&e.isLast&&Pe()}function xe(e){var t=e||Ke().manifestInfo.duration;g.setDuration(t)}function Ue(e){var t=T.getURIFragmentData();if(!t||!t.t)return NaN;var n=$e()[0].getStreamInfo().start;t.t=t.t.split(",")[0];var r=-1!==t.t.indexOf("posix:")?"now"===t.t.substring(6)?Date.now()/1e3:parseInt(t.t.substring(6)):NaN;return e&&!isNaN(r)?r-K.getAvailabilityStartTime()/1e3:parseInt(t.t)+n}function Be(e){if(e.error)j=!0,Xe();else{t.info("Manifest updated... updating data system wide.");var n=e.manifest;f.updatePeriods(n);var i=f.getUTCTimingSources();!f.getIsDynamic()||i&&0!==i.length||ie.trigger(h.a.CONFORMANCE_VIOLATION,{level:pe.LEVELS.WARNING,event:pe.EVENTS.NO_UTC_TIMING_ELEMENT});var a=f.getIsDynamic()?i.concat(q.getUTCTimingSources()):i,o=N.isHTTPS(e.manifest.url);a.forEach((function(e){e.value.replace(/.*?:\/\//g,"")===q.getDefaultUtcTimingSource().value.replace(/.*?:\/\//g,"")&&(e.value=e.value.replace(o?new RegExp(/^(http:)?\/\//i):new RegExp(/^(https:)?\/\//i),o?"https://":"http://"),t.debug("Matching default timing source protocol to manifest protocol: ",e.value))})),r.filterUnsupportedFeatures(n).then((function(){_.initialize(n),m.attemptSync(a,f.getIsDynamic())}))}}function ke(){return!!O&&O.getHasVideoTrack()}function Ge(){return!!O&&O.getHasAudioTrack()}function je(e,t){t=t||new Date,Le().forEach((function(n){n.finalisePlayList(t,e)})),p.addPlayList()}function Ye(e){p.createPlaylistMetrics(1e3*K.getTime(),e)}function He(e){if(e.error){var n="";switch(e.error.code){case 1:n="MEDIA_ERR_ABORTED";break;case 2:n="MEDIA_ERR_NETWORK";break;case 3:n="MEDIA_ERR_DECODE",te.counts.mediaErrorDecode+=1;break;case 4:n="MEDIA_ERR_SRC_NOT_SUPPORTED";break;case 5:n="MEDIA_ERR_ENCRYPTED";break;default:n="UNKNOWN"}"MEDIA_ERR_DECODE"===n&&Z.get().errors.recoverAttempts.mediaErrorDecode>=te.counts.mediaErrorDecode?function(){t.warn("A MEDIA_ERR_DECODE occured: Resetting the MediaSource");var e=K.getTime();O.deactivate(!1),t.warn("MediaSource has been resetted. Resuming playback from time ".concat(e)),de(e,!1)}():(G=!0,e.error.message&&(n+=" ("+e.error.message+")"),e.error.msExtendedCode&&(n+=" (0x"+(e.error.msExtendedCode>>>0).toString(16).toUpperCase()+")"),t.fatal("Video Element Error: "+n),e.error&&t.fatal(e.error),w.error(new y.a(e.error.code,n)),Xe())}}function Ke(){return O?O.getStreamInfo():null}function qe(e){for(var t=0,n=D.length;t=10){var e=o.getTime();t===e?R(e,!0):(t=e,a=NaN),r=0}}function A(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=Object.keys(h).some((function(e){return h[e]})),r=!!e&&b();return!t&&n.get().streaming.gaps.jumpGaps&&s.getActiveStreamProcessors().length>0&&(!o.isSeeking()||r)&&!o.isPaused()&&!s.getIsStreamSwitchInProgress()&&!s.getHasMediaOrInitialisationError()}function b(){var e=s.getActiveStream(),t=parseFloat((e.getStartTime().toFixed(5)+e.getDuration()).toFixed(5));return o.getTime()+n.get().streaming.gaps.threshold>=t}function I(e,t){try{if(!e||e.length<=1&&t>0)return NaN;for(var r=NaN,i=0;isNaN(r)&&i0?e.end(i-1):0;t1&&void 0!==arguments[1]&&arguments[1],i=n.get().streaming.gaps.smallGapLimit,l=n.get().streaming.gaps.jumpLargeGaps,c=u.getBufferRange(),d=NaN,h=!1;if(t=I(c,e),!isNaN(t)){var g=c.start(t),m=g-e;m>0&&(m<=i||l)&&(d=g)}var y=o.getTimeToStreamEnd();if(isNaN(d)&&r&&isFinite(y)&&!isNaN(y)&&y0&&a!==d&&d>e&&!f){var E=d-e;if(h){var _=s.getStreamForTime(d),v=_&&!!_.getPreloaded();p.warn("Jumping to end of stream because of gap from ".concat(e," to ").concat(d,". Gap duration: ").concat(E)),o.seek(d,!0,v)}else{var T=o.getIsDynamic(),S=t>0?c.end(t-1):e,A=T?1e3*Math.max(0,E-.1):0;f=window.setTimeout((function(){o.seek(d,!0,!0),p.warn("Jumping gap occuring in period ".concat(s.getActiveStream().getStreamId()," starting at ").concat(S," and ending at ").concat(d,". Jumping by: ").concat(E-A/1e3)),f=null}),A)}a=d}}return e={reset:y,setConfig:function(e){e&&(e.settings&&(n=e.settings),e.playbackController&&(o=e.playbackController),e.streamController&&(s=e.streamController),e.videoModel&&(u=e.videoModel))},initialize:function(){!function(){m.on(c.a.WALLCLOCK_TIME_UPDATED,S,this),m.on(c.a.INITIAL_STREAM_SWITCH,T,this),m.on(c.a.PLAYBACK_SEEKING,E,this),m.on(c.a.BUFFER_REPLACEMENT_STARTED,_,e),m.on(c.a.TRACK_CHANGE_RENDERED,v,e)}()}},p=Object(d.a)(g).getInstance().getLogger(e),y(),e}_e.__dashjs_factory_name="GapController";var ve=f.a.getSingletonFactory(_e);function Te(){var e,t,n,r,i,o,s,u,f=this.context,h=Object(l.a)(f).getInstance();function p(e,t){return e&&n[t]&&n[t][e]?n[t][e].list:[]}function g(e,t){return e&&n[t]&&n[t][e]?n[t][e].current:null}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e&&e.streamInfo){var i=e.type,u=e.streamInfo,l=u.id,f=g(i,l);if(n[l]&&n[l][i]&&!_(e,f)&&(n[l][i].current=e,n[l][i].current&&(i!==a.a.TEXT||i===a.a.TEXT&&e.isFragmented)&&h.trigger(c.a.CURRENT_TRACK_CHANGED,{oldMediaInfo:f,newMediaInfo:e,switchMode:r.get().streaming.trackSwitchMode[i]},{streamId:l}),!t)){var d=T(e);if(!d||!n[l][i].storeLastSettings)return;d.roles&&(d.role=d.roles[0],delete d.roles),d.accessibility&&(d.accessibility=d.accessibility[0]),d.audioChannelConfiguration&&(d.audioChannelConfiguration=d.audioChannelConfiguration[0]),o[i]=d,s.setSavedMediaSettings(i,d)}}}function y(e,t){e&&t&&(i[e]=t)}function E(e){return e?i[e]:null}function _(e,t){if(!e&&!t)return!0;if(!e||!t)return!1;var n=e.id===t.id,r=e.viewpoint===t.viewpoint,i=e.lang===t.lang,a=e.codec===t.codec,o=e.roles.toString()===t.roles.toString(),s=e.accessibility.toString()===t.accessibility.toString(),u=e.audioChannelConfiguration.toString()===t.audioChannelConfiguration.toString();return n&&a&&r&&i&&o&&s&&u}function v(){n={},o={},u=null,i={audio:null,video:null,text:null}}function T(e){var t={lang:e.lang,viewpoint:e.viewpoint,roles:e.roles,accessibility:e.accessibility,audioChannelConfiguration:e.audioChannelConfiguration};return t.lang||t.viewpoint||t.role&&t.role.length>0||t.accessibility&&t.accessibility.length>0||t.audioChannelConfiguration&&t.audioChannelConfiguration.length>0?t:null}function S(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=!e.lang||t.lang.match(e.lang),i=void 0===e.index||null===e.index||t.index===e.index,o=!e.viewpoint||e.viewpoint===t.viewpoint,s=!e.role||!!t.roles.filter((function(t){return t===e.role}))[0],u=!e.accessibility||!!t.accessibility.filter((function(t){return t===e.accessibility}))[0],l=!e.audioChannelConfiguration||!!t.audioChannelConfiguration.filter((function(t){return t===e.audioChannelConfiguration}))[0];return r&&i&&o&&(s||t.type===a.a.AUDIO&&n)&&u&&l}function A(e){var t,n=0,r=[];return e.forEach((function(e){(t=Math.max.apply(Math,e.bitrateList.map((function(e){return e.bandwidth}))))>n?(n=t,r=[e]):t===n&&r.push(e)})),r}function b(e){var t,n=1/0,r=[];return e.forEach((function(e){var i=e.bitrateList.reduce((function(e,t){var n=Math.max(1,t.width*t.height);return e+t.bandwidth/n}),0);(t=i/e.bitrateList.length)n?(n=t,r=[e]):t===n&&r.push(e)})),r}function R(e,n){if(e===a.a.TEXT)return n[0];var i,o=r.get().streaming.selectionModeForInitialTrack;if(u&&"function"==typeof u)i=u(n);else switch(o){case a.a.TRACK_SELECTION_MODE_HIGHEST_SELECTION_PRIORITY:i=function(e){var t=(n=e,r=0,i=[],n.forEach((function(e){isNaN(e.selectionPriority)||(e.selectionPriority>r?(r=e.selectionPriority,i=[e]):e.selectionPriority===r&&i.push(e))})),i);var n,r,i;t.length>1&&(t=A(t));t.length>1&&(t=I(t));return t}(n);break;case a.a.TRACK_SELECTION_MODE_HIGHEST_BITRATE:i=function(e){var t=A(e);t.length>1&&(t=I(t));return t}(n);break;case a.a.TRACK_SELECTION_MODE_FIRST_TRACK:i=N(n);break;case a.a.TRACK_SELECTION_MODE_HIGHEST_EFFICIENCY:i=function(e){var t=b(e);t.length>1&&(t=A(t));return t}(n);break;case a.a.TRACK_SELECTION_MODE_WIDEST_RANGE:i=function(e){var t=I(e);t.length>1&&(t=A(e));return t}(n);break;default:t.warn("Track selection mode ".concat(o," is not supported. Falling back to TRACK_SELECTION_MODE_FIRST_TRACK")),i=N(n)}return i.length>0?i[0]:n[0]}function N(e){return e[0]}return e={setInitialMediaSettingsForType:function(e,t){var n=o[e]||E(e),r=p(e,t.id),i=[];n||(n=s.getSavedMediaSettings(e),y(e,n)),r&&0!==r.length&&(n&&r.forEach((function(t){S(n,t,!!o[e])&&i.push(t)})),0===i.length?m(R(e,r),!0):i.length>1?m(R(e,i,o[e])):m(i[0]))},addTrack:function(e){if(e){var t=e.type;if((r=t)===a.a.AUDIO||r===a.a.VIDEO||r===a.a.TEXT||r===a.a.IMAGE){var r,i=e.streamInfo.id;n[i]||(n[i]={audio:{list:[],storeLastSettings:!0,current:null},video:{list:[],storeLastSettings:!0,current:null},text:{list:[],storeLastSettings:!0,current:null},image:{list:[],storeLastSettings:!0,current:null}});for(var o=n[i][t].list,s=0,u=o.length;s1&&(n.forEach((function(e){r+=e.dvb_weight,i.push(r)})),t=Math.floor(Math.random()*(r-1)),i.every((function(e,n){return a=n,!(t")+2),r=t.resolvedContent.substr(0,i)+""+t.resolvedContent.substr(i)+"",t.resolvedContent=a.xml_str2json(r)}(function(e){var t;for(t=0;t=0;o--){if(t=e.elements[o],n=t.type+"_asArray",t.resolvedContent){if(t.resolvedContent)for(s=0;s0&&r.run(i)}(e),"onActuate"===e.resolveType&&f.trigger(c.a.XLINK_READY,{manifest:i}),"onLoad"===e.resolveType)switch(e.type){case o.a.PERIOD:for(t=0;t=0;a--)(i=e[a]).hasOwnProperty("xlink:href")&&"urn:mpeg:dash:resolve-to-zero:2013"===i["xlink:href"]&&e.splice(a,1);for(a=0;a-1?(p&&(t=p.createMssParser(),p.registerEvents()),t):e.indexOf("MPD")>-1||e.indexOf("Patch")>-1?Object(Qe.a)(u).create({debug:f}):t}(t)),null!==s){i.setMatchers(s.getMatchers()),i.setIron(s.getIron());try{m=s.parse(t)}catch(t){return void d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new y.a(E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}m?(m.url=l||e,m.originalUrl||(m.originalUrl=m.url),m.hasOwnProperty(a.a.LOCATION)&&(g=h.parseBaseUrl(m.Location_asArray[0]),n.debug("BaseURI set by Location to: "+g)),m.baseUri=g,m.loadedTime=new Date,i.resolveManifestOnLoad(m),d.trigger(c.a.ORIGINAL_MANIFEST_LOADED,{originalManifest:t})):d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new y.a(E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))})}else d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new y.a(E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_CODE,E.a.MANIFEST_LOADER_PARSING_FAILURE_ERROR_MESSAGE+"".concat(e))});else d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null})},error:function(t,n,r){d.trigger(c.a.INTERNAL_MANIFEST_LOADED,{manifest:null,error:new y.a(E.a.MANIFEST_LOADER_LOADING_FAILURE_ERROR_CODE,E.a.MANIFEST_LOADER_LOADING_FAILURE_ERROR_MESSAGE+"".concat(e,", ").concat(r))})}})},reset:function(){d.off(c.a.XLINK_READY,m,t),p&&p.reset(),i&&(i.reset(),i=null),r&&(r.abort(),r=null)}},n=f.getLogger(t),d.on(c.a.XLINK_READY,m,t),r=Object(Ue.a)(u).create({errHandler:e.errHandler,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,urlUtils:h,constants:a.a,dashConstants:o.a,errors:E.a}),i=Xe(u).create({errHandler:g,dashMetrics:e.dashMetrics,mediaPlayerModel:e.mediaPlayerModel,requestModifier:e.requestModifier,settings:e.settings}),s=null,t}$e.__dashjs_factory_name="ManifestLoader";var Ze=f.a.getClassFactory($e);function Je(){var e=this.context,t=Object(l.a)(e).getInstance();return{error:function(e){t.trigger(c.a.ERROR,{error:e})}}}Je.__dashjs_factory_name="ErrorHandler";var et=f.a.getSingletonFactory(Je),tt=n(46);function nt(){var e,t,n,r,i,o,s=this.context;function u(e,r){if(!r||!r.Period_asArray||0===r.Period_asArray.length)return Promise.resolve();var o=[];return r.Period_asArray.forEach((function(r){o.push(function(e,r){return new Promise((function(o){if(e&&e.AdaptationSet_asArray&&0!==e.AdaptationSet_asArray.length){var s=[];e.AdaptationSet_asArray.forEach((function(e){t.getIsTypeOf(e,r)&&s.push(function(e,r){return new Promise((function(o){if(e.Representation_asArray&&0!==e.Representation_asArray.length){var s=[],u=[];e.Representation_asArray.forEach((function(i,o){var l=t.getCodec(e,o,!1),c=function(e,t,n){switch(e){case a.a.VIDEO:return function(e,t){var n=e.width||null,r=e.height||null,i=e.frameRate||null,a=e.bandwidth||null;return{codec:t,width:n,height:r,framerate:i,bitrate:a}}(t,n);case a.a.AUDIO:return function(e,t){var n=e.audioSamplingRate||null,r=e.bandwidth||null;return{codec:t,bitrate:r,samplerate:n}}(t,n);default:return null}}(r,i,l);u.push(c),s.push(n.supportsCodec(c,r))})),Promise.all(s).then((function(t){e.Representation_asArray=e.Representation_asArray.filter((function(e,n){return t[n]||i.debug("[Stream] Codec ".concat(u[n].codec," not supported ")),t[n]})),o()})).catch((function(){o()}))}else o()}))}(e,r))})),Promise.all(s).then((function(){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){var t=e.Representation_asArray&&e.Representation_asArray.length>0;return t||i.warn("AdaptationSet has been removed because of no supported Representation"),t})),o()})).catch((function(){o()}))}else o()}))}(r,e))})),Promise.all(o)}return e={setConfig:function(e){e&&(e.adapter&&(t=e.adapter),e.capabilities&&(n=e.capabilities),e.settings&&(r=e.settings))},filterUnsupportedFeatures:function(e){return new Promise((function(s){var l=[];l.push(u(a.a.VIDEO,e)),l.push(u(a.a.AUDIO,e)),Promise.all(l).then((function(){r.get().streaming.capabilities.filterUnsupportedEssentialProperties&&function(e){if(!e||!e.Period_asArray||0===e.Period_asArray.length)return;e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){var r=t.getEssentialPropertiesForRepresentation(e);if(r&&r.length>0)for(var a=0;a0)}))}))}(e),function(e){if(!o||0===o.length||!e||!e.Period_asArray||0===e.Period_asArray.length)return;e.Period_asArray.forEach((function(e){e.AdaptationSet_asArray=e.AdaptationSet_asArray.filter((function(e){return!e.Representation_asArray||0===e.Representation_asArray.length||(e.Representation_asArray=e.Representation_asArray.filter((function(e){return!o.some((function(t){return!t(e)}))})),e.Representation_asArray&&e.Representation_asArray.length>0)}))}))}(e),s()})).catch((function(){s()}))}))},setCustomCapabilitiesFilters:function(e){o=e}},i=Object(d.a)(s).getInstance().getLogger(e),e}nt.__dashjs_factory_name="CapabilitiesFilter";var rt=f.a.getSingletonFactory(nt);var it=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.t=null,this.xywh=null,this.track=null,this.id=null,this.s=null,this.r=null};function at(){var e;return{initialize:function(t){if(e=new it,!t)return null;var n=t.indexOf("#");if(-1!==n)for(var r=t.substr(n+1).split("&"),i=0,a=r.length;i0&&r[e.mediaType].ignoreCount--}return t={getMaxIndex:function(e){var t=ht(i).create();if(!e||!e.hasOwnProperty("getMediaType"))return t;!function(){if(!s||!s.hasOwnProperty("getCurrentBufferLevel")||!s.hasOwnProperty("getCurrentBufferState"))throw new Error(a.a.MISSING_CONFIG_ERROR)}();var o=e.getMediaType(),l=s.getCurrentBufferState(o),c=e.getRepresentationInfo().fragmentDuration,d=e.getStreamInfo(),h=d?d.id:null;if(function(e){return!f.get().streaming.lowLatencyEnabled&&r[e].ignoreCount>0}(o)||!c)return t;if(l&&l.state===u.BUFFER_EMPTY)n.debug("["+o+"] Switch to index 0; buffer is empty."),t.quality=0,t.reason="InsufficientBufferRule: Buffer is empty";else{var p=e.getMediaInfo(),g=e.getAbrController(),m=g.getThroughputHistory(),y=s.getCurrentBufferLevel(o),E=m.getAverageThroughput(o),_=m.getAverageLatency(o),v=E*(y/c)*.5;t.quality=g.getQualityForBitrate(p,v,h,_),t.reason="InsufficientBufferRule: being conservative to avoid immediate rebuffering"}return t},reset:function(){p(),o.off(h.a.PLAYBACK_SEEKING,g,t),o.off(c.a.BYTES_APPENDED_END_FRAGMENT,m,t)}},n=Object(d.a)(i).getInstance().getLogger(t),p(),o.on(h.a.PLAYBACK_SEEKING,g,t),o.on(c.a.BYTES_APPENDED_END_FRAGMENT,m,t),t}mt.__dashjs_factory_name="InsufficientBufferRule";var yt=f.a.getClassFactory(mt);function Et(e){e=e||{};var t,n,r,i,a,o=this.context,s=e.mediaPlayerModel,u=e.dashMetrics,l=e.settings;function c(){r={},i={},a=[]}return t={shouldAbandon:function(e){var t=ht(o).create(ht.NO_CHANGE,{name:Et.__dashjs_factory_name});if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getCurrentRequest")&&e.hasOwnProperty("getRepresentationInfo")&&e.hasOwnProperty("getAbrController")))return t;var c,f,d=e.getMediaInfo(),h=e.getMediaType(),p=e.getStreamInfo(),g=p?p.id:null,m=e.getCurrentRequest();if(!isNaN(m.index)){c=h,f=m.index,r[c]=r[c]||{},r[c][f]=r[c][f]||{};var y=s.getStableBufferTime();if(u.getCurrentBufferLevel(h)>y)return t;var E=r[h][m.index];if(null===E||null===m.firstByteDate||i.hasOwnProperty(E.id))return t;if(void 0===E.firstByteTime&&(a[h]=[],E.firstByteTime=m.firstByteDate.getTime(),E.segmentDuration=m.duration,E.bytesTotal=m.bytesTotal,E.id=m.index),E.bytesLoaded=m.bytesLoaded,E.elapsedTime=(new Date).getTime()-E.firstByteTime,E.bytesLoaded>0&&E.elapsedTime>0&&function(e,t){a[e]=a[e]||[],a[e].push(t)}(h,Math.round(8*E.bytesLoaded/E.elapsedTime)),a[h].length>=5&&E.elapsedTime>500&&E.bytesLoadedE.bytesTotal*S[I].bitrate/S[v.getQualityFor(h,g)].bitrate&&(t.quality=I,t.reason.throughput=E.measuredBandwidthInKbps,t.reason.fragmentID=E.id,i[E.id]=E,n.debug("["+h+"] frag id",E.id," is asking to abandon and switch to quality to ",I," measured bandwidth was",E.measuredBandwidthInKbps),delete r[h][E.id])}}else E.bytesLoaded===E.bytesTotal&&delete r[h][E.id]}return t},reset:c},n=Object(d.a)(o).getInstance().getLogger(t),c(),t}Et.__dashjs_factory_name="AbandonRequestsRule";var _t=f.a.getClassFactory(Et);function vt(){var e,t,n=this.context;return e={getMaxIndex:function(e){var r=ht(n).create();if(!e||!e.hasOwnProperty("getDroppedFramesHistory"))return r;var i=e.getDroppedFramesHistory(),a=e.getStreamInfo().id;if(i){var o=i.getFrameHistory(a);if(!o||0===o.length)return r;for(var s=0,u=0,l=ht.NO_CHANGE,c=1;c375&&s/u>.15)){l=c-1,t.debug("index: "+l+" Dropped Frames: "+s+" Total Frames: "+u);break}return ht(n).create(l,{droppedFrames:s})}return r}},t=Object(d.a)(n).getInstance().getLogger(e),e}vt.__dashjs_factory_name="DroppedFramesRule";var Tt=f.a.getClassFactory(vt);function St(){var e,t,n=this.context;return e={getMaxIndex:function(e){for(var r=e?e.getSwitchHistory():null,i=r?r.getSwitchRequests():[],a=0,o=0,s=0,u=ht(n).create(),l=0;l=6&&a/o>.075)){u.quality=l>0&&i[l].drops>0?l-1:l,u.reason={index:u.quality,drops:a,noDrops:o,dropSize:s},t.debug("Switch history rule index: "+u.quality+" samples: "+(a+o)+" drops: "+a);break}return u}},t=Object(d.a)(n).getInstance().getLogger(e),e}St.__dashjs_factory_name="SwitchHistoryRule";var At=f.a.getClassFactory(St);function bt(e){e=e||{};var t,n,r,i=this.context,a=e.dashMetrics,o=e.mediaPlayerModel,s=Object(l.a)(i).getInstance();function f(e,t,n){var r=n.reduce((function(e,t,r){return t>n[e]?r:e}),0);if(0===r)return null;var i=Math.max(e,10+2*t.length),a=(n[r]-1)/(i/10-1);return{gp:a,Vp:10/a}}function p(e){var t={},n=e.getMediaInfo().bitrateList.map((function(e){return e.bandwidth})),r=function(e){return e.map((function(e){return Math.log(e)}))}(n);r=r.map((function(e){return e-r[0]+1}));var i=o.getStableBufferTime(),a=f(i,n,r);return a?(t.state=1,t.bitrates=n,t.utilities=r,t.stableBufferTime=i,t.Vp=a.Vp,t.gp=a.gp,t.lastQuality=0,g(t)):t.state=0,t}function g(e){e.placeholderBuffer=0,e.mostAdvancedSegmentStart=NaN,e.lastSegmentWasReplacement=!1,e.lastSegmentStart=NaN,e.lastSegmentDurationS=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN}function m(e,t){var n=o.getStableBufferTime();if(e.stableBufferTime!==n){var r=f(n,e.bitrates,e.utilities);if(r.Vp!==e.Vp||r.gp!==e.gp){var i=a.getCurrentBufferLevel(t),s=i+e.placeholderBuffer;s-=10,s*=r.Vp/e.Vp,s+=10,e.stableBufferTime=n,e.Vp=r.Vp,e.gp=r.gp,e.placeholderBuffer=Math.max(0,s-i)}}}function y(e,t){return e.Vp*(e.utilities[t]+e.gp)}function E(e,t){for(var n=e.bitrates[t],r=e.utilities[t],i=0,a=t-1;a>=0;--a)if(e.utilities[a]t.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=n,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=n,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,b(t,e.chunk.mediaInfo.type)}}}function A(e){if(e&&e.metric===u.HTTP_REQUEST&&e.value&&e.value.type===v.a.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=r[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),b(t,e.mediaType))}}function b(e,t){if(!isNaN(e.lastSegmentStart)&&!isNaN(e.lastSegmentRequestTimeMs)&&!isNaN(e.placeholderBuffer)){if(e.placeholderBuffer*=.99,!isNaN(e.lastSegmentFinishTimeMs)){var n=a.getCurrentBufferLevel(t)+.001*(e.lastSegmentFinishTimeMs-e.lastSegmentRequestTimeMs),r=y(e,e.lastQuality),i=Math.max(0,r-n);e.placeholderBuffer=Math.min(i,e.placeholderBuffer)}e.lastSegmentWasReplacement&&!isNaN(e.lastSegmentDurationS)&&(e.placeholderBuffer+=e.lastSegmentDurationS),e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN}}function I(e){if(e){var t=r[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function R(e){if(e){var t=r[e.mediaType];if(t&&0!==t.state){var n,i=a.getCurrentBufferLevel(e.mediaType);n=t.abrQuality>0?E(t,t.abrQuality):10;var o=Math.max(0,n-i);t.placeholderBuffer=Math.min(t.placeholderBuffer,o)}}}function N(){r={}}return t={getMaxIndex:function(e){var t=ht(i).create();if(!(e&&e.hasOwnProperty("getMediaInfo")&&e.hasOwnProperty("getMediaType")&&e.hasOwnProperty("getScheduleController")&&e.hasOwnProperty("getStreamInfo")&&e.hasOwnProperty("getAbrController")&&e.hasOwnProperty("useBufferOccupancyABR")))return t;var o=e.getMediaInfo(),s=e.getMediaType(),u=e.getScheduleController(),l=e.getStreamInfo(),c=e.getAbrController(),f=c.getThroughputHistory(),d=l?l.id:null,h=l&&l.manifestInfo&&l.manifestInfo.isDynamic,_=e.useBufferOccupancyABR();if(t.reason=t.reason||{},!_)return t;u.setTimeToLoadDelay(0);var v=function(e){var t=e.getMediaType(),n=r[t];return n?0!==n.state&&m(n,t):(n=p(e),r[t]=n),n}(e);if(0===v.state)return t;var T,S=a.getCurrentBufferLevel(s),A=f.getAverageThroughput(s,h),b=f.getSafeAverageThroughput(s,h),I=f.getAverageLatency(s);if(t.reason.state=v.state,t.reason.throughput=A,t.reason.latency=I,isNaN(A))return t;switch(v.state){case 1:T=c.getQualityForBitrate(o,b,d,I),t.quality=T,t.reason.throughput=b,v.placeholderBuffer=Math.max(0,E(v,T)-S),v.lastQuality=T,!isNaN(v.lastSegmentDurationS)&&S>=v.lastSegmentDurationS&&(v.state=2);break;case 2:!function(e,t){var n=Date.now();if(isNaN(e.lastSegmentFinishTimeMs)){if(!isNaN(e.lastCallTimeMs)){var r=.001*(n-e.lastCallTimeMs);e.placeholderBuffer+=Math.max(0,r)}}else{var i=.001*(n-e.lastSegmentFinishTimeMs);e.placeholderBuffer+=Math.max(0,i)}e.lastCallTimeMs=n,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN,e.lastSegmentFinishTimeMs=NaN,m(e,t)}(v,s),T=function(e,t){for(var n=e.bitrates.length,r=NaN,i=NaN,a=0;a=i)&&(i=o,r=a)}return r}(v,S+v.placeholderBuffer);var R=c.getQualityForBitrate(o,b,d,I);T>v.lastQuality&&T>R&&(T=Math.max(R,v.lastQuality));var N=Math.max(0,S+v.placeholderBuffer-y(v,T));N<=v.placeholderBuffer?(v.placeholderBuffer-=N,N=0):(N-=v.placeholderBuffer,v.placeholderBuffer=0,Tt.mostAdvancedSegmentStart?(t.mostAdvancedSegmentStart=a,t.lastSegmentWasReplacement=!1):t.lastSegmentWasReplacement=!0,t.lastSegmentStart=a,t.lastSegmentDurationS=e.chunk.duration,t.lastQuality=e.chunk.quality,E(t,i)}}}function y(e){if(e&&e.metric===u.HTTP_REQUEST&&e.value&&e.value.type===v.a.MEDIA_SEGMENT_TYPE&&e.value.trace&&e.value.trace.length){var t=n[e.mediaType],i=r[e.mediaType];t&&0!==t.state&&(t.lastSegmentRequestTimeMs=e.value.trequest.getTime(),t.lastSegmentFinishTimeMs=e.value._tfinish.getTime(),E(t,i))}}function E(e,t){isNaN(e.lastSegmentStart)||isNaN(e.lastSegmentRequestTimeMs)||(t.segment_request_start_s=.001*e.lastSegmentRequestTimeMs,t.segment_download_finish_s=.001*e.lastSegmentFinishTimeMs,e.lastSegmentStart=NaN,e.lastSegmentRequestTimeMs=NaN)}function _(e){if(e&&e.mediaType){var t=n[e.mediaType];t&&0!==t.state&&(t.abrQuality=e.newQuality)}}function T(e,t){if(e.length!==t.length)return-1;for(var n=0,r=0;r=D.B_target){C.state=2,D.Q=l;for(var O=0;OF&&(U=-1),D.w[B]=D.prev_w[B]+U*(x/(2*c))*((D.Q+l)*(w*g[B]/F));D.w=function(e){for(var t=e.length,n=!1,r=[],i=0;i=a[l+1]){n=!0;break}n||(s=(o+a[t-1]-1)/t);for(var c=0;cC.lastQuality&&g[C.lastQuality+1]<=F&&(t=C.lastQuality+1),g[t]>=F&&(D.Q=2*Math.max(l,D.Q)),u.quality=t,u.reason.throughput=R,u.reason.latency=N,u.reason.bufferLevel=b,C.lastQuality=u.quality;break;default:i.debug("L2A ABR rule invoked in bad state."),u.quality=_.getQualityForBitrate(f,I,E.id,N),u.reason.state=C.state,u.reason.throughput=I,u.reason.latency=N,C.state=1,p(C)}return u},reset:function(){S(),f.off(c.a.PLAYBACK_SEEKING,g,t),f.off(c.a.MEDIA_FRAGMENT_LOADED,m,t),f.off(c.a.METRIC_ADDED,y,t),f.off(c.a.QUALITY_CHANGE_REQUESTED,_,t)}},i=Object(d.a)(o).getInstance().getLogger(t),S(),f.on(c.a.PLAYBACK_SEEKING,g,t),f.on(c.a.MEDIA_FRAGMENT_LOADED,m,t),f.on(c.a.METRIC_ADDED,y,t),f.on(c.a.QUALITY_CHANGE_REQUESTED,_,t),t}Rt.__dashjs_factory_name="L2ARule";var Nt=f.a.getClassFactory(Rt),wt="manual_weight_selection",Ct="random_weight_selection",Dt="dynamic_weight_selection";function Ot(){var e,t,n,r,i,a,o,s,u,l=this.context;function c(){n=null,r=1,i=100,a=0,o=null,s=null,u=Dt}function f(){var e=0;if(n)for(var t=0;te&&(e=r.state.throughput)}return e}function h(e,t,n){var r=e.map((function(e,r){return n[r]*Math.pow(e-t[r],2)})).reduce((function(e,t){return e+t}));return(r<0?-1:1)*Math.sqrt(Math.abs(r))}function p(e,t){return h([e.state.throughput,e.state.latency,e.state.rebuffer,e.state.switch],[t.state.throughput,t.state.latency,t.state.rebuffer,t.state.switch],[1,1,1,1])}function g(e,t,n){for(var r=0;ro)&&(a=u,o=l)}t.push(a)}for(var p=null,g=null,m=0;mp)&&(p=y,g=m)}var _=[];_.push(t[g]),t.splice(g,1);for(;t.length>0;){for(var v=null,T=null,S=0;S1&&(A=f()),c/=i,t.debug("getNextQuality called throughput:".concat(A," latency:").concat(c," bufferSize:").concat(d," currentQualityIndex:").concat(m," playbackRate:").concat(p));var b=S[m],I=b.bitrate*E.getSegmentDuration()/T,R=Math.max(0,I-v);if(v-In?e-n:e+n-t}return t={getMinBuffer:function(){return s},getSegmentDuration:c,getNextBufferWithBitrate:function(e,t,n){return f(t,e*u/n)},getNextBuffer:f,findWeightVector:function(e,t,i,a,c,d){var h=null,p=null,g=null,m=Math.abs(t-r);return e.forEach((function(e){n.forEach((function(n){n[0];var r=n[1],a=n[2],y=(n[3],e.bitrate*u/c),E=f(i,y),_=(0===a?10:1/a)*Math.max(1e-5,y-E),v=(0===r?10:1/r)*e.state.latency,T=l.calculateSingleUseQoe(e.bitrate,_,v,d);(null===h||T>h)&&function(e,t,n){if(e>o+n)return!1;return t>=s}(t,E,m)&&(h=T,p=n,g=e.bitrate)}))})),null===p&&null===g&&(p=-1),r=t,p}},i=[.2,.4,.6,.8,1],a=4,n=function e(t,n,r){if(r===n)return t;for(var a=t.length,o=0;oI?I=N:NA?D-A:0;i.setupPerSegmentQoe(A,I,b),i.logSegmentMetrics(w,O,_,v);var M=Ut(s).create({targetLatency:1.5,bufferMin:.3,segmentDuration:A,qoeEvaluator:i});return n.quality=r.getNextQuality(h,1e3*T,_,m,v,d,M),n.reason={throughput:T,latency:_},n.priority=ht.PRIORITY.STRONG,g.setTimeToLoadDelay(0),n.quality!==d&&console.log("[TgcLearningRule]["+l+"] requesting switch to index: ",n.quality,"Average throughput",Math.round(T),"kbps"),n}catch(e){throw e}},reset:function(){r.reset(),i.reset()}},t=Object(d.a)(s).getInstance().getLogger(n),r=Mt(s).create(),i=Ft(s).create(),n}Bt.__dashjs_factory_name="LoLPRule";var kt=f.a.getClassFactory(Bt);function Gt(e){e=e||{};var t,n,r=this.context,i=e.mediaPlayerModel,o=e.dashMetrics,s=e.settings;function u(e){return e.filter((function(e){return e.quality>ht.NO_CHANGE}))}function l(e){var t,n,i,a,o,s={},u=null;if(0!==e.length){for(s[ht.PRIORITY.STRONG]={quality:ht.NO_CHANGE,reason:null},s[ht.PRIORITY.WEAK]={quality:ht.NO_CHANGE,reason:null},s[ht.PRIORITY.DEFAULT]={quality:ht.NO_CHANGE,reason:null},t=0,n=e.length;ti.quality)&&(s[i.priority].quality=i.quality,s[i.priority].reason=i.reason||null);return s[ht.PRIORITY.WEAK].quality!==ht.NO_CHANGE&&(u=s[ht.PRIORITY.WEAK]),s[ht.PRIORITY.DEFAULT].quality!==ht.NO_CHANGE&&(u=s[ht.PRIORITY.DEFAULT]),s[ht.PRIORITY.STRONG].quality!==ht.NO_CHANGE&&(u=s[ht.PRIORITY.STRONG]),u&&(a=u.quality,o=u.reason),ht(r).create(a,o)}}return{initialize:function(){t=[],n=[],s.get().streaming.abr.useDefaultABRRules&&(s.get().streaming.abr.ABRStrategy===a.a.ABR_STRATEGY_L2A?t.push(Nt(r).create({dashMetrics:o,mediaPlayerModel:i,settings:s})):s.get().streaming.abr.ABRStrategy===a.a.ABR_STRATEGY_LoLP?t.push(kt(r).create({dashMetrics:o})):(t.push(It(r).create({dashMetrics:o,mediaPlayerModel:i,settings:s})),t.push(gt(r).create({dashMetrics:o})),s.get().streaming.abr.additionalAbrRules.insufficientBufferRule&&t.push(yt(r).create({dashMetrics:o,settings:s})),s.get().streaming.abr.additionalAbrRules.switchHistoryRule&&t.push(At(r).create()),s.get().streaming.abr.additionalAbrRules.droppedFramesRule&&t.push(Tt(r).create()),s.get().streaming.abr.additionalAbrRules.abandonRequestsRule&&n.push(_t(r).create({dashMetrics:o,mediaPlayerModel:i,settings:s})))),i.getABRCustomRules().forEach((function(e){"qualitySwitchRules"===e.type&&t.push(e.rule(r).create()),"abandonFragmentRules"===e.type&&n.push(e.rule(r).create())}))},reset:function(){[t,n].forEach((function(e){e&&e.length&&e.forEach((function(e){return e.reset&&e.reset()}))})),t=[],n=[]},getMaxQuality:function(e){return l(u(t.map((function(t){return t.getMaxIndex(e)}))))||ht(r).create()},getMinSwitchRequest:l,shouldAbandonFragment:function(e,t){return l(u(n.map((function(n){return n.shouldAbandon(e,t)}))))||ht(r).create()},getQualitySwitchRules:function(){return t}}}Gt.__dashjs_factory_name="ABRRulesCollection";var jt=f.a.getClassFactory(Gt);jt.QUALITY_SWITCH_RULES="qualitySwitchRules",jt.ABANDON_FRAGMENT_RULES="abandonFragmentRules",f.a.updateSingletonFactory(Gt.__dashjs_factory_name,jt);var Yt=jt;function Ht(){var e,t,n,r,i=this.context,o=Object(_.a)(i).getInstance();function s(e){var t;for(t=0;t-1?e:o.get().streaming.buffer.fastSwitchEnabled?20:12}function l(){return o.get().streaming.lowLatencyEnabled?o.get().streaming.delay.liveDelay||3:o.get().streaming.delay.liveDelay}function c(e,n){f(e,n);var r=new lt.a;r.schemeIdUri=e,r.value=n,t.push(r)}function f(e,n){Object(M.b)(e,"string"),Object(M.b)(n,"string"),t.forEach((function(r,i){r.schemeIdUri===e&&r.value===n&&t.splice(i,1)}))}return e={getABRCustomRules:function(){return r},addABRCustomRule:function(e,t,n){if("string"!=typeof e||e!==Yt.ABANDON_FRAGMENT_RULES&&e!==Yt.QUALITY_SWITCH_RULES||"string"!=typeof t)throw a.a.BAD_ARGUMENT_ERROR;var i=s(t);-1===i?r.push({type:e,rulename:t,rule:n}):(r[i].type=e,r[i].rule=n)},removeABRCustomRule:function(e){if(e){var t=s(e);-1!==t&&r.splice(t,1)}else r=[]},getStableBufferTime:u,getInitialBufferLevel:function(){var e=o.get().streaming.buffer.initialBufferLevel;return isNaN(e)||e<0?0:Math.min(u(),e)},getRetryAttemptsForType:function(e){var t=isNaN(o.get().streaming.retryAttempts.lowLatencyMultiplyFactor)?5:o.get().streaming.retryAttempts.lowLatencyMultiplyFactor;return o.get().streaming.lowLatencyEnabled?o.get().streaming.retryAttempts[e]*t:o.get().streaming.retryAttempts[e]},getRetryIntervalsForType:function(e){var t=isNaN(o.get().streaming.retryIntervals.lowLatencyReductionFactor)?10:o.get().streaming.retryIntervals.lowLatencyReductionFactor;return o.get().streaming.lowLatencyEnabled?o.get().streaming.retryIntervals[e]/t:o.get().streaming.retryIntervals[e]},getLiveDelay:l,getLiveCatchupLatencyThreshold:function(){try{var e=o.get().streaming.liveCatchup.latencyThreshold,t=l();if(null!==e&&!isNaN(e))return Math.max(e,t);var n=o.get().streaming.liveCatchup.minDrift,r=!isNaN(t)&&t?isNaN(n)?l():o.get().streaming.liveCatchup.minDrift+l():NaN;return r&&!isNaN(r)?Math.max(4*r,5):NaN}catch(e){return NaN}},addUTCTimingSource:c,removeUTCTimingSource:f,getUTCTimingSources:function(){return t},clearDefaultUTCTimingSources:function(){t=[]},restoreDefaultUTCTimingSources:function(){var e=o.get().streaming.utcSynchronization.defaultTimingSource;c(e.scheme,e.value)},setXHRWithCredentialsForType:function e(t,r){t?n[t]=!!r:Object.keys(n).forEach((function(t){e(t,r)}))},getXHRWithCredentialsForType:function(e){var t=n[e];return void 0===t?n.default:t},getDefaultUtcTimingSource:function(){return o.get().streaming.utcSynchronization.defaultTimingSource},reset:function(){}},t=[],n={default:!1},r=[],e}Ht.__dashjs_factory_name="MediaPlayerModel";var Kt=f.a.getSingletonFactory(Ht);function qt(e){var t=(e=e||{}).abrController,n=e.switchHistory,r=e.droppedFramesHistory,i=e.currentRequest,a=e.useBufferOccupancyABR,o=e.useL2AABR,s=e.useLoLPABR,u=e.streamProcessor?e.streamProcessor.getScheduleController():null,l=e.streamProcessor?e.streamProcessor.getRepresentationInfo():null,c=e.videoModel?e.videoModel:null;function f(){return l?l.mediaInfo:null}return{getMediaType:function(){var e=f();return e?e.type:null},getMediaInfo:f,getDroppedFramesHistory:function(){return r},getCurrentRequest:function(){return i},getSwitchHistory:function(){return n},getStreamInfo:function(){var e=f();return e?e.streamInfo:null},getScheduleController:function(){return u},getAbrController:function(){return t},getRepresentationInfo:function(){return l},useBufferOccupancyABR:function(){return a},useL2AABR:function(){return o},useLoLPABR:function(){return s},getVideoModel:function(){return c}}}qt.__dashjs_factory_name="RulesContext";var Vt=f.a.getClassFactory(qt);function Wt(){var e=[],t=[];return{push:function(n){n.newValue===ht.NO_CHANGE&&(n.newValue=n.oldValue),e[n.oldValue]||(e[n.oldValue]={noDrops:0,drops:0,dropSize:0});var r=n.newValue-n.oldValue,i=r<0?1:0,a=i?-r:0,o=i?0:1;if(e[n.oldValue].drops+=i,e[n.oldValue].dropSize+=a,e[n.oldValue].noDrops+=o,t.push({idx:n.oldValue,noDrop:o,drop:i,dropSize:a}),t.length>8){var s=t.shift();e[s.idx].drops-=s.drop,e[s.idx].dropSize-=s.dropSize,e[s.idx].noDrops-=s.noDrop}},getSwitchRequests:function(){return e},reset:function(){e=[],t=[]}}}Wt.__dashjs_factory_name="SwitchRequestHistory";var zt=f.a.getClassFactory(Wt);function Xt(){var e={},t={},n={};return{push:function(r,i,a){if(i){e[r]||(e[r]=[],t[r]=0,n[r]=0);var o=a&&a.droppedVideoFrames?a.droppedVideoFrames:0,s=a&&a.totalVideoFrames?a.totalVideoFrames:0,u=o-t;t[r]=o;var l=s-n;n[r]=s;var c=e[r];isNaN(i)||(c[i]?(c[i].droppedVideoFrames+=u,c[i].totalVideoFrames+=l):c[i]={droppedVideoFrames:u,totalVideoFrames:l})}},getFrameHistory:function(t){return e[t]},clearForStream:function(r){try{delete e[r],delete t[r],delete n[r]}catch(e){}},reset:function(){e={},t={},n={}}}}Xt.__dashjs_factory_name="DroppedFramesHistory";var Qt=f.a.getClassFactory(Xt);function $t(e){var t,n,r,i,o,s=(e=e||{}).settings;function u(e,t,n,r){var i=Math.pow(.5,n/r.fast);e.fastEstimate=(1-i)*t+i*e.fastEstimate;var a=Math.pow(.5,n/r.slow);e.slowEstimate=(1-a)*t+a*e.slowEstimate,e.totalWeight+=n}function l(e,u,l){return s.get().streaming.abr.movingAverageMethod!==a.a.MOVING_AVERAGE_SLIDING_WINDOW?function(e,t){var n=e?o.throughputHalfLife:o.latencyHalfLife,a=e?r[t]:i[t];if(!a||a.totalWeight<=0)return NaN;var s=a.fastEstimate/(1-Math.pow(.5,a.totalWeight/n.fast)),u=a.slowEstimate/(1-Math.pow(.5,a.totalWeight/n.slow));return e?Math.min(s,u):Math.max(s,u)}(e,u):function(e,r,i){var a=function(e,r,i){var a,o;if(e?(a=t[r],o=i?3:4):(a=n[r],o=4),a){if(o>=a.length)o=a.length;else if(e)for(var s=1;s=1.3||u<=1/1.3)&&(o+=1)===a.length)break}}else o=0;return o}(e,r,i),o=(e?t:n)[r];if(0===a||!o||0===o.length)return NaN;return(o=o.slice(-a)).reduce((function(e,t){return e+t}))/o.length}(e,u,l)}function c(e,t){return l(!0,e,t)}function f(e){t[e]=t[e]||[],n[e]=n[e]||[],r[e]=r[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0},i[e]=i[e]||{fastEstimate:0,slowEstimate:0,totalWeight:0}}function d(){t={},n={},r={},i={}}var h={push:function(e,l,c){if(l.trace&&l.trace.length){var d=l.tresponse.getTime()-l.trequest.getTime()||1,h=l._tfinish.getTime()-l.tresponse.getTime()||1,p=l.trace.reduce((function(e,t){return e+t.b[0]}),0),g=0,m=0;if(s.get().streaming.lowLatencyEnabled){if(s.get().streaming.abr.fetchThroughputCalculationMode===a.a.ABR_FETCH_THROUGHPUT_CALCULATION_MOOF_PARSING){var y=l.trace.reduce((function(e,t){return e+t.t}),0);m=Math.round(y/l.trace.length)}0===m&&(g=l.trace.reduce((function(e,t){return e+t.d}),0))}else g=c?h:d+h;if(0!==g&&(m=Math.round(8*p/g)),f(e),function(e,t,n){return e===a.a.VIDEO?n0&&!t[e].hasCachedEntries)return;t[e].hasCachedEntries=!0}else t[e]&&t[e].hasCachedEntries&&function(e){delete t[e],delete n[e],delete r[e],delete i[e],f(e)}(e);t[e].push(m),t[e].length>20&&t[e].shift(),n[e].push(d),n[e].length>20&&n[e].shift(),u(r[e],m,.001*h,o.throughputHalfLife),u(i[e],d,1,o.latencyHalfLife)}},getAverageThroughput:c,getSafeAverageThroughput:function(e,t){var n=c(e,t);return isNaN(n)||(n*=s.get().streaming.abr.bandwidthSafetyFactor),n},getAverageLatency:function(e){return l(!1,e)},reset:d};return o={throughputHalfLife:{fast:3,slow:8},latencyHalfLife:{fast:1,slow:2}},d(),h}$t.__dashjs_factory_name="ThroughputHistory";var Zt=f.a.getClassFactory($t);function Jt(){var e,t,n,r,i,o,s,f,p,g,y,E,_,T,S,A,b,I,R,N,w,C,D,O,P,L=this.context,F=Object(d.a)(L).getInstance(),x=Object(l.a)(L).getInstance();function U(){i={},o={},f={},s={},I={},w={},C={},D={},void 0===g&&(g=!1),R&&R.reset(),b=void 0,R=void 0,N=void 0,clearTimeout(p),p=null}function B(t){var i=t.request.mediaType,a=t.streamId;if(i&&a&&s[a]&&P.get().streaming.abr.autoSwitchBitrate[i]){var o=s[a][i];if(o){var l=Vt(L).create({abrController:e,streamProcessor:o,currentRequest:t.request,useBufferOccupancyABR:w[i],useL2AABR:C[i],useLoLPABR:D[i],videoModel:T}),c=n.shouldAbandonFragment(l,a);if(c.quality>ht.NO_CHANGE){var d=o.getFragmentModel();d.getRequests({state:m.a.FRAGMENT_MODEL_LOADING,index:t.request.index})[0]&&(d.abortRequests(),f[a][i].state=u.ABANDON_LOAD,I[a][i].reset(),I[a][i].push({oldValue:H(i,a),newValue:c.quality,confidence:1,reason:c.reason}),K(i,r.getActiveStreamInfo(),c.quality,c.reason),clearTimeout(p),p=setTimeout((function(){f[a][i].state=u.ALLOW_LOAD,p=null}),P.get().streaming.abandonLoadTimeout))}}}}function k(e){e.mediaType===a.a.VIDEO&&(void 0!==b&&R.push(e.streamId,b,T.getPlaybackQuality()),b=e.newQuality)}function G(e){var n,r;e.metric!==u.HTTP_REQUEST||!e.value||e.value.type!==v.a.MEDIA_SEGMENT_TYPE||e.mediaType!==a.a.AUDIO&&e.mediaType!==a.a.VIDEO||N.push(e.mediaType,e.value,P.get().streaming.abr.useDeadTimeLatency),e.metric!==u.BUFFER_LEVEL||e.mediaType!==a.a.AUDIO&&e.mediaType!==a.a.VIDEO||(n=e.mediaType,r=.001*e.value.level,P.get().streaming.abr.ABRStrategy===a.a.ABR_STRATEGY_DYNAMIC&&function(e,n){var r=S.getStableBufferTime(),i=r,a=.5*r,o=w[e],s=n>(o?a:i);w[e]=s,s!==o&&(s?t.info("["+e+"] switching from throughput to buffer occupancy ABR rule (buffer: "+n.toFixed(3)+")."):t.info("["+e+"] switching from buffer occupancy to throughput ABR rule (buffer: "+n.toFixed(3)+")."))}(n,r))}function j(e,t){try{return i[t]=i[t]||{},i[t].hasOwnProperty(e)||(i[t][e]=0),function(e,t,n){if(t!==a.a.VIDEO||!P.get().streaming.abr.limitBitrateByPortal||!s[n]||!s[n][t])return e;g||z();var r=s[n][t].getStreamInfo(),i=_.getAdaptationForType(r.index,t,r).Representation,o=e;if(y>0&&E>0){for(;o>0&&i[o]&&y=1||a<0)return e;return Math.min(e,Math.round(r*a))}(function(e,t){var n=i[t][e],r=n;if(!s[t]||!s[t][e])return r;var a=Y(e,t);void 0!==a&&(r=Math.max(n,a));var o=function(e,t){try{var n=P.get().streaming.abr.maxBitrate[e];return n>-1?V(s[t][e].getMediaInfo(),n,t):void 0}catch(e){return}}(e,t);void 0!==o&&(r=Math.min(r,o));return r}(e,t),e,t),e,t)}catch(e){return}}function Y(e,t){try{return function(e,t){try{var n=P.get().streaming.abr.minBitrate[e];if(n>-1){var r=s[t][e].getMediaInfo(),i=W(r),a=V(r,n,t);return i[a]&&a1&&void 0!==arguments[1]?arguments[1]:null;try{if(t||(t=r.getActiveStreamInfo().id),e&&s[t]&&s[t][e])if(t)return o[t]=o[t]||{},o[t].hasOwnProperty(e)||(o[t][e]=0),o[t][e];return 0}catch(e){return 0}}function K(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(t&&t.id&&e){var i=t.id,a=H(e,i);Object(M.a)(n);var o=j(e,i);n!==a&&n>=0&&n<=o&&q(e,a,n,o,r,i)}}function q(e,n,r,i,a,u){if(e&&s[u]&&s[u][e]){var l=s[u][e].getStreamInfo(),f=O.getCurrentBufferLevel(e);t.info("Stream ID: "+u+" ["+e+"] switch from "+n+" to "+r+"/"+i+" (buffer: "+f+") "+(a?JSON.stringify(a):".")),o[u]=o[u]||{},o[u][e]=r;var d=function(e,t,n){if(t&&s&&s[e]&&s[e][t]){var r=W(s[e][t].getMediaInfo());return r[n]?r[n]:null}return null}(u,e,r);x.trigger(c.a.QUALITY_CHANGE_REQUESTED,{oldQuality:n,newQuality:r,reason:a,streamInfo:l,bitrateInfo:d,maxIdx:i,mediaType:e},{streamId:l.id,mediaType:e});var h=N.getAverageThroughput(e);isNaN(h)||A.setSavedBitrateSettings(e,h)}}function V(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=e&&e.type?s[n][e.type].getRepresentationInfo():null;if(P.get().streaming.abr.useDeadTimeLatency&&r&&i&&i.fragmentDuration){r/=1e3;var a=i.fragmentDuration;if(r>a)return 0;var o=r/a;t*=1-o}for(var u=W(e),l=u.length-1;l>=0;l--){var c=u[l];if(1e3*t>=c.bitrate)return l}return 0}function W(e){var t=[];if(!e||!e.bitrateList)return t;for(var n,r=e.bitrateList,i=e.type,a=0,o=r.length;a1&&void 0!==arguments[1]?arguments[1]:null;if(t||(t=r.getActiveStreamInfo().id),e&&s&&s[t]&&s[t][e]){var n=j(e,t),i=W(s[t][e].getMediaInfo());return i[n]?i[n]:null}return null},getMinAllowedIndexFor:Y,getMaxAllowedIndexFor:j,getInitialBitrateFor:function(e,t){if(function(){if(!A||!A.hasOwnProperty("getSavedBitrateSettings"))throw new Error(a.a.MISSING_CONFIG_ERROR)}(),e===a.a.TEXT)return NaN;var n=A.getSavedBitrateSettings(e),r=P.get().streaming.abr.initialBitrate[e],i=P.get().streaming.abr.initialRepresentationRatio[e];if(-1===r)if(i>-1){var o=s[t][e].getStreamInfo(),u=_.getAdaptationForType(o.index,e,o).Representation;if(Array.isArray(u))r=u[Math.max(Math.round(u.length*i)-1,0)].bandwidth/1e3;else r=0}else r=isNaN(n)?e===a.a.VIDEO?1e3:100:n;return r},getQualityFor:H,getAbandonmentStateFor:function(e,t){return f[e]&&f[e][t]?f[e][t].state:null},setPlaybackQuality:K,checkPlaybackQuality:function(t,r){try{if(!(t&&s&&s[r]&&s[r][t]))return!1;if(R){var i=T.getPlaybackQuality();i&&R.push(r,b,i)}if(!P.get().streaming.abr.autoSwitchBitrate[t])return!1;var a=H(t,r),o=Vt(L).create({abrController:e,switchHistory:I[r][t],droppedFramesHistory:R,streamProcessor:s[r][t],currentValue:a,useBufferOccupancyABR:w[t],useL2AABR:C[t],useLoLPABR:D[t],videoModel:T}),l=Y(t,r),c=j(t,r),d=n.getMaxQuality(o),h=d.quality;return void 0!==l&&(h>ht.NO_CHANGE?h:a)c&&(h=c),I[r][t].push({oldValue:a,newValue:h}),h>ht.NO_CHANGE&&h!==a&&(f[r][t].state===u.ALLOW_LOAD||h>a)&&(q(t,a,h,c,d.reason,r),!0)}catch(e){return!1}},setElementSize:z,setWindowResizeEventCalled:function(e){g=e},registerStreamType:function(e,t){var n=t.getStreamInfo().id;s[n]||(s[n]={}),I[n]||(I[n]={}),f[n]||(f[n]={}),I[n][e]=zt(L).create(),s[n][e]=t,f[n][e]={},f[n][e].state=u.ALLOW_LOAD,function(e){var t=P.get().streaming.abr.ABRStrategy;t===a.a.ABR_STRATEGY_L2A?(w[e]=!1,D[e]=!1,C[e]=!0):t===a.a.ABR_STRATEGY_LoLP?(w[e]=!1,D[e]=!0,C[e]=!1):t===a.a.ABR_STRATEGY_BOLA?(w[e]=!0,D[e]=!1,C[e]=!1):t===a.a.ABR_STRATEGY_THROUGHPUT?(w[e]=!1,D[e]=!1,C[e]=!1):t===a.a.ABR_STRATEGY_DYNAMIC&&(w[e]=!(!w||!w[e])&&w[e],D[e]=!1,C[e]=!1)}(e),e===a.a.VIDEO&&z()},unRegisterStreamType:function(e,t){try{s[e]&&s[e][t]&&delete s[e][t],I[e]&&I[e][t]&&delete I[e][t],f[e]&&f[e][t]&&delete f[e][t]}catch(e){}},setConfig:function(e){e&&(e.streamController&&(r=e.streamController),e.domStorage&&(A=e.domStorage),e.mediaPlayerModel&&(S=e.mediaPlayerModel),e.dashMetrics&&(O=e.dashMetrics),e.adapter&&(_=e.adapter),e.videoModel&&(T=e.videoModel),e.settings&&(P=e.settings))},reset:function(){U(),x.off(c.a.LOADING_PROGRESS,B,e),x.off(h.a.QUALITY_CHANGE_RENDERED,k,e),x.off(h.a.METRIC_ADDED,G,e),n&&n.reset()}},t=F.getLogger(e),U(),e}Jt.__dashjs_factory_name="AbrController";var en=f.a.getSingletonFactory(Jt);en.QUALITY_DEFAULT=0,f.a.updateSingletonFactory(Jt.__dashjs_factory_name,en);var tn=en,nn=n(41),rn=new Map([[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,"loadedmetadata"],[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_CURRENT_DATA,"loadeddata"],[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_FUTURE_DATA,"canplay"],[a.a.VIDEO_ELEMENT_READY_STATES.HAVE_ENOUGH_DATA,"canplaythrough"]]);function an(){var e,t,n,r,i=this.context,o=Object(l.a)(i).getInstance(),s=[];function u(){n&&(n.playbackRate=1,n.removeEventListener("canplay",u))}function f(){return s.length>0}function h(){if(n&&f()&&0===n.playbackRate){var e=document.createEvent("Event");e.initEvent("waiting",!0,!1),n.dispatchEvent(e)}}function p(e,t){n&&n.addEventListener(e,t)}function g(e,t){n&&n.removeEventListener(e,t)}function m(){return n?n.readyState:NaN}function y(){return n?n.buffered:null}function E(e,t,r,i,a){if(n)for(var o=0;o=e)t();else{!function(e,t){p(e,(function n(){g(e,n),t(e)}))}(rn.get(e),t)}}(a.a.VIDEO_ELEMENT_READY_STATES.HAVE_METADATA,(function(){if(n){if(n.currentTime===e)return;try{e=t?function(e){var t=y(),n=e,r=9999999999;if(t)for(var i=0;i=a&&e<=o)return e;s1&&void 0!==arguments[1]&&arguments[1];n&&(!t&&n.readyState<=2&&e>0?n.addEventListener("canplay",u):n.playbackRate=e)},getPlayedRanges:function(){return n?n.played:null},getEnded:function(){return n?n.ended:null},setStallState:function(e,t){!function(e,t){t?function(e){if(null===e||!n||n.seeking||-1!==s.indexOf(e))return;s.push(e)}(e):function(e){var t=s.indexOf(e);if(null===e)return;-1!==t&&s.splice(t,1)}(e)}(e,t)},getElement:function(){return n},setElement:function(e){if(!(null==e||e&&/^(VIDEO|AUDIO)$/i.test(e.nodeName)))throw"element is not video or audio DOM type!";(n=e)&&(n.preload="auto")},setSource:function(e){n&&(e?n.src=e:(n.removeAttribute("src"),n.load()))},getSource:function(){return n?n.src:null},getTTMLRenderingDiv:function(){return r},setTTMLRenderingDiv:function(e){(r=e).style.position="absolute",r.style.display="flex",r.style.overflow="hidden",r.style.pointerEvents="none",r.style.top=0,r.style.left=0},getPlaybackQuality:function(){if(!n)return null;var e="webkitDroppedFrameCount"in n&&"webkitDecodedFrameCount"in n,t=null;return"getVideoPlaybackQuality"in n?t=n.getVideoPlaybackQuality():e&&(t={droppedVideoFrames:n.webkitDroppedFrameCount,totalVideoFrames:n.webkitDroppedFrameCount+n.webkitDecodedFrameCount,creationTime:new Date}),t},addEventListener:p,removeEventListener:g,getReadyState:m,getBufferRange:y,getClientWidth:function(){return n?n.clientWidth:NaN},getClientHeight:function(){return n?n.clientHeight:NaN},getTextTracks:function(){return n?n.textTracks:[]},getTextTrack:E,addTextTrack:function(e,t,r,i,a){if(!n)return null;var o=E(e,t,r,i,a);return o||((o=n.addTextTrack(e,t,r)).isEmbedded=a,o.isTTML=i),o},appendChild:function(e){n&&(n.appendChild(e),void 0!==e.isTTML&&(n.textTracks[n.textTracks.length-1].isTTML=e.isTTML,n.textTracks[n.textTracks.length-1].isEmbedded=e.isEmbedded))},removeChild:function(e){n&&n.removeChild(e)},getVideoWidth:function(){return n?n.videoWidth:NaN},getVideoHeight:function(){return n?n.videoHeight:NaN},getVideoRelativeOffsetTop:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().top-e.getBoundingClientRect().top:NaN},getVideoRelativeOffsetLeft:function(){var e=n.parentNode.host||n.parentNode;return e?n.getBoundingClientRect().left-e.getBoundingClientRect().left:NaN},reset:function(){o.off(c.a.PLAYBACK_PLAYING,h,this)}},t=Object(d.a)(i).getInstance().getLogger(e),e}an.__dashjs_factory_name="VideoModel";var on=f.a.getSingletonFactory(an),sn=n(36),un=[{oldKey:"dashjs_vbitrate",newKey:"dashjs_video_bitrate"},{oldKey:"dashjs_abitrate",newKey:"dashjs_audio_bitrate"},{oldKey:"dashjs_vsettings",newKey:"dashjs_video_settings"},{oldKey:"dashjs_asettings",newKey:"dashjs_audio_settings"}];function ln(e){e=e||{};var t,n,r,i=this.context,o=e.settings;function s(e){if(void 0!==r)return r;r=!1;var t;try{"undefined"!=typeof window&&(t=window[e])}catch(e){return n.warn("DOMStorage access denied: "+e.message),r}if(!t||"localStorage"!==e&&"sessionStorage"!==e)return r;try{t.setItem("1","1"),t.removeItem("1"),r=!0}catch(e){n.warn("DOMStorage is supported, but cannot be used: "+e.message)}return r}function u(){return 6e5*Math.round((new Date).getTime()/6e5)}function l(e,t){return s(e)&&o.get().streaming[t+"CachingInfo"].enabled}function c(){if(!o)throw new Error(a.a.MISSING_CONFIG_ERROR)}return t={getSavedBitrateSettings:function(e){var t=NaN;if(c(),l("localStorage","lastBitrate")){var r="dashjs_?_bitrate".replace(/\?/,e);try{var i=JSON.parse(localStorage.getItem(r))||{},a=(new Date).getTime()-parseInt(i.timestamp,10)>=o.get().streaming.lastBitrateCachingInfo.ttl||!1,s=parseFloat(i.bitrate);isNaN(s)||a?a&&localStorage.removeItem(r):(t=s,n.debug("Last saved bitrate for "+e+" was "+s))}catch(e){return null}}return t},setSavedBitrateSettings:function(e,t){if(l("localStorage","lastBitrate")&&t){var r="dashjs_?_bitrate".replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({bitrate:t.toFixed(3),timestamp:u()}))}catch(e){n.error(e.message)}}},getSavedMediaSettings:function(e){var t=null;if(c(),l("localStorage","lastMediaSettings")){var n="dashjs_?_settings".replace(/\?/,e);try{var r=JSON.parse(localStorage.getItem(n))||{},i=(new Date).getTime()-parseInt(r.timestamp,10)>=o.get().streaming.lastMediaSettingsCachingInfo.ttl||!1;t=r.settings,i&&(localStorage.removeItem(n),t=null)}catch(e){return null}}return t},setSavedMediaSettings:function(e,t){if(l("localStorage","lastMediaSettings")){var r="dashjs_?_settings".replace(/\?/,e);try{localStorage.setItem(r,JSON.stringify({settings:t,timestamp:u()}))}catch(e){n.error(e.message)}}}},n=Object(d.a)(i).getInstance().getLogger(t),s("localStorage")&&un.forEach((function(e){var t=localStorage.getItem(e.oldKey);if(t){localStorage.removeItem(e.oldKey);try{localStorage.setItem(e.newKey,t)}catch(e){n.error(e.message)}}})),t}ln.__dashjs_factory_name="DOMStorage";var cn=f.a.getSingletonFactory(ln),fn=n(51),dn=n(27);function hn(){var e,t,n,r,i,a,o,s,u,l,c,f,d,h=this.context;function p(e,t,n){n({segments:e,representation:t,error:e?void 0:new y.a(u.SEGMENT_BASE_LOADER_ERROR_CODE,u.SEGMENT_BASE_LOADER_ERROR_MESSAGE)})}function g(e){if(e.url){var t=new Be.a;return t.setInfo(e),t}}return e={setConfig:function(s){s.baseURLController&&(d=s.baseURLController),s.dashMetrics&&(a=s.dashMetrics),s.mediaPlayerModel&&(o=s.mediaPlayerModel),s.errHandler&&(n=s.errHandler),s.boxParser&&(r=s.boxParser),s.debug&&(t=s.debug.getLogger(e)),s.requestModifier&&(i=s.requestModifier),s.errors&&(u=s.errors),s.urlUtils&&(f=s.urlUtils),s.constants&&(l=s.constants),s.dashConstants&&(c=s.dashConstants)},initialize:function(){s=Object(Ue.a)(h).create({errHandler:n,dashMetrics:a,mediaPlayerModel:o,requestModifier:i,boxParser:r,errors:u,urlUtils:f,constants:l,dashConstants:c})},loadInitialization:function(e,n){return new Promise((function(i){!function e(n,i,a,o){var u=null,l=n?d.resolve(n.path):null,c=o||{init:!0,url:l?l.url:void 0,range:{start:0,end:1500},searching:!1,bytesLoaded:0,bytesToLoad:1500,mediaType:i};t.debug("Start searching for initialization.");var f=g(c),h=function(t){if(c.bytesLoaded=c.range.end,!(u=r.findInitRange(t)))return c.range.end=c.bytesLoaded+c.bytesToLoad,e(n,i,a,c);n.range=u,a(n)};s.load({request:f,success:h,error:function(){a(n)}}),t.debug("Perform init search: "+c.url)}(e,n,i)}))},loadSegments:function(e,n,i){return new Promise((function(a){!function e(n,i,a,o,u,l){if(a&&(void 0===a.start||void 0===a.end)){var c=a?a.toString().split("-"):null;a=c?{start:parseFloat(c[0]),end:parseFloat(c[1])}:null}u=u||p;var f=null,h=null,m=!!a,y=n?d.resolve(n.path):null,E={init:!1,url:y?y.url:void 0,range:m?a:{start:0,end:1500},searching:!m,bytesLoaded:l?l.bytesLoaded:0,bytesToLoad:1500,mediaType:i},_=g(E),v=function(a){var s=E.bytesToLoad,l=a.byteLength;if(E.bytesLoaded=E.range.end-E.range.start,f=r.parse(a),(h=f.getBox("sidx"))&&h.isComplete){var c,d,p=h.references;if(null!=p&&p.length>0&&(c=1===p[0].reference_type),c){var g,m,y,_;t.debug("Initiate multiple SIDX load."),E.range.end=E.range.start+h.size;var v=[],T=0,S=(h.offset||E.range.start)+h.size,A=function(e){e?(v=v.concat(e),++T>=m&&(v.sort((function(e,t){return e.startTime-t.startTime<0?-1:0})),u(v,n,o))):u(null,n,o)};for(g=0,m=p.length;g16777215?(n.getUint32(r)!==e.tag&&(i=!1),a=4):e.tag>65535?(256*n.getUint16(r)+n.getUint8(r+2)!==e.tag&&(i=!1),a=3):e.tag>255?(n.getUint16(r)!==e.tag&&(i=!1),a=2):(n.getUint8(r)!==e.tag&&(i=!1),a=1),!i&&e.required&&!t)throw new Error("required tag not found");return i&&(r+=a),i}function a(e){var t=1,i=128,a=-1,o=0,s=n.getUint8(r),u=0;for(u=0;u<8;u+=1){if((s&i)===i){o=void 0===e?s&~i:s,a=u;break}i>>=1}for(u=0;u1&&a){var l=d(a,n);if(i[a.id]&&i[a.id][n])for(var f=0,h=u.length;f0))return u;s=r[0].mpd.manifest}var l=E(e,o),c=t.getAdaptationsForType(s,e?e.index:null,n);return u=f(s,l,e,c,n),n===a.TEXT&&(c=t.getAdaptationsForType(s,e?e.index:null,a.VIDEO),u=u.concat(f(s,l,e,c,n,!0))),u}function h(e){var n=p(e);return t.getRegularPeriods(n)}function p(e){var n=m(e);return t.getMpd(n)}function g(){r=[],i={}}function m(e){return e||(r.length>0?r[0].mpd.manifest:null)}function y(e){try{var n=E(e.streamInfo,r),i=t.getAdaptationsForPeriod(n);return e&&e.streamInfo&&void 0!==e.streamInfo.id&&i?i[e.index]:null}catch(e){return null}}function E(e,t){for(var n=t.length,r=0;r=0&&void 0!==s&&(n=t?"cea-608:"+t:"cea-608",r.embeddedCaptions=!0),n})),r.audioChannelConfiguration=t.getAudioChannelConfigurationForAdaptation(i).map((function(e){return e.value})),0===r.audioChannelConfiguration.length&&Array.isArray(i.Representation_asArray)&&i.Representation_asArray.length>0&&(r.audioChannelConfiguration=t.getAudioChannelConfigurationForRepresentation(i.Representation_asArray[0]).map((function(e){return e.value}))),r.roles=t.getRolesForAdaptation(i).map((function(e){return e.value})),r.codec=t.getCodec(i),r.mimeType=t.getMimeType(i),r.contentProtection=t.getContentProtectionData(i),r.bitrateList=t.getBitrateListForAdaptation(i),r.selectionPriority=t.getSelectionPriority(i),r.contentProtection&&r.contentProtection.forEach((function(e){e.KID=t.getKID(e)})),r.isText=t.getIsText(i),r.supplementalProperties=t.getSupplementalProperties(i),r.isFragmented=t.getIsFragmented(i),r.isEmbedded=!1,r}function v(e,t,n){e.id=t,e.index=100+parseInt(t.substring(2,3)),e.type=a.TEXT,e.codec="cea-608-in-SEI",e.isEmbedded=!0,e.isFragmented=!1,e.lang=n,e.roles=["caption"]}function T(e){var n,r,i=new An;return i.id=e.id,i.index=e.index,i.start=e.start,i.duration=e.duration,i.manifestInfo=(n=e.mpd,(r=new bn).dvrWindowSize=n.timeShiftBufferDepth,r.loadedTime=n.manifest.loadedTime,r.availableFrom=n.availabilityStartTime,r.minBufferTime=n.manifest.minBufferTime,r.maxFragmentDuration=n.maxSegmentDuration,r.duration=t.getDuration(n.manifest),r.isDynamic=t.getIsDynamic(n.manifest),r.serviceDescriptions=t.getServiceDescriptions(n.manifest),r.protocol=n.manifest.protocol,r),i.isLast=1===e.mpd.manifest.Period_asArray.length||Math.abs(i.start+i.duration-i.manifestInfo.duration)<1,i}function S(){if(!a)throw new Error("setConfig function has to be called previously")}function A(e){return r.length>0?r[0].mpd.manifest.Period_asArray[e]:null}function b(e,t,n){var r,i,a,o,s;if(e)for(r=e.AdaptationSet_asArray,o=0;o0?e.segments[0].duration:NaN),n.MSETimeOffset=e.MSETimeOffset,n.mediaInfo=_(e.adaptation),n}return null},getStreamsInfo:function(e,t){var n=[],i=r;if(e&&(S(),i=h(e)),i.length>0){(!t||t>i.length)&&(t=i.length);for(var a=0;a0&&o&&(a=i?t.getAdaptationForId(i,r[0].mpd.manifest,o.index):t.getAdaptationForIndex(n?n.index:null,r[0].mpd.manifest,o.index)),a},getRealPeriodByIndex:function(e){return t.getRealPeriodForIndex(e,r[0].mpd.manifest)},getEssentialPropertiesForRepresentation:function(e){try{return t.getEssentialPropertiesForRepresentation(e)}catch(e){return[]}},getVoRepresentations:function(e){var n=y(e);return t.getRepresentationsForAdaptation(n)},getEventsFor:function(e,n){var i=[];if(r.length>0){var a=r[0].mpd.manifest;e instanceof An?i=t.getEventsForPeriod(E(e,r)):e instanceof Sn?i=t.getEventStreamForAdaptationSet(a,y(e)):e instanceof Tn&&(i=t.getEventStreamForRepresentation(a,n))}return i},getEvent:function(e,t,n,r){try{if(!e||!t||isNaN(n)||!r)return null;var i=e.scheme_id_uri,a=e.value;if(!t[i+"/"+a])return null;var o,s=new In.a,u=e.timescale||1,l=r.adaptation.period.start,c=t[i+"/"+a],f=isNaN(r.presentationTimeOffset)?isNaN(c.presentationTimeOffset)?0:c.presentationTimeOffset:r.presentationTimeOffset,d=e.presentation_time_delta/u;o=0===e.version?l+n-f+d:l-f+d;var h=e.event_duration,p=e.id,g=e.message_data;return s.eventStream=c,s.eventStream.value=a,s.eventStream.timescale=u,s.duration=h,s.id=p,s.calculatedPresentationTime=o,s.messageData=g,s.presentationTimeDelta=d,s}catch(e){return null}},getMpd:p,setConfig:function(e){e&&(e.constants&&(a=e.constants),e.cea608parser&&(s=e.cea608parser),e.errHandler&&t.setConfig({errHandler:e.errHandler}),e.BASE64&&t.setConfig({BASE64:e.BASE64}))},updatePeriods:function(e){if(!e)return null;S(),r=h(e)},getIsTextTrack:function(e){return t.getIsText(e)},getUTCTimingSources:function(){var e=m();return t.getUTCTimingSources(e)},getSuggestedPresentationDelay:function(){var e=r.length>0?r[0].mpd:null;return t.getSuggestedPresentationDelay(e)},getAvailabilityStartTime:function(e){var n=p(e);return t.getAvailabilityStartTime(n)},getIsTypeOf:function(e,n){return t.getIsTypeOf(e,n)},getIsDynamic:function(e){var n=m(e);return t.getIsDynamic(n)},getDuration:function(e){var n=m(e);return t.getDuration(n)},getRegularPeriods:h,getLocation:function(e){return t.getLocation(e)},getPatchLocation:function(e){var n=t.getPatchLocation(e),r=t.getPublishTime(e);if(!n||!r)return null;if(n.hasOwnProperty("ttl")&&r){var i=1e3*parseFloat(n.ttl);if(r.getTime()+i<=(new Date).getTime())return null}return n.__text},getManifestUpdatePeriod:function(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t.getManifestUpdatePeriod(e,n)},getPublishTime:function(e){return t.getPublishTime(e)},getIsDVB:function(e){return t.hasProfile(e,"urn:dvb:dash:profile:dvb-dash:2014")},getIsPatch:function(e){return n.getIsPatch(e)},getBaseURLsFromElement:function(e){return t.getBaseURLsFromElement(e)},getRepresentationSortFunction:function(){return t.getRepresentationSortFunction()},getCodec:function(e,n,r){return t.getCodec(e,n,r)},getPeriodById:function(e){if(!e||0===r.length)return null;var t=r.filter((function(t){return t.id===e}));return t&&t.length>0?t[0]:null},setCurrentMediaInfo:function(e,t,n){i[e]=i[e]||{},i[e][t]=i[e][t]||{},i[e][t]=n},isPatchValid:function(e,r){var i=t.getId(e),a=n.getMpdId(r),o=t.getPublishTime(e),s=n.getPublishTime(r),u=n.getOriginalPublishTime(r);return!!(i&&a&&i==a&&o&&u&&o.getTime()==u.getTime()&&s&&o.getTime()1?i[r]=u:1==u.length?i[r]=u[0]:delete i[r+"_asArray"]}"add"!==t.action&&"replace"!==t.action||Object.keys(t.value).forEach((function(e){var n=t.value[e],a=i[e+"_asArray"]||[];if(0===a.length&&i[e]&&a.push(i[e]),0===a.length)a=n;else{var u=a.length;u=e==r&&-1!=o?o+(s?0:1)+("replace"==t.action?-1:0):s?0:a.length,a.splice.apply(a,[u,0].concat(n))}i[e+"_asArray"]=a,i[e]=1==a.length?a[0]:a}))}}}))},areMediaInfosEqual:c,reset:g},t=Object(Rn.a)(u).getInstance(),n=Mn(u).getInstance(),g(),e}Pn.__dashjs_factory_name="DashAdapter";var Ln=f.a.getSingletonFactory(Pn);function Fn(e,t){for(var n=0;nr.get().streaming.metrics.maxListDepth&&i[t].shift())}function m(e,t,n){g(e,t,n),h(e,t,n)}return t={clearCurrentMetricsForType:function(e){delete n[e],f(e)},clearAllCurrentMetrics:function(){n={},s()},getMetricsFor:p,addHttpRequest:function e(t,n,r,i,a,o,s,l,c,f,d,h,p,g,y){var E=new v.a;o&&o!==i&&(e(t,null,r,i,a,null,null,l,c,null,null,null,p,null,null),E.actualurl=o),E.tcpid=n,E.type=r,E.url=i,E.range=l,E.trequest=c,E.tresponse=f,E.responsecode=h,E._tfinish=d,E._stream=t,E._mediaduration=p,E._quality=a,E._responseHeaders=g,E._serviceLocation=s,y?y.forEach((function(e){!function(e,t,n,r,i){var a=new v.b;a.s=t,a.d=n,a.b=r,a.t=i,e.trace.push(a),e.interval||(e.interval=0),e.interval+=n}(E,e.s,e.d,e.b,e.t)})):(delete E.interval,delete E.trace),m(t,u.HTTP_REQUEST,E)},addRepresentationSwitch:function(e,t,n,r,i){var a=new Bn;a.t=t,a.mt=n,a.to=r,i?a.lto=i:delete a.lto,m(e,u.TRACK_SWITCH,a)},addBufferLevel:function(e,t,n){var r=new kn;r.t=t,r.level=n,m(e,u.BUFFER_LEVEL,r)},addBufferState:function(e,t,n){var r=new Gn;r.target=n,r.state=t,m(e,u.BUFFER_STATE,r)},addDVRInfo:function(e,t,n,r){var i=new jn;i.time=t,i.range=r,i.manifestInfo=n,m(e,u.DVR_INFO,i)},addDroppedFrames:function(e,t){var n=new Yn,r=p(e).DroppedFrames;t&&(n.time=t.creationTime,n.droppedFrames=t.droppedVideoFrames,r.length>0&&r[r.length-1]==n||m(e,u.DROPPED_FRAMES,n))},addSchedulingInfo:function(e,t,n,r,i,a,o,s,l){var c=new Wn;c.mediaType=e,c.t=t,c.type=n,c.startTime=r,c.availabilityStartTime=i,c.duration=a,c.quality=o,c.range=s,c.state=l,m(e,u.SCHEDULING_INFO,c)},addRequestsQueue:function(e,t,n){var r=new zn;r.loadingRequests=t,r.executedRequests=n,p(e).RequestsQueue=r,h(e,u.REQUESTS_QUEUE,r)},addManifestUpdate:function(e,t,n,r,i,o,s,l,c,f){var d=new Kn;d.mediaType=e,d.type=t,d.requestTime=n,d.fetchTime=r,d.availabilityStartTime=i,d.presentationStartTime=o,d.clientTimeOffset=s,d.currentTime=l,d.buffered=c,d.latency=f,g(a.a.STREAM,u.MANIFEST_UPDATE,d),h(e,u.MANIFEST_UPDATE,d)},updateManifestUpdateInfo:function(e,t){if(e){for(var n in t)e[n]=t[n];d(e.mediaType,u.MANIFEST_UPDATE,e)}},addManifestUpdateStreamInfo:function(e,t,n,r,i){if(e){var a=new qn;a.id=t,a.index=n,a.start=r,a.duration=i,e.streamInfo.push(a),d(e.mediaType,u.MANIFEST_UPDATE_STREAM_INFO,e)}},addManifestUpdateRepresentationInfo:function(e,t,n,r,i,a,o,s){if(e&&e.representationInfo){var l=new Vn;l.id=t,l.index=n,l.streamIndex=r,l.mediaType=i,l.startNumber=o,l.fragmentInfoType=s,l.presentationTimeOffset=a,e.representationInfo.push(l),d(e.mediaType,u.MANIFEST_UPDATE_TRACK_INFO,e)}},addPlayList:function(e){e.trace&&Array.isArray(e.trace)?e.trace.forEach((function(e){e.hasOwnProperty("subreplevel")&&!e.subreplevel&&delete e.subreplevel})):delete e.trace,m(a.a.STREAM,u.PLAY_LIST,e)},addDVBErrors:function(e){m(a.a.STREAM,u.DVB_ERRORS,e)}},n={},t}Xn.__dashjs_factory_name="MetricsModel";var Qn=f.a.getSingletonFactory(Xn),$n=n(14);function Zn(e){e=e||{};var t,n,r,i,o=this.context,s=e.metricsModel;function l(e){var t=s.getMetricsFor(e,!0);if(!t)return null;var n,r=t.HttpList,i=null;if(!r||r.length<=0)return null;for(n=r.length-1;n>=0;){if(r[n].responsecode){i=r[n];break}n--}return i}function c(e){var t=s.getMetricsFor(e,!0);return t&&t.HttpList?t.HttpList:[]}function f(e,t){if(!e)return null;var n=e[t];return n&&0!==n.length?n[n.length-1]:null}return t={getCurrentRepresentationSwitch:function(e){return f(s.getMetricsFor(e,!0),u.TRACK_SWITCH)},getCurrentBufferState:function(e){return f(s.getMetricsFor(e,!0),u.BUFFER_STATE)},getCurrentBufferLevel:function(e){var t=f(s.getMetricsFor(e,!0),u.BUFFER_LEVEL);return t?xn.round10(t.level/1e3,-3):0},getCurrentHttpRequest:l,getHttpRequests:c,getCurrentDroppedFrames:function(){return f(s.getMetricsFor(a.a.VIDEO,!0),u.DROPPED_FRAMES)},getCurrentSchedulingInfo:function(e){return f(s.getMetricsFor(e,!0),u.SCHEDULING_INFO)},getCurrentDVRInfo:function(e){return f(e?s.getMetricsFor(e,!0):s.getMetricsFor(a.a.VIDEO,!0)||s.getMetricsFor(a.a.AUDIO,!0),u.DVR_INFO)},getCurrentManifestUpdate:function(){return f(s.getMetricsFor(a.a.STREAM),u.MANIFEST_UPDATE)},getLatestFragmentRequestHeaderValueByID:function(e,t){if(!t)return null;var n={},r=l(e);r&&(n=$n.a.parseHttpHeaders(r._responseHeaders));var i=n[t.toLowerCase()];return void 0===i?null:i},getLatestMPDRequestHeaderValueByID:function(e){if(!e)return null;var t,n,r,i={};for(r=(t=c(a.a.STREAM)).length-1;r>=0;r--)if((n=t[r]).type===v.a.MPD_TYPE){i=$n.a.parseHttpHeaders(n._responseHeaders);break}var o=i[e.toLowerCase()];return void 0===o?null:o},addRepresentationSwitch:function(e,t,n,r,i){s.addRepresentationSwitch(e,t,n,r,i)},addDVRInfo:function(e,t,n,r){s.addDVRInfo(e,t,n,r)},updateManifestUpdateInfo:function(e){var t=this.getCurrentManifestUpdate();s.updateManifestUpdateInfo(t,e)},addManifestUpdateStreamInfo:function(e){if(e){var t=this.getCurrentManifestUpdate();s.addManifestUpdateStreamInfo(t,e.id,e.index,e.start,e.duration)}},addManifestUpdateRepresentationInfo:function(e,t){if(e){var n=this.getCurrentManifestUpdate();s.addManifestUpdateRepresentationInfo(n,e.id,e.index,e.streamIndex,t,e.presentationTimeOffset,e.startNumber,e.fragmentInfoType)}},addManifestUpdate:function(e){s.addManifestUpdate(a.a.STREAM,e.type,e.requestStartDate,e.requestEndDate)},addHttpRequest:function(e,t,n,r,i){s.addHttpRequest(e.mediaType,null,e.type,e.url,e.quality,t,e.serviceLocation||null,e.range||null,e.requestStartDate,e.firstByteDate,e.requestEndDate,n,e.duration,r,i)},addSchedulingInfo:function(e,t){s.addSchedulingInfo(e.mediaType,new Date,e.type,e.startTime,e.availabilityStartTime,e.duration,e.quality,e.range,t)},addRequestsQueue:function(e,t,n){s.addRequestsQueue(e,t,n)},addBufferLevel:function(e,t,n){s.addBufferLevel(e,t,n)},addBufferState:function(e,t,n){s.addBufferState(e,t,n)},addDroppedFrames:function(e){s.addDroppedFrames(a.a.VIDEO,e)},addPlayList:function(){i&&(s.addPlayList(i),i=null)},addDVBErrors:function(e){s.addDVBErrors(e)},createPlaylistMetrics:function(e,t){(i=new B).start=new Date,i.mstart=e,i.starttype=t},createPlaylistTraceMetrics:function(e,t,i){!0===n&&(n=!1,(r=new k).representationid=e,r.start=new Date,r.mstart=t,r.playbackspeed=null!==i?i.toString():null)},updatePlayListTraceMetrics:function(e){if(r)for(var t in r)r[t]=e[t]},pushPlayListTraceMetrics:function(e,t){if(!1===n&&i&&r&&r.start){var a=r.start,o=e.getTime()-a.getTime();r.duration=o,r.stopreason=t,i.trace.push(r),n=!0}},clearAllCurrentMetrics:function(){s.clearAllCurrentMetrics()}},s=s||Qn(o).getInstance({settings:e.settings}),n=!0,r=null,i=null,t}Zn.__dashjs_factory_name="DashMetrics";var Jn=f.a.getSingletonFactory(Zn);function er(){var e,t,n,r,i=this.context,s=Object(l.a)(i).getInstance(),u=Object(_.a)(i).getInstance();function f(e){r=e}function d(e,t,n,r){var i,a=t.adaptation.period.mpd,o=a.availabilityStartTime;if(r)i=n&&a.timeShiftBufferDepth!==Number.POSITIVE_INFINITY?new Date(o.getTime()+1e3*(e+a.timeShiftBufferDepth)):a.availabilityEndTime;else if(n){var s=t.availabilityTimeOffset;i=new Date(o.getTime()+1e3*(e-s))}else i=o;return i}function p(e,t){return(e.getTime()-t.mpd.availabilityStartTime.getTime()+1e3*r)/1e3}function g(e,t){return e+(t.adaptation.period.start-t.presentationTimeOffset)}function m(e){var n={start:NaN,end:NaN},r=e[0].getAdapter().getRegularPeriods()[0],i=p(new Date,r);if(!e||0===e.length)return{range:n,now:i};e.forEach((function(e){var r=e.getAdapter(),s=r.getMediaInfoForType(e.getStreamInfo(),a.a.VIDEO)||r.getMediaInfoForType(e.getStreamInfo(),a.a.AUDIO),u=r.getVoRepresentations(s)[0],l={start:NaN,end:NaN};if(u)if(u.segmentInfoType===o.a.SEGMENT_TIMELINE)l=function(e){var n,r,i,a,o=e.adaptation.period.mpd.manifest.Period_asArray[e.adaptation.period.index].AdaptationSet_asArray[e.adaptation.index],s=t.getRepresentationFor(e.index,o),u=s.SegmentTemplate.SegmentTimeline,l=s.SegmentTemplate.timescale,c=u.S_asArray,f={start:0,end:0},d=0;for(f.start=g(c[0].t/l,e),i=0,a=c.length;il.start)&&(n.start=l.start),!isNaN(l.end)&&(isNaN(n.end)||n.end2&&void 0!==arguments[2]&&arguments[2];try{for(var r=0,i=!1,a=NaN;!i&&r=t)?(a=t,i=!0):!n&&o.start>t&&(isNaN(a)||o.starta)&&(a=o.start+o.duration),r+=1}return a}catch(e){return t}}function v(e){void 0===e.offset||isNaN(e.offset)||f(e.offset/1e3)}function T(){r=0,n=0}function S(){s.off(c.a.UPDATE_TIME_SYNC_OFFSET,v,this),T()}return e={initialize:function(){T(),s.on(c.a.UPDATE_TIME_SYNC_OFFSET,v,this)},getClientTimeOffset:function(){return r},setClientTimeOffset:f,getClientReferenceTime:function(){return Date.now()-1e3*n+1e3*r},calcAvailabilityStartTimeFromPresentationTime:function(e,t,n){return d(e,t,n)},calcAvailabilityEndTimeFromPresentationTime:function(e,t,n){return d(e,t,n,!0)},calcPresentationTimeFromWallTime:p,calcPresentationTimeFromMediaTime:g,calcPeriodRelativeTimeFromMpdRelativeTime:function(e,t){return t-e.adaptation.period.start},calcMediaTimeFromPresentationTime:function(e,t){return e-t.adaptation.period.start+t.presentationTimeOffset},calcWallTimeForSegment:function(e,t){var n,r,i;return t&&(n=e.representation.adaptation.period.mpd.suggestedPresentationDelay,r=e.presentationStartTime+n,i=new Date(e.availabilityStartTime.getTime()+1e3*r)),i},calcTimeShiftBufferWindow:function(e,t){if(!t)return function(e){var t={start:NaN,end:NaN},n=0,r=NaN;return e.forEach((function(e){var t=e.getStreamInfo();n+=t.duration,(isNaN(r)||t.start0&&(g.spans.push({name:m,line:T,row:c}),T="");var N="style_cea608_"+R.foreground+"_"+R.background;R.underline&&(N+="_underline"),R.italics&&(N+="_italics"),E.hasOwnProperty(N)||(E[N]=JSON.parse(JSON.stringify(R))),S=R,m=N}T+=I.uchar}T.trim().length>0&&g.spans.push({name:m,line:T,row:c}),h=!0,p=A}else h=!1,p=-1,d&&(d.p.push(g),g={start:s,end:u,spans:[]},d.y2=c,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null)}d&&(d.p.push(g),d.y2=c+1,d.name="region_"+d.x+"_"+d.y1+"_"+d.y2,!1===y.hasOwnProperty(d.name)?(_.push(d),y[d.name]=d):y[d.name].p.contat(d.p),d=null);var w=[];for(c=0;c<_.length;++c){var C=_[c],D="sub_cea608_"+e++,O=document.createElement("div");O.id=D;var M=n(C);O.style.cssText="position: absolute; margin: 0; display: flex; box-sizing: border-box; pointer-events: none;"+M;var P=document.createElement("div");P.className="paragraph bodyStyle",P.style.cssText=i(r);var L=document.createElement("div");L.className="cueUniWrapper",L.style.cssText="unicode-bidi: normal; direction: ltr;";for(var F=0;F0){if(0!==f&&U!=B.row){var k=document.createElement("br");k.className="lineBreak",L.appendChild(k)}var G=!1;U===B.row&&(G=!0),U=B.row;var j=E[B.name],Y=document.createElement("span");Y.className="spanPadding "+B.name+" customSpanColor",Y.style.cssText=i(r,j),0!==f&&G?f===x.spans.length-1?Y.textContent=o(B.line):Y.textContent=B.line:x.spans.length>1&&f1&&e.isEmbedded?t=e.id&&e.id===a.a.CC1:1===_.length?e.id&&"string"==typeof e.id&&"CC"===e.id.substring(0,2)&&(t=!0):0===_.length&&(t=e.index===s[0].index);return t}(e),t.isFragmented=e.isFragmented,t.isEmbedded=!!e.isEmbedded,t.isTTML=function(e){return e.codec&&e.codec.search(a.a.STPP)>=0||e.mimeType&&e.mimeType.search(a.a.TTML)>=0}(e),t.kind=function(e,t){var n=e.roles&&e.roles.length>0?t[e.roles[0]]:t.caption;return n=n===t.caption||n===t.subtitle?n:t.caption}(e,{subtitle:"subtitles",caption:"captions"}),C.addTextTrack(t)}function k(e){var t=e.chunk;t.mediaInfo.embeddedCaptions&&j(t.bytes,t)}function G(e){m=e}function j(e,s){var l=s.mediaInfo,c=l.type,d=l.mimeType,p=l.codec||d;p?-1!==l.codec.indexOf("application/mp4")?function(e,i,s){var l,c;if("InitializationSegment"===i.segmentType)f=!0,h=r.getMediaTimescaleFromMoov(e);else{if(!f)return;c=r.getSamplesInfo(e),(l=c.sampleList).length>0&&(g=l[0].cts-i.start*h),s.search(a.a.STPP)>=0?function(e,r,i){var s,l;for(o=null!==o?o:K(i),s=0;s0&&C.addCaptions(m,0,s)}(e,l)}}(e,s,p):c===a.a.VIDEO?function(e,t){var a,o;if(t.segmentType===v.a.INIT_SEGMENT_TYPE)0===T&&(T=r.getMediaTimescaleFromMoov(e));else if(t.segmentType===v.a.MEDIA_SEGMENT_TYPE){if(0===T)return void n.warn("CEA-608: No timescale for embeddedTextTrack yet");var s=(o=r.getSamplesInfo(e)).lastSequenceNumber;if(A[0]||A[1]||function(){for(var e,t=0;t<_.length;t++){if(-1===(e=C.getTrackIdxForId(_[t].id)))return void n.warn("CEA-608: data before track is ready.");var r=Y(e);A[t]=new i.a.Cea608Parser(t+1,{newCue:r},null)}}(),T){if(null!==S&&s!==S+o.numSequences)for(a=0;a0){o.cts!==u?l=0:l+=1;var h=H();n.fields[d].push([o.cts+h*T,f[d],l]),u=o.cts}return n.fields.forEach((function(e){e.sort((function(e,t){return e[0]===t[0]?e[2]-t[2]:e[0]-t[0]}))})),n}(e,o.sampleList),l=0;l=0?t=D:(e.search(a.a.TTML)>=0||e.search(a.a.STPP)>=0)&&(t=O),t}function q(e){_.forEach((function(t){var n=C.getTrackIdxForId(t.id);n>=0&&C.deleteCuesFromTrackIdx(n,e.from,e.to)}))}return t={initialize:function(){F||(_=[],m=null,T=0,A=[],S=null,F=!0,b=pr(P).getInstance(),L.on(c.a.VIDEO_CHUNK_RECEIVED,k,t),L.on(c.a.BUFFER_CLEARED,q,t))},addMediaInfos:function(e,n,r){if(s=s.concat(n),e===a.a.TEXT&&n[0].isFragmented&&!n[0].isEmbedded){u=r,t.buffered=Object(dr.a)(P).create(),p=N.getTracksFor(a.a.TEXT,M.id).filter((function(e){return e.isFragmented}));for(var i=N.getCurrentTrackFor(a.a.TEXT,M.id),o=0;on/r?o=(s=t)/r*n:s=(o=e)/n*r;var u,l,c=0,f=0;return o/s>i?(f=s,c=s*i):(c=o,f=o/i),u=(e-c)/2,l=(t-f)/2,a?{x:u+.1*c,y:l+.1*f,w:.8*c,h:.8*f}:{x:u,y:l,w:c,h:f}}function w(e,t){var n=I.getClientWidth(),r=I.getClientHeight(),i=I.getVideoWidth(),a=I.getVideoHeight(),o=I.getVideoRelativeOffsetTop(),s=I.getVideoRelativeOffsetLeft();if(0!==i&&0!==a){var l=i/a,c=!1;e.isFromCEA608&&(l=3.5/3,c=!0);var d=N.call(this,n,r,i,a,l,c),y=d.w,v=d.h,S=d.x,A=d.y;if(y!=p||v!=g||S!=u||A!=f||t){if(u=S+s,f=A+o,p=y,g=v,m){var R=m.style;R&&(R.left=u+"px",R.top=f+"px",R.width=p+"px",R.height=g+"px",R.zIndex=E&&document[E]||_?T:null,b.trigger(h.a.CAPTION_CONTAINER_RESIZE))}var w=e.activeCues;if(w)for(var C=w.length,D=0;D=0&&i[e]?I.getTextTrack(i[e].kind,i[e].id,i[e].lang,i[e].isTTML,i[e].isEmbedded):null}function P(e){var t=this;if(e!==s){var n=M(s=e);L.call(this,n),y&&(clearInterval(y),y=null),n&&"html"===n.renderingType&&(w.call(this,n,!0),window.ResizeObserver?(S=new window.ResizeObserver((function(){w.call(t,n,!0)}))).observe(I.getElement()):y=setInterval(w.bind(this,n),500))}}function L(e){G.call(this),e&&"html"===e.renderingType?B.call(this):k.call(this)}function F(e,t){if(!e.cues)return!1;for(var n=0;n=t)&&(isNaN(n)||e.endTime<=n)}function U(e,t,n){if(e.cues)for(var r=e.cues,i=r.length-1;i>=0;i--)x(r[i],t,n)&&(r[i].onexit&&r[i].onexit(),e.removeCue(r[i]))}function B(){var e=document.getElementById("native-cue-style");if(!e){(e=document.createElement("style")).id="native-cue-style",document.head.appendChild(e);var t=e.sheet,r=I.getElement();try{r&&(r.id?t.insertRule("#"+r.id+"::cue {background: transparent}",0):0!==r.classList.length?t.insertRule("."+r.className+"::cue {background: transparent}",0):t.insertRule("video::cue {background: transparent}",0))}catch(e){n.info(""+e.message)}}}function k(){var e=document.getElementById("native-cue-style");e&&document.head.removeChild(e)}function G(){if(m)for(;m.firstChild;)m.removeChild(m.firstChild)}return t={initialize:function(){"undefined"!=typeof window&&"undefined"!=typeof navigator&&(r=window.VTTCue||window.TextTrackCue,i=[],o=[],s=-1,u=0,f=0,p=0,g=0,m=null,y=null,_=!1,T=2147483647,v=null,void 0!==document.fullscreenElement?E="fullscreenElement":void 0!==document.webkitIsFullScreen?E="webkitIsFullScreen":document.msFullscreenElement?E="msFullscreenElement":document.mozFullScreen&&(E="mozFullScreen"))},getStreamId:function(){return R.id},addTextTrack:function(e){i.push(e)},addCaptions:O,createTracks:function(){i.sort((function(e,t){return e.index-t.index})),m=I.getTTMLRenderingDiv();for(var e,t,n,r,u,l,f=-1,d=0;d=0){b.on(h.a.PLAYBACK_METADATA_LOADED,(function e(){var t=M(f);t&&w.call(this,t,!0),b.off(h.a.PLAYBACK_METADATA_LOADED,e,this)}),this);for(var y=0;y1){var n=e.split(/:/)[1];n&&-1!=n.search(/%/)&&(n=parseInt(n.replace(/%/,""),10)),(e.match(/align/)||e.match(/A/))&&(t.align=n),(e.match(/line/)||e.match(/L/))&&(t.line=n),(e.match(/position/)||e.match(/P/))&&(t.position=n),(e.match(/size/)||e.match(/S/))&&(t.size=n)}})),t}function c(e,t){for(var n,i=t,a="",o="";""!==e[i]&&i1)for(var s=0;s0&&"WEBVTT"!==d&&d.match(r)){var h=u(d),p=h.cuePoints,g=h.styles,m=c(e,f+1),y=s(p[0].replace(i,"")),E=s(p[1].replace(i,""));!isNaN(y)&&!isNaN(E)&&y>=o&&E>y?""!==m?(o=y,l.push({start:y,end:E,data:m,styles:g})):t.error("Skipping cue due to empty/malformed cue text"):t.error("Skipping cue due to incorrect cue timing")}}return l}},t=Object(d.a)(o).getInstance().getLogger(e),n=/(?:\r\n|\r|\n)/gm,r=/-->/,i=/(^[\s]+|[\s]+$)/g,a=/\s\b/g,e}vr.__dashjs_factory_name="VTTParser";var Tr=f.a.getSingletonFactory(vr);function Sr(){var e,t,n=this.context,r=Object(l.a)(n).getInstance(),i=0;return e={parse:function(e,n,a,o,s){var u,l,f,d="",p=[],g={},m={},y="",E="",_={onOpenTag:function(e,n,i){if(i[" imagetype"]&&!i[" imageType"]&&(r.trigger(h.a.CONFORMANCE_VIOLATION,{level:pe.LEVELS.ERROR,event:pe.EVENTS.NON_COMPLIANT_SMPTE_IMAGE_ATTRIBUTE}),i[" imageType"]=i[" imagetype"]),"image"===n&&("http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt"===e||"http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"===e)){if(!i[" imageType"]||"PNG"!==i[" imageType"].value)return void t.warn("smpte-tt imageType != PNG. Discarded");y=i["http://www.w3.org/XML/1998/namespace id"].value}},onCloseTag:function(){y&&(m[y]=E.trim()),E="",y=""},onText:function(e){y&&(E+=e)}};if(!e)throw d="no ttml data to parse",new Error(d);g.data=e,r.trigger(c.a.TTML_TO_PARSE,g);var v=Object(yr.fromXML)(g.data,(function(e){d=e}),_);r.trigger(c.a.TTML_PARSED,{ttmlString:g.data,ttmlDoc:v});var T,S=v.getMediaTimeEvents();for(f=0;fo?o:S[f+1]+n)&&p.push({start:u,end:l,type:"html",cueID:(T=void 0,T="cue_TTML_"+i,i++,T),isd:A,images:s,embeddedImages:m})}if(""!==d)throw t.error(d),new Error(d);return p}},t=Object(d.a)(n).getInstance().getLogger(e),e}Sr.__dashjs_factory_name="TTMLParser";var Ar=f.a.getSingletonFactory(Sr);function br(e){var t,n,r,i,o,s,u,f,d,p,g,m,y,E=this.context,_=e.adapter,v=e.errHandler,T=e.manifestModel,S=e.mediaController,A=e.videoModel,b=e.settings;function I(e){var t=e.tracks,r=e.index,i=e.streamId;!1===b.get().streaming.text.defaultEnabled&&!N()||y?w(i,-1):(f&&t.some((function(e,t){if(S.matchSettings(f,e))return w(i,t),r=t,!0})),p=!1),n[i].lastEnabledIndex=r,u.trigger(h.a.TEXT_TRACKS_ADDED,{enabled:N(),index:r,tracks:t,streamId:i}),m=!0}function R(e){if(!d&&e&&e.newMediaInfo){var t=e.newMediaInfo;t.type===a.a.TEXT&&(f={lang:t.lang,role:t.roles[0],index:t.index,codec:t.codec,accessibility:t.accessibility[0]})}}function N(){var e=!0;return p&&!g&&(e=!1),e}function w(e,t){(p=-1===t)&&S&&S.saveTextSettingsDisabled();var n=C(e);if(n!==t&&i[e]){i[e].setModeForTrackIdx(n,a.a.TEXT_HIDDEN),i[e].setCurrentTrackIdx(t),i[e].setModeForTrackIdx(t,a.a.TEXT_SHOWING);var o=i[e].getCurrentTrackInfo();o&&o.isFragmented&&!o.isEmbedded?function(e,t,n){if(!r[e])return;for(var o=r[e].getConfig().fragmentedTracks,s=0;s3&&void 0!==arguments[3]?arguments[3]:null,a=e.id;r[a]&&r[a].addMediaInfos(t,n,i)},reset:function(){D(),u.off(c.a.CURRENT_TRACK_CHANGED,R,t),u.off(c.a.TEXT_TRACKS_QUEUE_INITIALIZED,I,t),Object.keys(r).forEach((function(e){r[e].resetEmbedded(),r[e].reset()}))}},f=null,g=!1,m=!1,d=!1,y=!1,o=Tr(E).getInstance(),s=Ar(E).getInstance(),u=Object(l.a)(E).getInstance(),D(),t}br.__dashjs_factory_name="TextController";var Ir=f.a.getClassFactory(br);function Rr(){var e,t,n,r,s,p,m,T,S,A,b,I,R,N,w,C,D,O,P,U,B,k,G,j,Y,H,K,q,V,W,z,X,Q,$,Z,J,ee="You must first call initialize() and set a source before calling this method",te="You must first call initialize() and set a valid source and view before calling this method",ne="You must first call attachView() to set the video element before calling this method",re=this.context,ie=Object(l.a)(re).getInstance(),oe=Object(_.a)(re).getInstance(),se=Object(d.a)(re).getInstance({settings:oe});function ue(){Ie(null),Te(null),r=null,R&&(R.reset(),R=null),N&&(N.reset(),N=null),oe.reset(),C&&(C.reset(),C=null)}function le(){return!!n&&!!W.getElement()}function ce(){return Object(fn.a)()}function fe(){if(!m)throw te;return H.isPaused()}function de(e){var t=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,n=K.getCurrentDVRInfo(t);if(!n)return 0;var r=H.getLiveDelay(),i=n.range.start+e;return i>n.range.end-r&&(i=n.range.end-r),i}function he(e){if(!m)throw te;var t=_e().currentTime;if(void 0!==e)t=G.getTimeRelativeToStreamId(t,e);else if(H.getIsDynamic()){var n=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,r=K.getCurrentDVRInfo(n);t=null===r||0===t?0:Math.max(0,t-r.range.start)}return t}function pe(){if(!m)throw te;var e=_e().duration;if(H.getIsDynamic()){var t=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,n=K.getCurrentDVRInfo(t);e=n?n.range.end-n.range.start:0}return e}function ge(e){Object(M.b)(e,"boolean"),T=e}function me(){O.restoreDefaultUTCTimingSources()}function ye(){return K}function _e(){if(!W.getElement())throw ne;return W.getElement()}function Te(e){if(!s)throw"MediaPlayer not initialized!";W.setElement(e),e&&(Ce(),function(){if(N)return;var e=dashjs.MetricsReporting;if("function"==typeof e){var t=e(re).create();N=t.createMetricsReporting({debug:se,eventBus:ie,mediaElement:_e(),adapter:D,dashMetrics:K,events:c.a,constants:a.a,metricsConstants:u})}}(),function(){if(w)return;var e=dashjs.MssHandler;"function"==typeof e&&(E.a.extend(e.errors),w=e(re).create({eventBus:ie,mediaPlayerModel:O,dashMetrics:K,manifestModel:q,playbackController:H,streamController:G,protectionController:R,baseURLController:U,errHandler:P,events:c.a,constants:a.a,debug:se,initSegmentType:v.a.INIT_SEGMENT_TYPE,BASE64:rr.a,ISOBoxer:ar.a,settings:oe}))}(),G&&G.switchToVideoElement()),m&&Ne(),Me()}function Se(e){if(!p)throw ee;var t=G.getActiveStreamInfo();return t?I.getTracksFor(e,t.id):[]}function be(e,t){var n=-1;e.some((function(e,r){if(e===t)return n=r,!0})),n<0||e.splice(n,1)}function Ie(e){if(!s)throw"MediaPlayer not initialized!";"string"==typeof e&&z.initialize(e),n=e,(p||m)&&Ne(),le()&&Me()}function Re(){if(!p)throw ee;var e=G.getActiveStreamInfo();return e?G.getStreamById(e.id):null}function Ne(){m=!1,p=!1,D.reset(),G.reset(),Y.reset(),H.reset(),S.reset(),I.reset(),Q.reset(),R&&(oe.get().streaming.protection.keepProtectionMediaKeys?R.stop():(R.reset(),R=null,Ce())),j.reset(),V.reset()}function we(){return Ze(re).create({debug:se,errHandler:P,dashMetrics:K,mediaPlayerModel:O,requestModifier:Object(L.a)(re).getInstance(),mssHandler:w,settings:oe})}function Ce(){if(R)return R;var e=dashjs.Protection;if("function"==typeof e){var t=e(re).create();return c.a.extend(e.events),h.a.extend(e.events,{publicOnly:!0}),E.a.extend(e.errors),B||(B=Object(tt.a)(re).getInstance()),(R=t.createProtectionSystem({debug:se,errHandler:P,videoModel:W,capabilities:B,eventBus:ie,events:c.a,BASE64:rr.a,constants:a.a,cmcdModel:V,settings:oe}))&&(R.setLicenseRequestFilters($),R.setLicenseResponseFilters(Z)),R}return null}function De(){if(!s)throw"MediaPlayer not initialized!";if(C)return C;var e=dashjs.OfflineController;if("function"==typeof e){c.a.extend(e.events),h.a.extend(e.events,{publicOnly:!0}),E.a.extend(e.errors);var t=we(),n=ae(re).create();return n.setConfig({manifestModel:q,adapter:D,manifestLoader:t,errHandler:P}),C=e(re).create({debug:se,manifestUpdater:n,baseURLController:U,manifestLoader:t,manifestModel:q,mediaPlayerModel:O,abrController:S,playbackController:H,adapter:D,errHandler:P,dashMetrics:K,timelineConverter:b,segmentBaseController:Q,schemeLoaderFactory:A,eventBus:ie,events:c.a,errors:E.a,constants:a.a,settings:oe,dashConstants:o.a,urlUtils:Object(F.a)(re).getInstance()})}return null}function Oe(e){var t=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,n=K.getCurrentDVRInfo(t);return n?e+(n.manifestInfo.availableFrom.getTime()/1e3+n.range.start):0}function Me(){var e;C&&C.resetRecords(),!p&&n&&(p=!0,t.info("Streaming Initialized"),e=we(),G||(G=Ee(re).getInstance()),j||(j=Ir(re).create({errHandler:P,manifestModel:q,adapter:D,mediaController:I,videoModel:W,settings:oe})),k.setConfig({capabilities:B,adapter:D,settings:oe,manifestModel:q,errHandler:P}),k.setCustomCapabilitiesFilters(J),G.setConfig({capabilities:B,capabilitiesFilter:k,manifestLoader:e,manifestModel:q,mediaPlayerModel:O,protectionController:R,textController:j,adapter:D,dashMetrics:K,errHandler:P,timelineConverter:b,videoModel:W,playbackController:H,abrController:S,mediaController:I,settings:oe,baseURLController:U,uriFragmentModel:z,segmentBaseController:Q}),Y.setConfig({settings:oe,playbackController:H,streamController:G,videoModel:W,timelineConverter:b,adapter:D}),H.setConfig({streamController:G,dashMetrics:K,mediaPlayerModel:O,adapter:D,videoModel:W,timelineConverter:b,settings:oe}),S.setConfig({streamController:G,domStorage:X,mediaPlayerModel:O,dashMetrics:K,adapter:D,videoModel:W,settings:oe}),V.setConfig({abrController:S,dashMetrics:K,playbackController:H}),S.initialize(),G.initialize(T,r),j.initialize(),Y.initialize(),V.initialize(),Q.initialize(),"string"==typeof n?G.load(n):G.loadWithManifest(n)),!m&&le()&&(m=!0,t.info("Playback Initialized"))}return e={initialize:function(e,n,r){B||(B=Object(tt.a)(re).getInstance()).setConfig({settings:oe}),P||(P=et(re).getInstance()),B.supportsMediaSource()?(s||(s=!0,b=tr(re).getInstance(),S||(S=tn(re).getInstance()).setConfig({settings:oe}),A||(A=Object(nn.a)(re).getInstance()),H||(H=g(re).getInstance()),I||(I=Ae(re).getInstance()),G||(G=Ee(re).getInstance()),Y||(Y=ve(re).getInstance()),k||(k=rt(re).getInstance()),D=Ln(re).getInstance(),q=ut(re).getInstance(),V=Object(sn.a)(re).getInstance(),K=Jn(re).getInstance({settings:oe}),X=cn(re).getInstance({settings:oe}),D.setConfig({constants:a.a,cea608parser:i.a,errHandler:P,BASE64:rr.a}),U||(U=xe(re).create()),U.setConfig({adapter:D}),Q||(Q=vn(re).getInstance({dashMetrics:K,mediaPlayerModel:O,errHandler:P,baseURLController:U,events:c.a,eventBus:ie,debug:se,boxParser:Object(x.a)(re).getInstance(),requestModifier:Object(L.a)(re).getInstance(),errors:E.a})),I.setConfig({domStorage:X,settings:oe}),me(),ge(void 0===r||r),De()),e&&Te(e),n&&Ie(n),t.info("[dash.js "+ce()+"] MediaPlayer has been initialized")):P.error(new y.a(E.a.CAPABILITY_MEDIASOURCE_ERROR_CODE,E.a.CAPABILITY_MEDIASOURCE_ERROR_MESSAGE))},setConfig:function(e){e&&(e.capabilities&&(B=e.capabilities),e.capabilitiesFilter&&(k=e.capabilitiesFilter),e.streamController&&(G=e.streamController),e.textController&&(j=e.textController),e.gapController&&(Y=e.gapController),e.playbackController&&(H=e.playbackController),e.mediaPlayerModel&&(O=e.mediaPlayerModel),e.abrController&&(S=e.abrController),e.schemeLoaderFactory&&(A=e.schemeLoaderFactory),e.mediaController&&(I=e.mediaController),e.settings&&(oe=e.settings))},on:function(e,t,n,r){ie.on(e,t,n,r)},off:function(e,t,n){ie.off(e,t,n)},extend:function(e,t,n){f.a.extend(e,t,n,re)},attachView:Te,attachSource:Ie,isReady:le,play:function(){if(!m)throw te;(!T||fe()&&m)&&H.play()},isPaused:fe,pause:function(){if(!m)throw te;H.pause()},isSeeking:function(){if(!m)throw te;return H.isSeeking()},isDynamic:function(){if(!m)throw te;return H.getIsDynamic()},seek:function(e){if(!m)throw te;if(Object(M.b)(e,"number"),isNaN(e))throw a.a.BAD_ARGUMENT_ERROR;var t=H.getIsDynamic()?de(e):e;H.seek(t)},setPlaybackRate:function(e){_e().playbackRate=e},getPlaybackRate:function(){return _e().playbackRate},setMute:function(e){Object(M.b)(e,"boolean"),_e().muted=e},isMuted:function(){return _e().muted},setVolume:function(e){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw a.a.BAD_ARGUMENT_ERROR;_e().volume=e},getVolume:function(){return _e().volume},time:he,duration:pe,timeAsUTC:function(){if(!m)throw te;return he()<0?NaN:Oe(he())},durationAsUTC:function(){if(!m)throw te;return Oe(pe())},getActiveStream:Re,getDVRWindowSize:function(){var e=G&&G.hasVideoTrack()?a.a.VIDEO:a.a.AUDIO,t=K.getCurrentDVRInfo(e);return t?t.manifestInfo.dvrWindowSize:0},getDVRSeekOffset:de,convertToTimeCode:function(e){e=Math.max(e,0);var t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%3600%60);return(0===t?"":t<10?"0"+t.toString()+":":t.toString()+":")+(n<10?"0"+n.toString():n.toString())+":"+(r<10?"0"+r.toString():r.toString())},formatUTC:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=new Date(1e3*e),a=i.toLocaleDateString(t),o=i.toLocaleTimeString(t,{hour12:n});return r?o+" "+a:o},getVersion:ce,getDebug:function(){return se},getBufferLength:function(e){var n=[a.a.VIDEO,a.a.AUDIO,a.a.TEXT];if(e){if(-1!==n.indexOf(e)){var r=ye().getCurrentBufferLevel(e);return r||NaN}return t.warn("getBufferLength requested for invalid type"),NaN}var i=n.map((function(e){return Se(e).length>0?ye().getCurrentBufferLevel(e):Number.MAX_VALUE})).reduce((function(e,t){return Math.min(e,t)}));return i===Number.MAX_VALUE?NaN:i},getTTMLRenderingDiv:function(){return W?W.getTTMLRenderingDiv():null},getVideoElement:_e,getSource:function(){if(!n)throw"You must first call attachSource() with a valid source before calling this method";return n},getCurrentLiveLatency:function(){if(!s)throw"MediaPlayer not initialized!";return m?H.getCurrentLiveLatency():NaN},getTopBitrateInfoFor:function(e){if(!p)throw ee;return S.getTopBitrateInfoFor(e)},setAutoPlay:ge,getAutoPlay:function(){return T},getDashMetrics:ye,getQualityFor:function(e){if(!p)throw ee;if(e===a.a.IMAGE){var t=Re();if(!t)return-1;var n=t.getThumbnailController();return n?n.getCurrentTrackIndex():-1}return S.getQualityFor(e)},setQualityFor:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(!p)throw ee;if(e===a.a.IMAGE){var r=Re();if(!r)return;var i=r.getThumbnailController();i&&i.setTrackByIndex(t)}S.setPlaybackQuality(e,G.getActiveStreamInfo(),t,{forceReplace:n})},updatePortalSize:function(){S.setElementSize(),S.setWindowResizeEventCalled(!0)},enableText:function(e){var t=G.getActiveStreamInfo();return!(!t||!j)&&j.enableText(t.id,e)},enableForcedTextStreaming:function(e){return!(!G.getActiveStreamInfo()||!j)&&j.enableForcedTextStreaming(e)},isTextEnabled:function(){var e=G.getActiveStreamInfo();return!(!e||!j)&&j.isTextEnabled(e)},setTextTrack:function(e){if(!m)throw te;var t=G.getActiveStreamInfo();t&&j&&j.setTextTrack(t.id,e)},getBitrateInfoListFor:function(e){if(!p)throw ee;var t=Re();return t?t.getBitrateListFor(e):[]},getStreamsFromManifest:function(e){if(!p)throw ee;return D.getStreamsInfo(e)},getTracksFor:Se,getTracksForTypeFromManifest:function(e,t,n){if(!p)throw ee;return(n=n||D.getStreamsInfo(t,1)[0])?D.getAllMediaInfoForType(n,e,t):[]},getCurrentTrackFor:function(e){if(!p)throw ee;var t=G.getActiveStreamInfo();return I.getCurrentTrackFor(e,t.id)},setInitialMediaSettingsFor:function(e,t){if(!s)throw"MediaPlayer not initialized!";I.setInitialSettings(e,t)},getInitialMediaSettingsFor:function(e){if(!s)throw"MediaPlayer not initialized!";return I.getInitialSettings(e)},setCurrentTrack:function(e){if(!p)throw ee;I.setTrack(e)},addABRCustomRule:function(e,t,n){O.addABRCustomRule(e,t,n)},removeABRCustomRule:function(e){O.removeABRCustomRule(e)},removeAllABRCustomRule:function(){O.removeABRCustomRule()},getAverageThroughput:function(e){var t=S.getThroughputHistory();return t?t.getAverageThroughput(e):0},retrieveManifest:function(e,t){var n=we(),r=this;ie.on(c.a.INTERNAL_MANIFEST_LOADED,(function e(i){i.error?t(null,i.error):t(i.manifest),ie.off(c.a.INTERNAL_MANIFEST_LOADED,e,r),n.reset()}),r),z.initialize(e),n.load(e)},addUTCTimingSource:function(e,t){O.addUTCTimingSource(e,t)},removeUTCTimingSource:function(e,t){O.removeUTCTimingSource(e,t)},clearDefaultUTCTimingSources:function(){O.clearDefaultUTCTimingSources()},restoreDefaultUTCTimingSources:me,setXHRWithCredentialsForType:function(e,t){O.setXHRWithCredentialsForType(e,t)},getXHRWithCredentialsForType:function(e){return O.getXHRWithCredentialsForType(e)},getProtectionController:function(){return Ce()},attachProtectionController:function(e){R=e},setProtectionData:function(e){r=e,G&&G.setProtectionData(r)},registerLicenseRequestFilter:function(e){$.push(e),R&&R.setLicenseRequestFilters($)},registerLicenseResponseFilter:function(e){Z.push(e),R&&R.setLicenseResponseFilters(Z)},unregisterLicenseRequestFilter:function(e){be($,e),R&&R.setLicenseRequestFilters($)},unregisterLicenseResponseFilter:function(e){be(Z,e),R&&R.setLicenseResponseFilters(Z)},registerCustomCapabilitiesFilter:function(e){J.push(e),k&&k.setCustomCapabilitiesFilters(J)},unregisterCustomCapabilitiesFilter:function(e){be(J,e),k&&k.setCustomCapabilitiesFilters(J)},setCustomInitialTrackSelectionFunction:function(e){I&&I.setCustomInitialTrackSelectionFunction(e)},resetCustomInitialTrackSelectionFunction:function(){I&&I.setCustomInitialTrackSelectionFunction(null)},attachTTMLRenderingDiv:function(e){if(!W.getElement())throw ne;W.setTTMLRenderingDiv(e)},getCurrentTextTrackIndex:function(){var e=G.getActiveStreamInfo();if(e&&j)return j.getCurrentTrackIdx(e.id)},provideThumbnail:function(e,t){if("function"==typeof t)if(e<0)t(null);else{var n=H.getIsDynamic()?de(e):e,r=G.getStreamForTime(n);if(null!==r){var i=r.getThumbnailController();if(i){var a=G.getTimeRelativeToStreamId(n,r.getId());return i.provide(a,t)}t(null)}else t(null)}},getDashAdapter:function(){return D},getOfflineController:function(){return De()},getSettings:function(){return oe.get()},updateSettings:function(e){oe.update(e)},resetSettings:function(){oe.reset()},reset:ue,destroy:function(){ue(),$=[],Z=[],J=[],f.a.deleteSingletonInstances(re)}},t=se.getLogger(e),s=!1,m=!1,p=!1,T=!0,R=null,C=null,r=null,D=null,Q=null,c.a.extend(h.a),O=Kt(re).getInstance(),W=on(re).getInstance(),z=ot(re).getInstance(),$=[],Z=[],J=[],e}Rr.__dashjs_factory_name="MediaPlayer";var Nr=f.a.getClassFactory(Rr);Nr.events=h.a,Nr.errors=E.a,f.a.updateClassFactory(Rr.__dashjs_factory_name,Nr);t.a=Nr},function(e,t,n){"use strict";n.d(t,"a",(function(){return r}));function r(){return"4.1.0"}},function(e,t,n){var r,i,o,u,l,c={encode:function(e){for(var t=[],n=0;n>6),t.push(128|63&r)):r<65536?(t.push(224|r>>12),t.push(128|63&r>>6),t.push(128|63&r)):(t.push(240|r>>18),t.push(128|63&r>>12),t.push(128|63&r>>6),t.push(128|63&r))}return t},decode:function(e){for(var t=[],n=0;n>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push(r.charAt(63&a))}return 2==e.length-t?(a=(e[t]<<16)+(e[t+1]<<8),n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push(r.charAt(63&a>>6)),n.push("=")):1==e.length-t&&(a=e[t]<<16,n.push(r.charAt(63&a>>18)),n.push(r.charAt(63&a>>12)),n.push("==")),n.join("")},o=function(){for(var e=[],t=0;t0&&(e.segments=u);return e}(e,n[1])),(r=e).mediaFinishedInformation=E.getMediaFinishedInformation(r),function(e){if(!S())return;var t,n=d.getCurrentManifestUpdate(),r=!1;if(n){for(var i=0;i=s.length?null:s[e]}function w(e){i=!1,l.trigger(c.DATA_UPDATE_COMPLETED,{data:n,currentRepresentation:u,error:e},{streamId:m.id,mediaType:g})}function C(e){u=e}function D(e){if(e.newDuration){var t=A();if(t&&t.adaptation.period)t.adaptation.period.duration=e.newDuration}}return t={getStreamId:function(){return m.id},getType:v,getData:function(){return n},isUpdating:S,updateData:function(e,t,a,o,u){if(T(),i=!0,s=t,C(N(u)),n=e,a!==r.a.VIDEO&&a!==r.a.AUDIO&&(a!==r.a.TEXT||!o))return w(),Promise.resolve();for(var l=[],c=0,f=s.length;c=0}return!1}),(function(e){return String(e)}))}return n}(l),E=n(1);function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=A(e);if(t){var i=A(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return S(this,n)}}function S(e,t){return!t||"object"!==_(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var b=/^([-])?P(([\d.]*)Y)?(([\d.]*)M)?(([\d.]*)D)?T?(([\d.]*)H)?(([\d.]*)M)?(([\d.]*)S)?/,I=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}(n,e);var t=T(n);function n(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),t.call(this,(function(e){for(var t=[c.a.MIN_BUFFER_TIME,c.a.MEDIA_PRESENTATION_DURATION,c.a.MINIMUM_UPDATE_PERIOD,c.a.TIMESHIFT_BUFFER_DEPTH,c.a.MAX_SEGMENT_DURATION,c.a.MAX_SUBSEGMENT_DURATION,c.a.SUGGESTED_PRESENTATION_DELAY,c.a.START,E.a.START_TIME,c.a.DURATION],n=t.length,r=0;r4)return null;var r=[];for(var i in t){var a=n.parseLength(t[i]);if(!a)return null;r.push(a)}return r}),(function(t,n,r,i,a){var o;if(1===i.length)o=[i[0],i[0],i[0],i[0]];else if(2===i.length)o=[i[0],i[1],i[0],i[1]];else if(3===i.length)o=[i[0],i[1],i[2],i[1]];else{if(4!==i.length)return null;o=[i[0],i[1],i[2],i[3]]}var s=r.styleAttrs[e.byName.writingMode.qname];if("lrtb"===s||"lr"===s)o=[o[0],o[3],o[2],o[1]];else if("rltb"===s||"rl"===s)o=[o[0],o[1],o[2],o[3]];else if("tblr"===s)o=[o[3],o[0],o[1],o[2]];else{if("tbrl"!==s&&"tb"!==s)return null;o=[o[3],o[2],o[1],o[0]]}var u=[];for(var l in o)if(0===o[l].value)u[l]=0;else if("%"===o[l].unit)u[l]="0"===l||"2"===l?r.styleAttrs[e.byName.extent.qname].h*o[l].value/100:r.styleAttrs[e.byName.extent.qname].w*o[l].value/100;else if("em"===o[l].unit)u[l]=r.styleAttrs[e.byName.fontSize.qname]*o[l].value;else if("c"===o[l].unit)u[l]=o[l].value/t.cellResolution.h;else{if("px"!==o[l].unit)return null;u[l]="0"===l||"2"===l?o[l].value/t.pxDimensions.h:o[l].value/t.pxDimensions.w}return u})),new r(t.ns_tts,"showBackground","always",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"textAlign","start",["p"],!0,!0,(function(e){return e}),(function(e,t,n,r,i){return"left"===r?"start":"right"===r?"end":r})),new r(t.ns_tts,"textDecoration","none",["span"],!0,!0,(function(e){return e.split(" ")}),null),new r(t.ns_tts,"textOutline","none",["span"],!0,!0,(function(e){if("none"===e)return e;var t={},r=e.split(" ");if(0===r.length||r.length>2)return null;var i=n.parseColor(r[0]);if(t.color=i,null!==i&&r.shift(),1!==r.length)return null;var a=n.parseLength(r[0]);return a?(t.thickness=a,t):null}),(function(t,n,r,i,a){if("none"===i)return i;var o={};if(null===i.color?o.color=r.styleAttrs[e.byName.color.qname]:o.color=i.color,"%"===i.thickness.unit)o.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value/100;else if("em"===i.thickness.unit)o.thickness=r.styleAttrs[e.byName.fontSize.qname]*i.thickness.value;else if("c"===i.thickness.unit)o.thickness=i.thickness.value/t.cellResolution.h;else{if("px"!==i.thickness.unit)return null;o.thickness=i.thickness.value/t.pxDimensions.h}return o})),new r(t.ns_tts,"unicodeBidi","normal",["span","p"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"visibility","visible",["body","div","p","region","span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"wrapOption","wrap",["span"],!0,!0,(function(e){return e}),null),new r(t.ns_tts,"writingMode","lrtb",["region"],!1,!0,(function(e){return e}),null),new r(t.ns_tts,"zIndex","auto",["region"],!1,!0,(function(e){var t;return"auto"===e?t=e:(t=parseInt(e),isNaN(t)&&(t=null)),t}),null),new r(t.ns_ebutts,"linePadding","0c",["p"],!0,!1,n.parseLength,(function(e,t,n,r,i){return"c"===r.unit?r.value/e.cellResolution.h:null})),new r(t.ns_ebutts,"multiRowAlign","auto",["p"],!0,!1,(function(e){return e}),null),new r(t.ns_smpte,"backgroundImage",null,["div"],!1,!1,(function(e){return e}),null),new r(t.ns_itts,"forcedDisplay","false",["body","div","p","region","span"],!0,!0,(function(e){return"true"===e}),null),new r(t.ns_itts,"fillLineGap","false",["p"],!0,!0,(function(e){return"true"===e}),null)],e.byQName={},e.all)e.byQName[e.all[i].qname]=e.all[i];for(var a in e.byName={},e.all)e.byName[e.all[a].name]=e.all[a]}(t,"undefined"==typeof imscNames?n(47):imscNames,"undefined"==typeof imscUtils?n(65):imscUtils)},function(e,t,n){"use strict";(function(e){ -/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -var r=n(77),i=n(78),a=n(66);function o(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function s(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 p(e,t){if(u.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 r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return G(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return j(e).length;default:if(r)return G(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!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))return"";for(e||(e="utf8");;)switch(e){case"hex":return C(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return N(this,t,n);case"latin1":case"binary":return w(this,t,n);case"base64":return I(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function y(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:E(e,t,n,r,i);if("number"==typeof t)return t&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):E(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function E(e,t,n,r,i){var a,o=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,n/=2}function l(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=n;as&&(n=s-u),a=n;a>=0;a--){for(var f=!0,d=0;di&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function I(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+f<=n)switch(f){case 1:l<128&&(c=l);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&l)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&l)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&l)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,f=1):c>65535&&(c-=65536,r.push(c>>>10&1023|55296),c=56320|1023&c),r.push(c),i+=f}return function(e){var t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},u.prototype.compare=function(e,t,n,r,i){if(!u.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===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),l=this.slice(r,i),c=e.slice(t,n),f=0;fi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return _(this,e,t,n);case"utf8":case"utf-8":return v(this,e,t,n);case"ascii":return T(this,e,t,n);case"latin1":case"binary":return S(this,e,t,n);case"base64":return A(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;ir)&&(n=r);for(var i="",a=t;an)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,i,a){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function P(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function L(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function F(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function x(e,t,n,r,a){return a||F(e,0,n,4),i.write(e,t,n,r,23,4),n+4}function U(e,t,n,r,a){return a||F(e,0,n,8),i.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t0&&(i*=256);)r+=this[e+--t]*i;return r},u.prototype.readUInt8=function(e,t){return t||O(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,t){return t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,t){return t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,t){return t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUInt32BE=function(e,t){return t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=this[e],i=1,a=0;++a=(i*=128)&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||O(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},u.prototype.readInt8=function(e,t){return t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){t||O(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){t||O(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return t||O(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return t||O(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||M(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a=0&&(a*=256);)this[t+i]=e/a&255;return t+n},u.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,255,0),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.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},u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,4294967295,0),u.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},u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a>0)-s&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);M(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,1,127,-128),u.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):P(this,e,t,!0),t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):P(this,e,t,!1),t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),u.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},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),u.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},u.prototype.writeFloatLE=function(e,t,n){return x(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return x(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return U(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return U(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!u.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.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;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function j(e){return r.toByteArray(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Y(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}}).call(this,n(21))},function(e,t,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,a=i&&"function"==typeof i.apply?i.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(n,r){function i(n){e.removeListener(t,a),r(n)}function a(){"function"==typeof e.removeListener&&e.removeListener("error",i),n([].slice.call(arguments))}y(e,t,a,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&y(e,"error",t,n)}(e,i,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var u=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function c(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function f(e,t,n,r){var i,a,o,s;if(l(n),void 0===(a=e._events)?(a=e._events=Object.create(null),e._eventsCount=0):(void 0!==a.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),a=e._events),o=a[t]),void 0===o)o=a[t]=n,++e._eventsCount;else if("function"==typeof o?o=a[t]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(e))>0&&o.length>i&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,s=u,console&&console.warn&&console.warn(s)}return e}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=d.bind(r);return i.listener=n,r.wrapFn=i,i}function p(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(o=t[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var u=i[e];if(void 0===u)return!1;if("function"==typeof u)a(u,this,t);else{var l=u.length,c=m(u,l);for(n=0;n=0;a--)if(n[a]===t||n[a].listener===t){o=n[a].listener,i=a;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},s.prototype.listenerCount=g,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(e,t,n){(t=e.exports=n(67)).Stream=t,t.Readable=t,t.Writable=n(63),t.Duplex=n(30),t.Transform=n(70),t.PassThrough=n(86)},function(e,t,n){"use strict";(function(t,r,i){var a=n(48);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;e.entry=null;for(;r;){var i=r.callback;t.pendingcb--,i(n),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=E;var s,u=!t.browser&&["v0.10","v0.9."].indexOf(t.version.slice(0,5))>-1?r:a.nextTick;E.WritableState=y;var l=n(42);l.inherits=n(34);var c={deprecate:n(85)},f=n(68),d=n(49).Buffer,h=i.Uint8Array||function(){};var p,g=n(69);function m(){}function y(e,t){s=s||n(30),e=e||{};var r=t instanceof s;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,l=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,i=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,i){--t.pendingcb,n?(a.nextTick(i,r),a.nextTick(b,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(i(r),e._writableState.errorEmitted=!0,e.emit("error",r),b(e,t))}(e,n,r,t,i);else{var o=S(n);o||n.corked||n.bufferProcessing||!n.bufferedRequest||T(e,n),r?u(v,e,n,o,i):v(e,n,o,i)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function E(e){if(s=s||n(30),!(p.call(E,this)||this instanceof s))return new E(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function _(e,t,n,r,i,a,o){t.writelen=r,t.writecb=o,t.writing=!0,t.sync=!0,n?e._writev(i,t.onwrite):e._write(i,a,t.onwrite),t.sync=!1}function v(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),b(e,t)}function T(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,i=new Array(r),a=t.corkedRequestsFree;a.entry=n;for(var s=0,u=!0;n;)i[s]=n,n.isBuf||(u=!1),n=n.next,s+=1;i.allBuffers=u,_(e,t,!0,t.length,i,"",a.finish),t.pendingcb++,t.lastBufferedRequest=null,a.next?(t.corkedRequestsFree=a.next,a.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,f=n.callback;if(_(e,t,!1,t.objectMode?1:l.length,l,c,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),b(e,t)}))}function b(e,t){var n=S(t);return n&&(!function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(A,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}l.inherits(E,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(p=Function.prototype[Symbol.hasInstance],Object.defineProperty(E,Symbol.hasInstance,{value:function(e){return!!p.call(this,e)||this===E&&(e&&e._writableState instanceof y)}})):p=function(e){return e instanceof this},E.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},E.prototype.write=function(e,t,n){var r,i=this._writableState,o=!1,s=!i.objectMode&&(r=e,d.isBuffer(r)||r instanceof h);return s&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(n=t,t=null),s?t="buffer":t||(t=i.defaultEncoding),"function"!=typeof n&&(n=m),i.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(s||function(e,t,n,r){var i=!0,o=!1;return null===n?o=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(o=new TypeError("Invalid non-string/buffer chunk")),o&&(e.emit("error",o),a.nextTick(r,o),i=!1),i}(this,i,e,n))&&(i.pendingcb++,o=function(e,t,n,r,i,a){if(!n){var o=function(e,t,n){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,n));return t}(t,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=t.objectMode?1:r.length;t.length+=s;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(E.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),E.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},E.prototype._writev=null,E.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,b(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(E.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),E.prototype.destroy=g.destroy,E.prototype._undestroy=g.undestroy,E.prototype._destroy=function(e,t){this.end(),t(e)}}).call(this,n(26),n(83).setImmediate,n(21))},function(e,t,n){"use strict";var r=n(49).Buffer,i=r.isEncoding||function(e){switch((e=""+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}};function a(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=l,t=4;break;case"utf8":this.fillLast=s,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=h)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function s(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function l(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function h(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return i>0&&(e.lastNeed=i-1),i;if(--r=0)return i>0&&(e.lastNeed=i-2),i;if(--r=0)return i>0&&(2===i?i=0:e.lastNeed=i-3),i;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},function(e,t,n){!function(e){var t=/#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})?/,n=/rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,r=/rgba\(\s*(\d+),\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/,i={transparent:[0,0,0,0],black:[0,0,0,255],silver:[192,192,192,255],gray:[128,128,128,255],white:[255,255,255,255],maroon:[128,0,0,255],red:[255,0,0,255],purple:[128,0,128,255],fuchsia:[255,0,255,255],magenta:[255,0,255,255],green:[0,128,0,255],lime:[0,255,0,255],olive:[128,128,0,255],yellow:[255,255,0,255],navy:[0,0,128,255],blue:[0,0,255,255],teal:[0,128,128,255],aqua:[0,255,255,255],cyan:[0,255,255,255]};e.parseColor=function(e){var a,o=null,s=i[e.toLowerCase()];return void 0!==s?o=s:null!==(a=t.exec(e))?o=[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),void 0!==a[4]?parseInt(a[4],16):255]:null!==(a=n.exec(e))?o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),255]:null!==(a=r.exec(e))&&(o=[parseInt(a[1]),parseInt(a[2]),parseInt(a[3]),parseInt(a[4])]),o};var a=/^((?:\+|\-)?\d*(?:\.\d+)?)(px|em|c|%)$/;e.parseLength=function(e){var t,n=null;return null!==(t=a.exec(e))&&(n={value:parseFloat(t[1]),unit:t[2]}),n}}(t)},function(e,t){var n={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==n.call(e)}},function(e,t,n){"use strict";(function(t,r){var i=n(48);e.exports=_;var a,o=n(66);_.ReadableState=E;n(61).EventEmitter;var s=function(e,t){return e.listeners(t).length},u=n(68),l=n(49).Buffer,c=t.Uint8Array||function(){};var f=n(42);f.inherits=n(34);var d=n(80),h=void 0;h=d&&d.debuglog?d.debuglog("stream"):function(){};var p,g=n(81),m=n(69);f.inherits(_,u);var y=["error","close","destroy","pause","resume"];function E(e,t){e=e||{};var r=t instanceof(a=a||n(30));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var i=e.highWaterMark,o=e.readableHighWaterMark,s=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(o||0===o)?o:s,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=n(64).StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function _(e){if(a=a||n(30),!(this instanceof _))return new _(e);this._readableState=new E(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function v(e,t,n,r,i){var a,o=e._readableState;null===t?(o.reading=!1,function(e,t){if(t.ended)return;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,A(e)}(e,o)):(i||(a=function(e,t){var n;r=t,l.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var r;return n}(o,t)),a?e.emit("error",a):o.objectMode||t&&t.length>0?("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),r?o.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):T(e,o,t,!0):o.ended?e.emit("error",new Error("stream.push() after EOF")):(o.reading=!1,o.decoder&&!n?(t=o.decoder.write(t),o.objectMode||0!==t.length?T(e,o,t,!1):I(e,o)):T(e,o,t,!1))):r||(o.reading=!1));return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=8388608?e=8388608:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(h("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?i.nextTick(b,e):b(e))}function b(e){h("emit readable"),e.emit("readable"),C(e)}function I(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(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=function(e,t,n){var r;ea.length?a.length:e;if(o===a.length?i+=a:i+=a.slice(0,e),0===(e-=o)){o===a.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=a.slice(o));break}++r}return t.length-=r,i}(e,t):function(e,t){var n=l.allocUnsafe(e),r=t.head,i=1;r.data.copy(n),e-=r.data.length;for(;r=r.next;){var a=r.data,o=e>a.length?a.length:e;if(a.copy(n,n.length-e,0,o),0===(e-=o)){o===a.length?(++i,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=a.slice(o));break}++i}return t.length-=i,n}(e,t);return r}(e,t.buffer,t.decoder),n);var n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,i.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function P(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return h("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):A(this),null;if(0===(e=S(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,i=t.needReadable;return h("need readable",i),(0===t.length||t.length-e0?D(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},_.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},_.prototype.pipe=function(e,t){var n=this,a=this._readableState;switch(a.pipesCount){case 0:a.pipes=e;break;case 1:a.pipes=[a.pipes,e];break;default:a.pipes.push(e)}a.pipesCount+=1,h("pipe count=%d opts=%j",a.pipesCount,t);var u=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?c:_;function l(t,r){h("onunpipe"),t===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,h("cleanup"),e.removeListener("close",y),e.removeListener("finish",E),e.removeListener("drain",f),e.removeListener("error",m),e.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",_),n.removeListener("data",g),d=!0,!a.awaitDrain||e._writableState&&!e._writableState.needDrain||f())}function c(){h("onend"),e.end()}a.endEmitted?i.nextTick(u):n.once("end",u),e.on("unpipe",l);var f=function(e){return function(){var t=e._readableState;h("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,C(e))}}(n);e.on("drain",f);var d=!1;var p=!1;function g(t){h("ondata"),p=!1,!1!==e.write(t)||p||((1===a.pipesCount&&a.pipes===e||a.pipesCount>1&&-1!==P(a.pipes,e))&&!d&&(h("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,p=!0),n.pause())}function m(t){h("onerror",t),_(),e.removeListener("error",m),0===s(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",E),_()}function E(){h("onfinish"),e.removeListener("close",y),_()}function _(){h("unpipe"),n.unpipe(e)}return n.on("data",g),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events[t]?o(e._events[t])?e._events[t].unshift(n):e._events[t]=[n,e._events[t]]:e.on(t,n)}(e,"error",m),e.once("close",y),e.once("finish",E),e.emit("pipe",n),a.flowing||(h("pipe resume"),n.resume()),e},_.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var a=0;a0&&(t+=4+16*n.getUint32(t)),t+=4,e.slice(t)}},{key:"getPSSHForKeySystem",value:function(t,n){var r=e.parsePSSHList(n);return t&&r.hasOwnProperty(t.uuid.toLowerCase())?r[t.uuid.toLowerCase()]:null}},{key:"parseInitDataFromContentProtection",value:function(e,t){return"pssh"in e?(e.pssh.__text=e.pssh.__text.replace(/\r?\n|\r/g,"").replace(/\s+/g,""),t.decodeArray(e.pssh.__text).buffer):null}},{key:"parsePSSHList",value:function(e){if(null==e)return[];for(var t=new DataView(e.buffer||e),n={},r=0;;){var i,a,o=void 0,s=r;if(r>=t.buffer.byteLength)break;if(i=r+t.getUint32(r),r+=4,1886614376===t.getUint32(r))if(r+=4,0===(a=t.getUint8(r))||1===a){r++,r+=3,o="";var u=void 0,l=void 0;for(u=0;u<4;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=4,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<2;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;for(r+=2,o+="-",u=0;u<6;u++)o+=1===(l=t.getUint8(r+u).toString(16)).length?"0"+l:l;r+=6,r+=4,n[o=o.toLowerCase()]=t.buffer.slice(s,i),r=i}else r=i;else r=i}return n}}],(n=null)&&r(t.prototype,n),i&&r(t,i),e}();var a=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.contentType=t,this.robustness=n};var o=function e(t,n,r,i,a){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.initDataTypes=["cenc"],t&&t.length&&(this.audioCapabilities=t),n&&n.length&&(this.videoCapabilities=n),this.distinctiveIdentifier=r,this.persistentState=i,this.sessionTypes=a};function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=f(e);if(t){var i=f(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return c(this,n)}}function c(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var d=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(n,e);var t=l(n);function n(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),(e=t.call(this)).MEDIA_KEYERR_CODE=100,e.MEDIA_KEYERR_UNKNOWN_CODE=101,e.MEDIA_KEYERR_CLIENT_CODE=102,e.MEDIA_KEYERR_SERVICE_CODE=103,e.MEDIA_KEYERR_OUTPUT_CODE=104,e.MEDIA_KEYERR_HARDWARECHANGE_CODE=105,e.MEDIA_KEYERR_DOMAIN_CODE=106,e.MEDIA_KEY_MESSAGE_ERROR_CODE=107,e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE=108,e.SERVER_CERTIFICATE_UPDATED_ERROR_CODE=109,e.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE=110,e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE=111,e.KEY_SYSTEM_ACCESS_DENIED_ERROR_CODE=112,e.KEY_SESSION_CREATED_ERROR_CODE=113,e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE=114,e.MEDIA_KEYERR_UNKNOWN_MESSAGE="An unspecified error occurred. This value is used for errors that don't match any of the other codes.",e.MEDIA_KEYERR_CLIENT_MESSAGE="The Key System could not be installed or updated.",e.MEDIA_KEYERR_SERVICE_MESSAGE="The message passed into update indicated an error from the license service.",e.MEDIA_KEYERR_OUTPUT_MESSAGE="There is no available output device with the required characteristics for the content protection system.",e.MEDIA_KEYERR_HARDWARECHANGE_MESSAGE="A hardware configuration change caused a content protection error.",e.MEDIA_KEYERR_DOMAIN_MESSAGE="An error occurred in a multi-device domain licensing configuration. The most common error is a failure to join the domain.",e.MEDIA_KEY_MESSAGE_ERROR_MESSAGE="Multiple key sessions were creates with a user-agent that does not support sessionIDs!! Unpredictable behavior ahead!",e.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE="DRM: Empty key message from CDM",e.SERVER_CERTIFICATE_UPDATED_ERROR_MESSAGE="Error updating server certificate -- ",e.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE="DRM: KeyStatusChange error! -- License has expired",e.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE="DRM: No license server URL specified!",e.KEY_SYSTEM_ACCESS_DENIED_ERROR_MESSAGE="DRM: KeySystem Access Denied! -- ",e.KEY_SESSION_CREATED_ERROR_MESSAGE="DRM: unable to create session! --",e.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE="DRM: licenser error! --",e}return n}(n(24).a)),h=n(8);var p=function e(t,n,r,i,a,o,s,u){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.method=n,this.responseType=r,this.headers=i,this.withCredentials=a,this.messageType=o,this.sessionId=s,this.data=u};var g=function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.url=t,this.headers=n,this.data=r},m=n(5),y=n(14),E=n(1);function _(e){return(_="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function v(e){var t,n,r,s,u,l,c,f,v,T,S=(e=e||{}).protectionKeyController,A=e.protectionModel,b=e.eventBus,I=e.events,R=e.debug,N=e.BASE64,w=e.constants,C=[],D=e.cmcdModel,O=e.settings;function M(){if(!(b&&b.hasOwnProperty("on")&&S&&S.hasOwnProperty("getSupportedKeySystemsFromContentProtection")))throw new Error("Missing config parameter(s)")}function P(e,t){var n=i.getPSSHForKeySystem(f,e),r=U(f);if(n){if(L(n))return;try{A.createKeySession(n,r,k(f),t)}catch(e){b.trigger(I.KEY_SESSION_CREATED,{data:null,error:new h.a(d.KEY_SESSION_CREATED_ERROR_CODE,d.KEY_SESSION_CREATED_ERROR_MESSAGE+e.message)})}}else e?A.createKeySession(e,r,k(f),t):b.trigger(I.KEY_SESSION_CREATED,{data:null,error:new h.a(d.KEY_SESSION_CREATED_ERROR_CODE,d.KEY_SESSION_CREATED_ERROR_MESSAGE+"Selected key system is "+(f?f.systemString:null)+". needkey/encrypted event contains no initData corresponding to that key system!")})}function L(e){if(!e)return!1;try{for(var t=A.getAllInitData(),r=0;r0?t.audioRobustness:c,u=t&&t.videoRobustness&&t.videoRobustness.length>0?t.videoRobustness:c,l=k(e),f=t&&t.distinctiveIdentifier?t.distinctiveIdentifier:"optional",d=t&&t.persistentState?t.persistentState:"temporary"===l?"optional":"required";return s.forEach((function(e){e.type===w.AUDIO?n.push(new a(e.codec,i)):e.type===w.VIDEO&&r.push(new a(e.codec,u))})),new o(n,r,f,d,[l])}function k(e){var t=U(e);return t&&t.sessionType?t.sessionType:l}function G(e,t){e=e.sort((function(t,n){return(u&&u[t.ks.systemString]&&u[t.ks.systemString].priority>=0?u[t.ks.systemString].priority:e.length)-(u&&u[n.ks.systemString]&&u[n.ks.systemString].priority>=0?u[n.ks.systemString].priority:e.length)})),void 0===f?function(e,t){var i,a,o=this,s=[];f=null,r.push(e);for(var u=0;u0&&A.setServerCertificate(N.decodeArray(s.serverCertificate).buffer);for(var u=0;u=200&&e.status<=299){var t=new g(e.responseURL,y.a.parseHttpHeaders(e.getAllResponseHeaders?e.getAllResponseHeaders():null),e.response);q(T,t).then((function(){var n=c.getLicenseMessage(t.data,l,r);null!==n?(j(R),A.updateKeySession(o,n)):x(e,R,l,r)}))}else x(e,R,l,r)},k=function(e){j(R,new h.a(d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+l+' update, XHR aborted. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},G=function(e){j(R,new h.a(d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_CODE,d.MEDIA_KEY_MESSAGE_LICENSER_ERROR_MESSAGE+l+' update, XHR error. status is "'+e.statusText+'" ('+e.status+"), readyState is "+e.readyState))},Y=f.getLicenseRequestFromMessage(a),H=c.getHTTPMethod(r),K=c.getResponseType(l,r),V=u&&!isNaN(u.httpTimeout)?u.httpTimeout:8e3,W=o.getSessionID()||null,z=new p(w,H,K,P,L,r,W,Y),X=isNaN(O.get().streaming.retryAttempts[m.a.LICENSE])?3:O.get().streaming.retryAttempts[m.a.LICENSE];q(v,z).then((function(){!function e(t,r,i,a,o,s){var u=new XMLHttpRequest;if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled){if(O.get().streaming.cmcd.mode===E.a.CMCD_MODE_QUERY){var l=D.getQueryParameter({url:t.url,type:m.a.LICENSE});l&&(t.url=y.a.addAditionalQueryParameterToUrl(t.url,[l]))}}u.open(t.method,t.url,!0),u.responseType=t.responseType,u.withCredentials=t.withCredentials,i>0&&(u.timeout=i);for(var c in t.headers)u.setRequestHeader(c,t.headers[c]);if(O.get().streaming.cmcd&&O.get().streaming.cmcd.enabled){if(O.get().streaming.cmcd.mode===E.a.CMCD_MODE_HEADER){var f=D.getHeaderParameters({url:t.url,type:m.a.LICENSE});if(f)for(var d in f){var h=f[d];h&&u.setRequestHeader(d,h)}}}var p=function(){r--;var n=isNaN(O.get().streaming.retryIntervals[m.a.LICENSE])?1e3:O.get().streaming.retryIntervals[m.a.LICENSE];setTimeout((function(){e(t,r,i,a,o,s)}),n)};u.onload=function(){this.status>=200&&this.status<=299||r<=0?a(this):(n.warn("License request failed ("+this.status+"). Retrying it... Pending retries: "+r),p())},u.ontimeout=u.onerror=function(){r<=0?s(this):(n.warn("License request network request failed . Retrying it... Pending retries: "+r),p())},u.onabort=function(){o(this)},b.trigger(I.LICENSE_REQUEST_SENDING,{url:t.url,headers:t.headers,payload:t.data,sessionId:t.sessionId}),u.send(t.data)}(z,X,V,B,k,G)}))}else j(R,new h.a(d.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_CODE,d.MEDIA_KEY_MESSAGE_NO_LICENSE_SERVER_URL_ERROR_MESSAGE))}else j(R,new h.a(d.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_CODE,d.MEDIA_KEY_MESSAGE_NO_CHALLENGE_ERROR_MESSAGE))}function K(e,t){if(n.debug("DRM: onNeedKey"),"cenc"===e.key.initDataType)if(0===s.length&&(n.warn("DRM: onNeedKey called before initializeForMedia, wait until initialized"),(t=void 0===t?1:t+1)<5))C.push(setTimeout((function(){K(e,t)}),500));else{var r=e.key.initData;if(ArrayBuffer.isView(r)&&(r=r.buffer),f){var a=i.getPSSHForKeySystem(f,r);if(a&&L(a))return}n.debug("DRM: initData:",String.fromCharCode.apply(null,new Uint8Array(r)));var o=S.getSupportedKeySystems(r,u);0!==o.length?G(o,!1):n.debug("DRM: Received needkey event with initData, but we don't support any of the key systems!")}else n.warn("DRM: Only 'cenc' initData is supported! Ignoring initData of type: "+e.key.initDataType)}function q(e,t){return e?e.reduce((function(e,n){return e.then((function(){return n(t)}))}),Promise.resolve()):Promise.resolve()}return t={initializeForMedia:function(e){if(!e)throw new Error("mediaInfo can not be null or undefined");M(),b.on(I.INTERNAL_KEY_MESSAGE,H,this),b.on(I.INTERNAL_KEY_STATUS_CHANGED,Y,this),s.push(e);var t=S.getSupportedKeySystemsFromContentProtection(e.contentProtection);t&&t.length>0&&G(t,!0)},clearMediaInfoArrayByStreamId:function(e){s=s.filter((function(t){return t.streamInfo.id!==e}))},createKeySession:P,loadKeySession:F,removeKeySession:function(e){M(),A.removeKeySession(e)},closeKeySession:function(e){M(),A.closeKeySession(e)},setServerCertificate:function(e){M(),A.setServerCertificate(e)},setMediaElement:x,setSessionType:function(e){l=e},setRobustnessLevel:function(e){c=e},setProtectionData:function(e){u=e,S.setProtectionData(e)},getSupportedKeySystemsFromContentProtection:function(e){return M(),S.getSupportedKeySystemsFromContentProtection(e)},getKeySystems:function(){return S?S.getKeySystems():[]},setKeySystems:function(e){S&&S.setKeySystems(e)},setLicenseRequestFilters:function(e){v=e},setLicenseResponseFilters:function(e){T=e},stop:function(){A&&A.stop()},reset:function(){M(),v=[],T=[],b.off(I.INTERNAL_KEY_MESSAGE,H,this),b.off(I.INTERNAL_KEY_STATUS_CHANGED,Y,this),x(null),f=void 0,A&&(A.reset(),A=null),C.forEach((function(e){return clearTimeout(e)})),C=[],s=[]}},n=R.getLogger(t),r=[],s=[],l="temporary",c="",v=[],T=[],t}v.__dashjs_factory_name="ProtectionController";var T=dashjs.FactoryMaker.getClassFactory(v);var S=function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.keyID=t,this.key=n};function A(e,t){for(var n=0;n0){var a=i.contentProtection.filter((function(e){return e.schemeIdUri&&e.schemeIdUri===C}));if(a&&a.length>0)for(var o=0;o%CUSTOMDATA%'.replace("%CUSTOMDATA%",e),i=[],a=0;a0&&(e[0]&&("string"==typeof e[0]?t=e[0]:n=e[0]),e[1]&&("string"==typeof e[1]?t=e[1]:n=e[1])),{status:t,keyId:n}}function E(e,t,r,i){var a={session:e,initData:t,sessionId:i,handleEvent:function(e){switch(e.type){case"keystatuseschange":c.trigger(f.KEY_STATUSES_CHANGED,{data:this}),e.target.keyStatuses.forEach((function(){var e=y(arguments);switch(e.status){case"expired":c.trigger(f.INTERNAL_KEY_STATUS_CHANGED,{error:new h.a(d.KEY_STATUS_CHANGED_EXPIRED_ERROR_CODE,d.KEY_STATUS_CHANGED_EXPIRED_ERROR_MESSAGE)});break;default:c.trigger(f.INTERNAL_KEY_STATUS_CHANGED,e)}}));break;case"message":var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;c.trigger(f.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,void 0,e.messageType)})}},getSessionID:function(){return e.sessionId},getExpirationTime:function(){return e.expiration},getKeyStatuses:function(){return e.keyStatuses},getUsable:function(){var t=!1;return e.keyStatuses.forEach((function(){var e=y(arguments);"usable"===e.status&&(t=!0)})),t},getSessionType:function(){return r}};return e.addEventListener("keystatuseschange",a),e.addEventListener("message",a),e.closed.then((function(){m(a),n.debug("DRM: Session closed. SessionID = "+a.getSessionID()),c.trigger(f.KEY_SESSION_CLOSED,{data:a.getSessionID()})})),o.push(a),a}return t={getAllInitData:function(){for(var e=[],t=0;t=1?t():(e=t.bind(this),r.addEventListener("loadedmetadata",e))}return t={getAllInitData:function(){for(var e=[],t=0;t0&&(l=s.ksConfiguration.videoCapabilities[0]),null===l&&s.ksConfiguration.audioCapabilities&&s.ksConfiguration.audioCapabilities.length>0&&(l=s.ksConfiguration.audioCapabilities[0]),null===l)throw new Error("Can not create sessions for unknown content types.");var c=l.contentType,f=a.createSession(c,new Uint8Array(e),o?new Uint8Array(o):null),m=function(e,t){return{session:e,initData:t,getSessionID:function(){return this.session.sessionId},getExpirationTime:function(){return NaN},getSessionType:function(){return"temporary"},handleEvent:function(e){switch(e.type){case y.error:p.trigger(g.KEY_ERROR,{error:new h.a(d.MEDIA_KEYERR_CODE,"KeyError",this)});break;case y.message:var t=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;p.trigger(g.INTERNAL_KEY_MESSAGE,{data:new ae(this,t,e.destinationURL)});break;case y.ready:n.debug("DRM: Key added."),p.trigger(g.KEY_ADDED);break;case y.close:n.debug("DRM: Session closed. SessionID = "+this.getSessionID()),p.trigger(g.KEY_SESSION_CLOSED,{data:this.getSessionID()})}}}}(f,e);f.addEventListener(y.error,m),f.addEventListener(y.message,m),f.addEventListener(y.ready,m),f.addEventListener(y.close,m),u.push(m),n.debug("DRM: Session created. SessionID = "+m.getSessionID()),p.trigger(g.KEY_SESSION_CREATED,{data:m})},updateKeySession:function(e,t){var n=e.session;c.isClearKey(i)?n.update(new Uint8Array(t.toJWK())):n.update(new Uint8Array(t)),p.trigger(g.KEY_SESSION_UPDATED)},closeKeySession:_,setServerCertificate:function(){},loadKeySession:function(){},removeKeySession:function(){},stop:E,reset:E},n=m.getLogger(t),r=null,i=null,a=null,s=null,u=[],c=$(f).getInstance(),l={handleEvent:function(e){switch(e.type){case y.needkey:if(e.initData){var t=ArrayBuffer.isView(e.initData)?e.initData.buffer:e.initData;p.trigger(g.NEED_KEY,{key:new ie(t,"cenc")})}}}},t}le.__dashjs_factory_name="ProtectionModel_3Feb2014";var ce=dashjs.FactoryMaker.getClassFactory(le);function fe(e){e=e||{};var t,n,r,i,a,s,u,l,c,f=this.context,p=e.eventBus,g=e.events,m=e.debug,y=e.api,E=e.errHandler;function _(){r&&S();for(var e=0;e0&&(t=s.shift(),u.push(t),t.sessionID=e.sessionId,p.trigger(g.KEY_SESSION_CREATED,{data:t})):s.length>0&&(t=s.shift(),u.push(t),0!==s.length&&E.error(new h.a(d.MEDIA_KEY_MESSAGE_ERROR_CODE,d.MEDIA_KEY_MESSAGE_ERROR_MESSAGE))),t){var o=ArrayBuffer.isView(e.message)?e.message.buffer:e.message;t.keyMessage=o,p.trigger(g.INTERNAL_KEY_MESSAGE,{data:new ae(t,o,e.defaultURL)})}else n.warn("No session token found for key message")}}},t}fe.__dashjs_factory_name="ProtectionModel_01b";var de=dashjs.FactoryMaker.getClassFactory(fe),he=[{generateKeyRequest:"generateKeyRequest",addKey:"addKey",cancelKeyRequest:"cancelKeyRequest",needkey:"needkey",keyerror:"keyerror",keyadded:"keyadded",keymessage:"keymessage"},{generateKeyRequest:"webkitGenerateKeyRequest",addKey:"webkitAddKey",cancelKeyRequest:"webkitCancelKeyRequest",needkey:"webkitneedkey",keyerror:"webkitkeyerror",keyadded:"webkitkeyadded",keymessage:"webkitkeymessage"}],pe=[{setMediaKeys:"setMediaKeys",MediaKeys:"MediaKeys",release:"close",needkey:"needkey",error:"keyerror",message:"keymessage",ready:"keyadded",close:"keyclose"},{setMediaKeys:"msSetMediaKeys",MediaKeys:"MSMediaKeys",release:"close",needkey:"msneedkey",error:"mskeyerror",message:"mskeymessage",ready:"mskeyadded",close:"mskeyclose"}];function ge(){var e,t=this.context;function n(e,t){for(var n=0;n=400||t.responsecode<100||t.responsecode>=600)&&l({errorcode:t.responsecode||i.CONNECTION_ERROR,url:t.url,terror:t.tresponse,servicelocation:t._serviceLocation})}var t}function p(e){var t;switch(e.error?e.error.code:0){case MediaError.MEDIA_ERR_NETWORK:t=i.CONNECTION_ERROR;break;case MediaError.MEDIA_ERR_DECODE:t=i.CORRUPT_MEDIA_OTHER;break;default:return}l({errorcode:t})}return t={initialise:function(){r.on(u.MANIFEST_UPDATED,c,t),r.on(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),r.on(u.METRIC_ADDED,h,t),r.on(u.METRIC_UPDATED,h,t),r.on(u.PLAYBACK_ERROR,p,t),r.on(a.a.BECAME_REPORTING_PLAYER,d,t)},reset:function(){r.off(u.MANIFEST_UPDATED,c,t),r.off(u.SERVICE_LOCATION_BLACKLIST_CHANGED,f,t),r.off(u.METRIC_ADDED,h,t),r.off(u.METRIC_UPDATED,h,t),r.off(u.PLAYBACK_ERROR,p,t),r.off(a.a.BECAME_REPORTING_PLAYER,d,t)}}}o.__dashjs_factory_name="DVBErrorsTranslator";var s=dashjs.FactoryMaker.getSingletonFactory(o),u=n(45);function l(e){e=e||{};var t,n,r=!1,i=this.context,a=e.mediaElement;return t={initialize:function(e){e&&e.length&&(e.forEach((function(e){var t=e.starttime,r=t+e.duration;n.add(t,r)})),r=!!e[0]._useWallClockTime)},reset:function(){n.clear()},isEnabled:function(){var e,t=n.length;if(!t)return!0;e=r?(new Date).getTime()/1e3:a.currentTime;for(var i=0;i=200&&r.status<300?t&&t():n&&n())};l.push(r);try{r.open("GET",e),r.onloadend=i,r.onerror=i,r.send()}catch(e){r.onerror()}}(r="".concat(o,"?").concat(r),null,(function(){a=!1}))}))},initialize:function(e,t){var n;if(s=t,!(o=e.dvb_reportingUrl))throw new Error("required parameter missing (dvb:reportingUrl)");i||((n=e.dvb_probability)&&(1e3===n||n/1e3>=r.random())&&(a=!0),i=!0)},reset:function(){f()}},n=d(u).getInstance(),r=p(u).getInstance(),f(),t}g.__dashjs_factory_name="DVBReporting";var m=dashjs.FactoryMaker.getClassFactory(g);function y(e){e=e||{};var t,n={"urn:dvb:dash:reporting:2014":m},r=this.context,i=e.debug?e.debug.getLogger(t):{},a=e.metricsConstants;return t={create:function(e,t){var o;try{(o=n[e.schemeIdUri](r).create({metricsConstants:a})).initialize(e,t)}catch(t){o=null,i.error("ReportingFactory: could not create Reporting with schemeIdUri ".concat(e.schemeIdUri," (").concat(t.message,")"))}return o},register:function(e,t){n[e]=t},unregister:function(e){delete n[e]}}}y.__dashjs_factory_name="ReportingFactory";var E=dashjs.FactoryMaker.getSingletonFactory(y);function _(e){var t=[],n=E(this.context).getInstance(e);return{initialize:function(e,r){e.some((function(e){var i=n.create(e,r);if(i)return t.push(i),!0}))},reset:function(){t.forEach((function(e){return e.reset()})),t=[]},report:function(e,n){t.forEach((function(t){return t.report(e,n)}))}}}_.__dashjs_factory_name="ReportingController";var v=dashjs.FactoryMaker.getClassFactory(_);function T(){return{reconstructFullMetricName:function(e,t,n){var r=e;return t&&(r+="("+t,n&&n.length&&(r+=","+n),r+=")"),r},validateN:function(e){if(!e)throw new Error("missing n");if(isNaN(e))throw new Error("n is NaN");if(e<0)throw new Error("n must be positive");return e}}}T.__dashjs_factory_name="HandlerHelpers";var S=dashjs.FactoryMaker.getSingletonFactory(T);function A(e){var t,n,r,i,a;e=e||{};var o=this.context,s=S(o).getInstance(),u=[],l=e.metricsConstants;function c(){var e=function(){try{return Object.keys(u).map((function(e){return u[e]})).reduce((function(e,t){return e.level=c.end)return null;var h="regionID"in c&&""!==c.regionID?c.regionID:l;if(null!==u&&h!==i.id&&(!("contents"in c)||"contents"in c&&0===c.contents.length||""!==h))return null;var p=new a(c);for(var g in c.sets)t=c.sets[g].end||(p.styleAttrs[c.sets[g].qname]=c.sets[g].value);var m,y={};for(var E in p.styleAttrs)if(y[E]=!0,E===n.byName.writingMode.qname&&!(n.byName.direction.qname in p.styleAttrs)){var _=p.styleAttrs[E];"lrtb"===_||"lr"===_?p.styleAttrs[n.byName.direction.qname]="ltr":"rltb"!==_&&"rl"!==_||(p.styleAttrs[n.byName.direction.qname]="rtl")}if(null!==u)for(var v in n.all){var T=n.all[v];if(T.qname===n.byName.textDecoration.qname){var S=u.styleAttrs[T.qname],A=p.styleAttrs[T.qname],b=[];void 0===A?b=S:-1===A.indexOf("none")?((-1===A.indexOf("noUnderline")&&-1!==S.indexOf("underline")||-1!==A.indexOf("underline"))&&b.push("underline"),(-1===A.indexOf("noLineThrough")&&-1!==S.indexOf("lineThrough")||-1!==A.indexOf("lineThrough"))&&b.push("lineThrough"),(-1===A.indexOf("noOverline")&&-1!==S.indexOf("overline")||-1!==A.indexOf("overline"))&&b.push("overline")):b.push("none"),p.styleAttrs[T.qname]=b}else T.inherit&&T.qname in u.styleAttrs&&!(T.qname in p.styleAttrs)&&(p.styleAttrs[T.qname]=u.styleAttrs[T.qname])}for(var I in n.all){var R=n.all[I];R.qname in p.styleAttrs||("region"===p.kind||!1===R.inherit&&null!==R.initial)&&(p.styleAttrs[R.qname]=R.parse(R.initial),y[R.qname]=!0)}for(var N in n.all){var w=n.all[N];if(w.qname in y&&null!==w.compute){var C=w.compute(e,u,p,p.styleAttrs[w.qname],d);null!==C?p.styleAttrs[w.qname]=C:o(f,"Style '"+w.qname+"' on element '"+p.kind+"' cannot be computed")}}if("none"===p.styleAttrs[n.byName.display.qname])return null;for(var D in null===u?m=null===s?[]:[s]:"contents"in c&&(m=c.contents),m){var O=r(e,t,i,s,p,h,m[D],f,d);null!==O&&p.contents.push(O.element)}for(var M in p.styleAttrs){-1===n.byQName[M].applies.indexOf(p.kind)&&delete p.styleAttrs[M]}if("span"===p.kind&&p.text&&"default"===p.space){var P=p.text.replace(/\s+/g," ");p.text=P}if("p"===p.kind){var L=[];!function e(t,n){if("contents"in t)for(var r in t.contents)e(t.contents[r],n);else n.push(t)}(p,L);for(var F=0,x="after_br",U=0;;)if("after_br"===x)F>=L.length||"br"===L[F].kind?(x="before_br",U=F,F--):("preserve"!==L[F].space&&(L[F].text=L[F].text.replace(/^\s+/g,"")),L[F].text.length>0?(x="looking_br",F++):L.splice(F,1));else if("before_br"===x)if(F<0||"br"===L[F].kind){if(x="after_br",(F=U+1)>=L.length)break}else if("preserve"!==L[F].space&&(L[F].text=L[F].text.replace(/\s+$/g,"")),L[F].text.length>0){if(x="after_br",(F=U+1)>=L.length)break}else L.splice(F,1),F--;else F>=L.length||"br"===L[F].kind?(x="before_br",U=F,F--):F++;!function e(t){if("br"===t.kind)return!1;if("text"in t)return 0===t.text.length;if("contents"in t){for(var n=t.contents.length;n--;)e(t.contents[n])&&t.contents.splice(n,1);return 0===t.contents.length}}(p)}return"div"===p.kind&&n.byName.backgroundImage.qname in p.styleAttrs||"br"===p.kind||"contents"in p&&p.contents.length>0||"span"===p.kind&&null!==p.text||"region"===p.kind&&"always"===p.styleAttrs[n.byName.showBackground.qname]?{region_id:h,element:p}:null}function i(e){this.contents=[],this.aspectRatio=e.aspectRatio}function a(e){for(var t in this.kind=e.kind||"region",e.id&&(this.id=e.id),this.styleAttrs={},e.styleAttrs)this.styleAttrs[t]=e.styleAttrs[t];"text"in e?this.text=e.text:"br"!==e.kind&&(this.contents=[]),"space"in e&&(this.space=e.space)}function o(e,t){if(e&&e.error&&e.error(t))throw t}e.generateISD=function(e,t,n){var a=new i(e),o={};for(var s in e.head.layout.regions){var u=r(e,t,e.head.layout.regions[s],e.body,null,"",e.head.layout.regions[s],n,o);null!==u&&a.contents.push(u.element)}return a}}(t,"undefined"==typeof imscNames?n(47):imscNames,"undefined"==typeof imscStyles?n(59):imscStyles)},function(e,t,n){!function(e,t,n,r,i){function a(e,t,n,r){var i=r&&"seq"===r.timeContainer,o=0;r&&(o=i&&n?n.end:r.begin),t.begin=t.explicit_begin?t.explicit_begin+o:o;var s=t.begin,u=null;for(var l in t.sets)a(e,t.sets[l],u,t),s="seq"===t.timeContainer?t.sets[l].end:Math.max(s,t.sets[l].end),u=t.sets[l];if("contents"in t)for(var c in t.contents)a(e,t.contents[c],u,t),s="seq"===t.timeContainer?t.contents[c].end:Math.max(s,t.contents[c].end),u=t.contents[c];else s=i?t.begin:Number.POSITIVE_INFINITY;null!==t.explicit_end&&null!==t.explicit_dur?t.end=Math.min(t.begin+t.explicit_dur,o+t.explicit_end):null===t.explicit_end&&null!==t.explicit_dur?t.end=t.begin+t.explicit_dur:null!==t.explicit_end&&null===t.explicit_dur?t.end=o+t.explicit_end:t.end=s,delete t.explicit_begin,delete t.explicit_dur,delete t.explicit_end,e._registerEvent(t)}function o(e){this.node=e}function s(){this.events=[],this.head=null,this.body=null}function u(){this.styling=null,this.layout=null}function l(){this.styles={}}function c(){this.id=null,this.styleAttrs=null,this.styleRefs=null}function f(){this.regions={}}function d(e){this.kind=e}function h(e){this.id=e}function p(e){this.regionID=e}function g(e){this.styleAttrs=e}function m(e){this.sets=e}function y(e){this.contents=e}function E(e,t,n){this.explicit_begin=e,this.explicit_end=t,this.explicit_dur=n}function _(){d.call(this,"body")}function v(){d.call(this,"div")}function T(){d.call(this,"p")}function S(){d.call(this,"span")}function A(){d.call(this,"span")}function b(){d.call(this,"br")}function I(){}function R(){}function N(e){return e&&"xml:id"in e.attributes&&e.attributes["xml:id"].value||null}function w(e){return e&&"style"in e.attributes?e.attributes.style.value.split(" "):[]}function C(e,t){var n={};if(null!==e)for(var i in e.attributes){var a=e.attributes[i].uri+" "+e.attributes[i].local,o=r.byQName[a];if(void 0!==o){var s=o.parse(e.attributes[i].value);null!==s?(n[a]=s,o===r.byName.zIndex&&F(t,"zIndex attribute present but not used by IMSC1 since regions do not overlap")):x(t,"Cannot parse styling attribute "+a+" --\x3e "+e.attributes[i].value)}}return n}function D(e,t,n){for(var r in e.attributes)if(e.attributes[r].uri===t&&e.attributes[r].local===n)return e.attributes[r].value;return null}function O(e,t,n){var r,i=null;return null!==(r=/^(\d+(?:\.\d+)?)f$/.exec(n))?null!==t&&(i=parseFloat(r[1])/t):null!==(r=/^(\d+(?:\.\d+)?)t$/.exec(n))?null!==e&&(i=parseFloat(r[1])/e):null!==(r=/^(\d+(?:\.\d+)?)ms$/.exec(n))?i=parseFloat(r[1])/1e3:null!==(r=/^(\d+(?:\.\d+)?)s$/.exec(n))?i=parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)h$/.exec(n))?i=3600*parseFloat(r[1]):null!==(r=/^(\d+(?:\.\d+)?)m$/.exec(n))?i=60*parseFloat(r[1]):null!==(r=/^(\d{2,}):(\d\d):(\d\d(?:\.\d+)?)$/.exec(n))?i=3600*parseInt(r[1])+60*parseInt(r[2])+parseFloat(r[3]):null!==(r=/^(\d{2,}):(\d\d):(\d\d)\:(\d{2,})$/.exec(n))&&null!==t&&(i=3600*parseInt(r[1])+60*parseInt(r[2])+parseInt(r[3])+(null===r[4]?0:parseInt(r[4])/t)),i}function M(e,t,n){for(;t.styleRefs.length>0;){var r=t.styleRefs.pop();r in e.styles?(M(e,e.styles[r],n),L(e.styles[r].styleAttrs,t.styleAttrs)):x(n,"Non-existant style id referenced")}}function P(e,t,n,r){for(var i=t.length-1;i>=0;i--){var a=t[i];a in e.styles?L(e.styles[a].styleAttrs,n):x(r,"Non-existant style id referenced")}}function L(e,t){for(var n in e)n in t||(t[n]=e[n])}function F(e,t){if(e&&e.warn&&e.warn(t))throw t}function x(e,t){if(e&&e.error&&e.error(t))throw t}function U(e,t){throw e&&e.fatal&&e.fatal(t),t}function B(e,t){for(var n,r=0,i=e.length-1;r<=i;){var a=e[n=Math.floor((r+i)/2)];if(at))return{found:!0,index:n};i=n-1}}return{found:!1,index:r}}e.fromXML=function(e,r,i){var d=t.parser(!0,{xmlns:!0}),h=[],p=[],g=[],m=0,y=null;d.onclosetag=function(e){if(h[0]instanceof l)for(var t in h[0].styles)M(h[0],h[0].styles[t],r);else if(h[0]instanceof T||h[0]instanceof S){if(h[0].contents.length>1){var a,s=[h[0].contents[0]];for(a=1;a0&&i&&"onCloseTag"in i&&i.onCloseTag());g.shift(),p.shift(),h.shift()},d.ontext=function(e){if(void 0===h[0]);else if(h[0]instanceof S||h[0]instanceof T){var t=new A;t.initFromText(y,h[0],e,g[0],r),h[0].contents.push(t)}else h[0]instanceof o&&m>0&&i&&"onText"in i&&i.onText(e)},d.onopentag=function(e){var t=e.attributes["xml:space"];t?g.unshift(t.value):0===g.length?g.unshift("default"):g.unshift(g[0]);var a=e.attributes["xml:lang"];if(a?p.unshift(a.value):0===p.length?p.unshift(""):p.unshift(p[0]),e.uri===n.ns_tt)if("tt"===e.local)null!==y&&U(r,"Two elements at ("+this.line+","+this.column+")"),(y=new s).initFromNode(e,r),h.unshift(y);else if("head"===e.local)h[0]instanceof s||U(r,"Parent of element is not at ("+this.line+","+this.column+")"),null!==y.head&&U("Second element at ("+this.line+","+this.column+")"),y.head=new u,h.unshift(y.head);else if("styling"===e.local)h[0]instanceof u||U(r,"Parent of element is not at ("+this.line+","+this.column+")"),null!==y.head.styling&&U("Second element at ("+this.line+","+this.column+")"),y.head.styling=new l,h.unshift(y.head.styling);else if("style"===e.local){var d;h[0]instanceof l?((d=new c).initFromNode(e,r),d.id?y.head.styling.styles[d.id]=d:x(r,"" ).appendTo( body ); + } + + // We need to make sure to grab the zIndex before setting the + // opacity, because setting the opacity to anything lower than 1 + // causes the zIndex to change from "auto" to 0. + if ( o.zIndex ) { // zIndex option + if ( this.helper.css( "zIndex" ) ) { + this._storedZIndex = this.helper.css( "zIndex" ); + } + this.helper.css( "zIndex", o.zIndex ); + } + + if ( o.opacity ) { // opacity option + if ( this.helper.css( "opacity" ) ) { + this._storedOpacity = this.helper.css( "opacity" ); + } + this.helper.css( "opacity", o.opacity ); + } + + //Prepare scrolling + if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && + this.scrollParent[ 0 ].tagName !== "HTML" ) { + this.overflowOffset = this.scrollParent.offset(); + } + + //Call callbacks + this._trigger( "start", event, this._uiHash() ); + + //Recache the helper size + if ( !this._preserveHelperProportions ) { + this._cacheHelperProportions(); + } + + //Post "activate" events to possible containers + if ( !noActivation ) { + for ( i = this.containers.length - 1; i >= 0; i-- ) { + this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) ); + } + } + + //Prepare possible droppables + if ( $.ui.ddmanager ) { + $.ui.ddmanager.current = this; + } + + if ( $.ui.ddmanager && !o.dropBehaviour ) { + $.ui.ddmanager.prepareOffsets( this, event ); + } + + this.dragging = true; + + this._addClass( this.helper, "ui-sortable-helper" ); + + //Move the helper, if needed + if ( !this.helper.parent().is( this.appendTo ) ) { + this.helper.detach().appendTo( this.appendTo ); + + //Update position + this.offset.parent = this._getParentOffset(); + } + + //Generate the original position + this.position = this.originalPosition = this._generatePosition( event ); + this.originalPageX = event.pageX; + this.originalPageY = event.pageY; + this.lastPositionAbs = this.positionAbs = this._convertPositionTo( "absolute" ); + + this._mouseDrag( event ); + + return true; + + }, + + _scroll: function( event ) { + var o = this.options, + scrolled = false; + + if ( this.scrollParent[ 0 ] !== this.document[ 0 ] && + this.scrollParent[ 0 ].tagName !== "HTML" ) { + + if ( ( this.overflowOffset.top + this.scrollParent[ 0 ].offsetHeight ) - + event.pageY < o.scrollSensitivity ) { + this.scrollParent[ 0 ].scrollTop = + scrolled = this.scrollParent[ 0 ].scrollTop + o.scrollSpeed; + } else if ( event.pageY - this.overflowOffset.top < o.scrollSensitivity ) { + this.scrollParent[ 0 ].scrollTop = + scrolled = this.scrollParent[ 0 ].scrollTop - o.scrollSpeed; + } + + if ( ( this.overflowOffset.left + this.scrollParent[ 0 ].offsetWidth ) - + event.pageX < o.scrollSensitivity ) { + this.scrollParent[ 0 ].scrollLeft = scrolled = + this.scrollParent[ 0 ].scrollLeft + o.scrollSpeed; + } else if ( event.pageX - this.overflowOffset.left < o.scrollSensitivity ) { + this.scrollParent[ 0 ].scrollLeft = scrolled = + this.scrollParent[ 0 ].scrollLeft - o.scrollSpeed; + } + + } else { + + if ( event.pageY - this.document.scrollTop() < o.scrollSensitivity ) { + scrolled = this.document.scrollTop( this.document.scrollTop() - o.scrollSpeed ); + } else if ( this.window.height() - ( event.pageY - this.document.scrollTop() ) < + o.scrollSensitivity ) { + scrolled = this.document.scrollTop( this.document.scrollTop() + o.scrollSpeed ); + } + + if ( event.pageX - this.document.scrollLeft() < o.scrollSensitivity ) { + scrolled = this.document.scrollLeft( + this.document.scrollLeft() - o.scrollSpeed + ); + } else if ( this.window.width() - ( event.pageX - this.document.scrollLeft() ) < + o.scrollSensitivity ) { + scrolled = this.document.scrollLeft( + this.document.scrollLeft() + o.scrollSpeed + ); + } + + } + + return scrolled; + }, + + _mouseDrag: function( event ) { + var i, item, itemElement, intersection, + o = this.options; + + //Compute the helpers position + this.position = this._generatePosition( event ); + this.positionAbs = this._convertPositionTo( "absolute" ); + + //Set the helper position + if ( !this.options.axis || this.options.axis !== "y" ) { + this.helper[ 0 ].style.left = this.position.left + "px"; + } + if ( !this.options.axis || this.options.axis !== "x" ) { + this.helper[ 0 ].style.top = this.position.top + "px"; + } + + //Do scrolling + if ( o.scroll ) { + if ( this._scroll( event ) !== false ) { + + //Update item positions used in position checks + this._refreshItemPositions( true ); + + if ( $.ui.ddmanager && !o.dropBehaviour ) { + $.ui.ddmanager.prepareOffsets( this, event ); + } + } + } + + this.dragDirection = { + vertical: this._getDragVerticalDirection(), + horizontal: this._getDragHorizontalDirection() + }; + + //Rearrange + for ( i = this.items.length - 1; i >= 0; i-- ) { + + //Cache variables and intersection, continue if no intersection + item = this.items[ i ]; + itemElement = item.item[ 0 ]; + intersection = this._intersectsWithPointer( item ); + if ( !intersection ) { + continue; + } + + // Only put the placeholder inside the current Container, skip all + // items from other containers. This works because when moving + // an item from one container to another the + // currentContainer is switched before the placeholder is moved. + // + // Without this, moving items in "sub-sortables" can cause + // the placeholder to jitter between the outer and inner container. + if ( item.instance !== this.currentContainer ) { + continue; + } + + // Cannot intersect with itself + // no useless actions that have been done before + // no action if the item moved is the parent of the item checked + if ( itemElement !== this.currentItem[ 0 ] && + this.placeholder[ intersection === 1 ? + "next" : "prev" ]()[ 0 ] !== itemElement && + !$.contains( this.placeholder[ 0 ], itemElement ) && + ( this.options.type === "semi-dynamic" ? + !$.contains( this.element[ 0 ], itemElement ) : + true + ) + ) { + + this.direction = intersection === 1 ? "down" : "up"; + + if ( this.options.tolerance === "pointer" || + this._intersectsWithSides( item ) ) { + this._rearrange( event, item ); + } else { + break; + } + + this._trigger( "change", event, this._uiHash() ); + break; + } + } + + //Post events to containers + this._contactContainers( event ); + + //Interconnect with droppables + if ( $.ui.ddmanager ) { + $.ui.ddmanager.drag( this, event ); + } + + //Call callbacks + this._trigger( "sort", event, this._uiHash() ); + + this.lastPositionAbs = this.positionAbs; + return false; + + }, + + _mouseStop: function( event, noPropagation ) { + + if ( !event ) { + return; + } + + //If we are using droppables, inform the manager about the drop + if ( $.ui.ddmanager && !this.options.dropBehaviour ) { + $.ui.ddmanager.drop( this, event ); + } + + if ( this.options.revert ) { + var that = this, + cur = this.placeholder.offset(), + axis = this.options.axis, + animation = {}; + + if ( !axis || axis === "x" ) { + animation.left = cur.left - this.offset.parent.left - this.margins.left + + ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? + 0 : + this.offsetParent[ 0 ].scrollLeft + ); + } + if ( !axis || axis === "y" ) { + animation.top = cur.top - this.offset.parent.top - this.margins.top + + ( this.offsetParent[ 0 ] === this.document[ 0 ].body ? + 0 : + this.offsetParent[ 0 ].scrollTop + ); + } + this.reverting = true; + $( this.helper ).animate( + animation, + parseInt( this.options.revert, 10 ) || 500, + function() { + that._clear( event ); + } + ); + } else { + this._clear( event, noPropagation ); + } + + return false; + + }, + + cancel: function() { + + if ( this.dragging ) { + + this._mouseUp( new $.Event( "mouseup", { target: null } ) ); + + if ( this.options.helper === "original" ) { + this.currentItem.css( this._storedCSS ); + this._removeClass( this.currentItem, "ui-sortable-helper" ); + } else { + this.currentItem.show(); + } + + //Post deactivating events to containers + for ( var i = this.containers.length - 1; i >= 0; i-- ) { + this.containers[ i ]._trigger( "deactivate", null, this._uiHash( this ) ); + if ( this.containers[ i ].containerCache.over ) { + this.containers[ i ]._trigger( "out", null, this._uiHash( this ) ); + this.containers[ i ].containerCache.over = 0; + } + } + + } + + if ( this.placeholder ) { + + //$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, + // it unbinds ALL events from the original node! + if ( this.placeholder[ 0 ].parentNode ) { + this.placeholder[ 0 ].parentNode.removeChild( this.placeholder[ 0 ] ); + } + if ( this.options.helper !== "original" && this.helper && + this.helper[ 0 ].parentNode ) { + this.helper.remove(); + } + + $.extend( this, { + helper: null, + dragging: false, + reverting: false, + _noFinalSort: null + } ); + + if ( this.domPosition.prev ) { + $( this.domPosition.prev ).after( this.currentItem ); + } else { + $( this.domPosition.parent ).prepend( this.currentItem ); + } + } + + return this; + + }, + + serialize: function( o ) { + + var items = this._getItemsAsjQuery( o && o.connected ), + str = []; + o = o || {}; + + $( items ).each( function() { + var res = ( $( o.item || this ).attr( o.attribute || "id" ) || "" ) + .match( o.expression || ( /(.+)[\-=_](.+)/ ) ); + if ( res ) { + str.push( + ( o.key || res[ 1 ] + "[]" ) + + "=" + ( o.key && o.expression ? res[ 1 ] : res[ 2 ] ) ); + } + } ); + + if ( !str.length && o.key ) { + str.push( o.key + "=" ); + } + + return str.join( "&" ); + + }, + + toArray: function( o ) { + + var items = this._getItemsAsjQuery( o && o.connected ), + ret = []; + + o = o || {}; + + items.each( function() { + ret.push( $( o.item || this ).attr( o.attribute || "id" ) || "" ); + } ); + return ret; + + }, + + /* Be careful with the following core functions */ + _intersectsWith: function( item ) { + + var x1 = this.positionAbs.left, + x2 = x1 + this.helperProportions.width, + y1 = this.positionAbs.top, + y2 = y1 + this.helperProportions.height, + l = item.left, + r = l + item.width, + t = item.top, + b = t + item.height, + dyClick = this.offset.click.top, + dxClick = this.offset.click.left, + isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && + ( y1 + dyClick ) < b ), + isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && + ( x1 + dxClick ) < r ), + isOverElement = isOverElementHeight && isOverElementWidth; + + if ( this.options.tolerance === "pointer" || + this.options.forcePointerForContainers || + ( this.options.tolerance !== "pointer" && + this.helperProportions[ this.floating ? "width" : "height" ] > + item[ this.floating ? "width" : "height" ] ) + ) { + return isOverElement; + } else { + + return ( l < x1 + ( this.helperProportions.width / 2 ) && // Right Half + x2 - ( this.helperProportions.width / 2 ) < r && // Left Half + t < y1 + ( this.helperProportions.height / 2 ) && // Bottom Half + y2 - ( this.helperProportions.height / 2 ) < b ); // Top Half + + } + }, + + _intersectsWithPointer: function( item ) { + var verticalDirection, horizontalDirection, + isOverElementHeight = ( this.options.axis === "x" ) || + this._isOverAxis( + this.positionAbs.top + this.offset.click.top, item.top, item.height ), + isOverElementWidth = ( this.options.axis === "y" ) || + this._isOverAxis( + this.positionAbs.left + this.offset.click.left, item.left, item.width ), + isOverElement = isOverElementHeight && isOverElementWidth; + + if ( !isOverElement ) { + return false; + } + + verticalDirection = this.dragDirection.vertical; + horizontalDirection = this.dragDirection.horizontal; + + return this.floating ? + ( ( horizontalDirection === "right" || verticalDirection === "down" ) ? 2 : 1 ) : + ( verticalDirection && ( verticalDirection === "down" ? 2 : 1 ) ); + + }, + + _intersectsWithSides: function( item ) { + + var isOverBottomHalf = this._isOverAxis( this.positionAbs.top + + this.offset.click.top, item.top + ( item.height / 2 ), item.height ), + isOverRightHalf = this._isOverAxis( this.positionAbs.left + + this.offset.click.left, item.left + ( item.width / 2 ), item.width ), + verticalDirection = this.dragDirection.vertical, + horizontalDirection = this.dragDirection.horizontal; + + if ( this.floating && horizontalDirection ) { + return ( ( horizontalDirection === "right" && isOverRightHalf ) || + ( horizontalDirection === "left" && !isOverRightHalf ) ); + } else { + return verticalDirection && ( ( verticalDirection === "down" && isOverBottomHalf ) || + ( verticalDirection === "up" && !isOverBottomHalf ) ); + } + + }, + + _getDragVerticalDirection: function() { + var delta = this.positionAbs.top - this.lastPositionAbs.top; + return delta !== 0 && ( delta > 0 ? "down" : "up" ); + }, + + _getDragHorizontalDirection: function() { + var delta = this.positionAbs.left - this.lastPositionAbs.left; + return delta !== 0 && ( delta > 0 ? "right" : "left" ); + }, + + refresh: function( event ) { + this._refreshItems( event ); + this._setHandleClassName(); + this.refreshPositions(); + return this; + }, + + _connectWith: function() { + var options = this.options; + return options.connectWith.constructor === String ? + [ options.connectWith ] : + options.connectWith; + }, + + _getItemsAsjQuery: function( connected ) { + + var i, j, cur, inst, + items = [], + queries = [], + connectWith = this._connectWith(); + + if ( connectWith && connected ) { + for ( i = connectWith.length - 1; i >= 0; i-- ) { + cur = $( connectWith[ i ], this.document[ 0 ] ); + for ( j = cur.length - 1; j >= 0; j-- ) { + inst = $.data( cur[ j ], this.widgetFullName ); + if ( inst && inst !== this && !inst.options.disabled ) { + queries.push( [ typeof inst.options.items === "function" ? + inst.options.items.call( inst.element ) : + $( inst.options.items, inst.element ) + .not( ".ui-sortable-helper" ) + .not( ".ui-sortable-placeholder" ), inst ] ); + } + } + } + } + + queries.push( [ typeof this.options.items === "function" ? + this.options.items + .call( this.element, null, { options: this.options, item: this.currentItem } ) : + $( this.options.items, this.element ) + .not( ".ui-sortable-helper" ) + .not( ".ui-sortable-placeholder" ), this ] ); + + function addItems() { + items.push( this ); + } + for ( i = queries.length - 1; i >= 0; i-- ) { + queries[ i ][ 0 ].each( addItems ); + } + + return $( items ); + + }, + + _removeCurrentsFromItems: function() { + + var list = this.currentItem.find( ":data(" + this.widgetName + "-item)" ); + + this.items = $.grep( this.items, function( item ) { + for ( var j = 0; j < list.length; j++ ) { + if ( list[ j ] === item.item[ 0 ] ) { + return false; + } + } + return true; + } ); + + }, + + _refreshItems: function( event ) { + + this.items = []; + this.containers = [ this ]; + + var i, j, cur, inst, targetData, _queries, item, queriesLength, + items = this.items, + queries = [ [ typeof this.options.items === "function" ? + this.options.items.call( this.element[ 0 ], event, { item: this.currentItem } ) : + $( this.options.items, this.element ), this ] ], + connectWith = this._connectWith(); + + //Shouldn't be run the first time through due to massive slow-down + if ( connectWith && this.ready ) { + for ( i = connectWith.length - 1; i >= 0; i-- ) { + cur = $( connectWith[ i ], this.document[ 0 ] ); + for ( j = cur.length - 1; j >= 0; j-- ) { + inst = $.data( cur[ j ], this.widgetFullName ); + if ( inst && inst !== this && !inst.options.disabled ) { + queries.push( [ typeof inst.options.items === "function" ? + inst.options.items + .call( inst.element[ 0 ], event, { item: this.currentItem } ) : + $( inst.options.items, inst.element ), inst ] ); + this.containers.push( inst ); + } + } + } + } + + for ( i = queries.length - 1; i >= 0; i-- ) { + targetData = queries[ i ][ 1 ]; + _queries = queries[ i ][ 0 ]; + + for ( j = 0, queriesLength = _queries.length; j < queriesLength; j++ ) { + item = $( _queries[ j ] ); + + // Data for target checking (mouse manager) + item.data( this.widgetName + "-item", targetData ); + + items.push( { + item: item, + instance: targetData, + width: 0, height: 0, + left: 0, top: 0 + } ); + } + } + + }, + + _refreshItemPositions: function( fast ) { + var i, item, t, p; + + for ( i = this.items.length - 1; i >= 0; i-- ) { + item = this.items[ i ]; + + //We ignore calculating positions of all connected containers when we're not over them + if ( this.currentContainer && item.instance !== this.currentContainer && + item.item[ 0 ] !== this.currentItem[ 0 ] ) { + continue; + } + + t = this.options.toleranceElement ? + $( this.options.toleranceElement, item.item ) : + item.item; + + if ( !fast ) { + item.width = t.outerWidth(); + item.height = t.outerHeight(); + } + + p = t.offset(); + item.left = p.left; + item.top = p.top; + } + }, + + refreshPositions: function( fast ) { + + // Determine whether items are being displayed horizontally + this.floating = this.items.length ? + this.options.axis === "x" || this._isFloating( this.items[ 0 ].item ) : + false; + + // This has to be redone because due to the item being moved out/into the offsetParent, + // the offsetParent's position will change + if ( this.offsetParent && this.helper ) { + this.offset.parent = this._getParentOffset(); + } + + this._refreshItemPositions( fast ); + + var i, p; + + if ( this.options.custom && this.options.custom.refreshContainers ) { + this.options.custom.refreshContainers.call( this ); + } else { + for ( i = this.containers.length - 1; i >= 0; i-- ) { + p = this.containers[ i ].element.offset(); + this.containers[ i ].containerCache.left = p.left; + this.containers[ i ].containerCache.top = p.top; + this.containers[ i ].containerCache.width = + this.containers[ i ].element.outerWidth(); + this.containers[ i ].containerCache.height = + this.containers[ i ].element.outerHeight(); + } + } + + return this; + }, + + _createPlaceholder: function( that ) { + that = that || this; + var className, nodeName, + o = that.options; + + if ( !o.placeholder || o.placeholder.constructor === String ) { + className = o.placeholder; + nodeName = that.currentItem[ 0 ].nodeName.toLowerCase(); + o.placeholder = { + element: function() { + + var element = $( "<" + nodeName + ">", that.document[ 0 ] ); + + that._addClass( element, "ui-sortable-placeholder", + className || that.currentItem[ 0 ].className ) + ._removeClass( element, "ui-sortable-helper" ); + + if ( nodeName === "tbody" ) { + that._createTrPlaceholder( + that.currentItem.find( "tr" ).eq( 0 ), + $( "
s above, but they're unlikely to + // be the correct height on their own if the row heights are dynamic, so we'll + // always assign the height of the dragged item given forcePlaceholderSize + // is true. + if ( !p.height() || ( o.forcePlaceholderSize && + ( nodeName === "tbody" || nodeName === "tr" ) ) ) { + p.height( + that.currentItem.innerHeight() - + parseInt( that.currentItem.css( "paddingTop" ) || 0, 10 ) - + parseInt( that.currentItem.css( "paddingBottom" ) || 0, 10 ) ); + } + if ( !p.width() ) { + p.width( + that.currentItem.innerWidth() - + parseInt( that.currentItem.css( "paddingLeft" ) || 0, 10 ) - + parseInt( that.currentItem.css( "paddingRight" ) || 0, 10 ) ); + } + } + }; + } + + //Create the placeholder + that.placeholder = $( o.placeholder.element.call( that.element, that.currentItem ) ); + + //Append it after the actual current item + that.currentItem.after( that.placeholder ); + + //Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317) + o.placeholder.update( that, that.placeholder ); + + }, + + _createTrPlaceholder: function( sourceTr, targetTr ) { + var that = this; + + sourceTr.children().each( function() { + $( " 
" + + ""; + thead = ( showWeek ? "" : "" ); + for ( dow = 0; dow < 7; dow++ ) { // days of the week + day = ( dow + firstDay ) % 7; + thead += ""; + } + calender += thead + ""; + daysInMonth = this._getDaysInMonth( drawYear, drawMonth ); + if ( drawYear === inst.selectedYear && drawMonth === inst.selectedMonth ) { + inst.selectedDay = Math.min( inst.selectedDay, daysInMonth ); + } + leadDays = ( this._getFirstDayOfMonth( drawYear, drawMonth ) - firstDay + 7 ) % 7; + curRows = Math.ceil( ( leadDays + daysInMonth ) / 7 ); // calculate the number of rows to generate + numRows = ( isMultiMonth ? this.maxRows > curRows ? this.maxRows : curRows : curRows ); //If multiple months, use the higher number of rows (see #7043) + this.maxRows = numRows; + printDate = this._daylightSavingAdjust( new Date( drawYear, drawMonth, 1 - leadDays ) ); + for ( dRow = 0; dRow < numRows; dRow++ ) { // create date picker rows + calender += ""; + tbody = ( !showWeek ? "" : "" ); + for ( dow = 0; dow < 7; dow++ ) { // create date picker days + daySettings = ( beforeShowDay ? + beforeShowDay.apply( ( inst.input ? inst.input[ 0 ] : null ), [ printDate ] ) : [ true, "" ] ); + otherMonth = ( printDate.getMonth() !== drawMonth ); + unselectable = ( otherMonth && !selectOtherMonths ) || !daySettings[ 0 ] || + ( minDate && printDate < minDate ) || ( maxDate && printDate > maxDate ); + tbody += ""; // display selectable date + printDate.setDate( printDate.getDate() + 1 ); + printDate = this._daylightSavingAdjust( printDate ); + } + calender += tbody + ""; + } + drawMonth++; + if ( drawMonth > 11 ) { + drawMonth = 0; + drawYear++; + } + calender += "
" + this._get( inst, "weekHeader" ) + "= 5 ? " class='ui-datepicker-week-end'" : "" ) + ">" + + "" + dayNamesMin[ day ] + "
" + + this._get( inst, "calculateWeek" )( printDate ) + "" + // actions + ( otherMonth && !showOtherMonths ? " " : // display for other months + ( unselectable ? "" + printDate.getDate() + "" : "" + printDate.getDate() + "" ) ) + "
" + ( isMultiMonth ? "" + + ( ( numMonths[ 0 ] > 0 && col === numMonths[ 1 ] - 1 ) ? "
" : "" ) : "" ); + group += calender; + } + html += group; + } + html += buttonPanel; + inst._keyEvent = false; + return html; + }, + + /* Generate the month and year header. */ + _generateMonthYearHeader: function( inst, drawMonth, drawYear, minDate, maxDate, + secondary, monthNames, monthNamesShort ) { + + var inMinYear, inMaxYear, month, years, thisYear, determineYear, year, endYear, + changeMonth = this._get( inst, "changeMonth" ), + changeYear = this._get( inst, "changeYear" ), + showMonthAfterYear = this._get( inst, "showMonthAfterYear" ), + selectMonthLabel = this._get( inst, "selectMonthLabel" ), + selectYearLabel = this._get( inst, "selectYearLabel" ), + html = "
", + monthHtml = ""; + + // Month selection + if ( secondary || !changeMonth ) { + monthHtml += "" + monthNames[ drawMonth ] + ""; + } else { + inMinYear = ( minDate && minDate.getFullYear() === drawYear ); + inMaxYear = ( maxDate && maxDate.getFullYear() === drawYear ); + monthHtml += ""; + } + + if ( !showMonthAfterYear ) { + html += monthHtml + ( secondary || !( changeMonth && changeYear ) ? " " : "" ); + } + + // Year selection + if ( !inst.yearshtml ) { + inst.yearshtml = ""; + if ( secondary || !changeYear ) { + html += "" + drawYear + ""; + } else { + + // determine range of years to display + years = this._get( inst, "yearRange" ).split( ":" ); + thisYear = new Date().getFullYear(); + determineYear = function( value ) { + var year = ( value.match( /c[+\-].*/ ) ? drawYear + parseInt( value.substring( 1 ), 10 ) : + ( value.match( /[+\-].*/ ) ? thisYear + parseInt( value, 10 ) : + parseInt( value, 10 ) ) ); + return ( isNaN( year ) ? thisYear : year ); + }; + year = determineYear( years[ 0 ] ); + endYear = Math.max( year, determineYear( years[ 1 ] || "" ) ); + year = ( minDate ? Math.max( year, minDate.getFullYear() ) : year ); + endYear = ( maxDate ? Math.min( endYear, maxDate.getFullYear() ) : endYear ); + inst.yearshtml += ""; + + html += inst.yearshtml; + inst.yearshtml = null; + } + } + + html += this._get( inst, "yearSuffix" ); + if ( showMonthAfterYear ) { + html += ( secondary || !( changeMonth && changeYear ) ? " " : "" ) + monthHtml; + } + html += "
"; // Close datepicker_header + return html; + }, + + /* Adjust one of the date sub-fields. */ + _adjustInstDate: function( inst, offset, period ) { + var year = inst.selectedYear + ( period === "Y" ? offset : 0 ), + month = inst.selectedMonth + ( period === "M" ? offset : 0 ), + day = Math.min( inst.selectedDay, this._getDaysInMonth( year, month ) ) + ( period === "D" ? offset : 0 ), + date = this._restrictMinMax( inst, this._daylightSavingAdjust( new Date( year, month, day ) ) ); + + inst.selectedDay = date.getDate(); + inst.drawMonth = inst.selectedMonth = date.getMonth(); + inst.drawYear = inst.selectedYear = date.getFullYear(); + if ( period === "M" || period === "Y" ) { + this._notifyChange( inst ); + } + }, + + /* Ensure a date is within any min/max bounds. */ + _restrictMinMax: function( inst, date ) { + var minDate = this._getMinMaxDate( inst, "min" ), + maxDate = this._getMinMaxDate( inst, "max" ), + newDate = ( minDate && date < minDate ? minDate : date ); + return ( maxDate && newDate > maxDate ? maxDate : newDate ); + }, + + /* Notify change of month/year. */ + _notifyChange: function( inst ) { + var onChange = this._get( inst, "onChangeMonthYear" ); + if ( onChange ) { + onChange.apply( ( inst.input ? inst.input[ 0 ] : null ), + [ inst.selectedYear, inst.selectedMonth + 1, inst ] ); + } + }, + + /* Determine the number of months to show. */ + _getNumberOfMonths: function( inst ) { + var numMonths = this._get( inst, "numberOfMonths" ); + return ( numMonths == null ? [ 1, 1 ] : ( typeof numMonths === "number" ? [ 1, numMonths ] : numMonths ) ); + }, + + /* Determine the current maximum date - ensure no time components are set. */ + _getMinMaxDate: function( inst, minMax ) { + return this._determineDate( inst, this._get( inst, minMax + "Date" ), null ); + }, + + /* Find the number of days in a given month. */ + _getDaysInMonth: function( year, month ) { + return 32 - this._daylightSavingAdjust( new Date( year, month, 32 ) ).getDate(); + }, + + /* Find the day of the week of the first of a month. */ + _getFirstDayOfMonth: function( year, month ) { + return new Date( year, month, 1 ).getDay(); + }, + + /* Determines if we should allow a "next/prev" month display change. */ + _canAdjustMonth: function( inst, offset, curYear, curMonth ) { + var numMonths = this._getNumberOfMonths( inst ), + date = this._daylightSavingAdjust( new Date( curYear, + curMonth + ( offset < 0 ? offset : numMonths[ 0 ] * numMonths[ 1 ] ), 1 ) ); + + if ( offset < 0 ) { + date.setDate( this._getDaysInMonth( date.getFullYear(), date.getMonth() ) ); + } + return this._isInRange( inst, date ); + }, + + /* Is the given date in the accepted range? */ + _isInRange: function( inst, date ) { + var yearSplit, currentYear, + minDate = this._getMinMaxDate( inst, "min" ), + maxDate = this._getMinMaxDate( inst, "max" ), + minYear = null, + maxYear = null, + years = this._get( inst, "yearRange" ); + if ( years ) { + yearSplit = years.split( ":" ); + currentYear = new Date().getFullYear(); + minYear = parseInt( yearSplit[ 0 ], 10 ); + maxYear = parseInt( yearSplit[ 1 ], 10 ); + if ( yearSplit[ 0 ].match( /[+\-].*/ ) ) { + minYear += currentYear; + } + if ( yearSplit[ 1 ].match( /[+\-].*/ ) ) { + maxYear += currentYear; + } + } + + return ( ( !minDate || date.getTime() >= minDate.getTime() ) && + ( !maxDate || date.getTime() <= maxDate.getTime() ) && + ( !minYear || date.getFullYear() >= minYear ) && + ( !maxYear || date.getFullYear() <= maxYear ) ); + }, + + /* Provide the configuration settings for formatting/parsing. */ + _getFormatConfig: function( inst ) { + var shortYearCutoff = this._get( inst, "shortYearCutoff" ); + shortYearCutoff = ( typeof shortYearCutoff !== "string" ? shortYearCutoff : + new Date().getFullYear() % 100 + parseInt( shortYearCutoff, 10 ) ); + return { shortYearCutoff: shortYearCutoff, + dayNamesShort: this._get( inst, "dayNamesShort" ), dayNames: this._get( inst, "dayNames" ), + monthNamesShort: this._get( inst, "monthNamesShort" ), monthNames: this._get( inst, "monthNames" ) }; + }, + + /* Format the given date for display. */ + _formatDate: function( inst, day, month, year ) { + if ( !day ) { + inst.currentDay = inst.selectedDay; + inst.currentMonth = inst.selectedMonth; + inst.currentYear = inst.selectedYear; + } + var date = ( day ? ( typeof day === "object" ? day : + this._daylightSavingAdjust( new Date( year, month, day ) ) ) : + this._daylightSavingAdjust( new Date( inst.currentYear, inst.currentMonth, inst.currentDay ) ) ); + return this.formatDate( this._get( inst, "dateFormat" ), date, this._getFormatConfig( inst ) ); + } +} ); + +/* + * Bind hover events for datepicker elements. + * Done via delegate so the binding only occurs once in the lifetime of the parent div. + * Global datepicker_instActive, set by _updateDatepicker allows the handlers to find their way back to the active picker. + */ +function datepicker_bindHover( dpDiv ) { + var selector = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a"; + return dpDiv.on( "mouseout", selector, function() { + $( this ).removeClass( "ui-state-hover" ); + if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) { + $( this ).removeClass( "ui-datepicker-prev-hover" ); + } + if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) { + $( this ).removeClass( "ui-datepicker-next-hover" ); + } + } ) + .on( "mouseover", selector, datepicker_handleMouseover ); +} + +function datepicker_handleMouseover() { + if ( !$.datepicker._isDisabledDatepicker( datepicker_instActive.inline ? datepicker_instActive.dpDiv.parent()[ 0 ] : datepicker_instActive.input[ 0 ] ) ) { + $( this ).parents( ".ui-datepicker-calendar" ).find( "a" ).removeClass( "ui-state-hover" ); + $( this ).addClass( "ui-state-hover" ); + if ( this.className.indexOf( "ui-datepicker-prev" ) !== -1 ) { + $( this ).addClass( "ui-datepicker-prev-hover" ); + } + if ( this.className.indexOf( "ui-datepicker-next" ) !== -1 ) { + $( this ).addClass( "ui-datepicker-next-hover" ); + } + } +} + +/* jQuery extend now ignores nulls! */ +function datepicker_extendRemove( target, props ) { + $.extend( target, props ); + for ( var name in props ) { + if ( props[ name ] == null ) { + target[ name ] = props[ name ]; + } + } + return target; +} + +/* Invoke the datepicker functionality. + @param options string - a command, optionally followed by additional parameters or + Object - settings for attaching new datepicker functionality + @return jQuery object */ +$.fn.datepicker = function( options ) { + + /* Verify an empty collection wasn't passed - Fixes #6976 */ + if ( !this.length ) { + return this; + } + + /* Initialise the date picker. */ + if ( !$.datepicker.initialized ) { + $( document ).on( "mousedown", $.datepicker._checkExternalClick ); + $.datepicker.initialized = true; + } + + /* Append datepicker main container to body if not exist. */ + if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) { + $( "body" ).append( $.datepicker.dpDiv ); + } + + var otherArgs = Array.prototype.slice.call( arguments, 1 ); + if ( typeof options === "string" && ( options === "isDisabled" || options === "getDate" || options === "widget" ) ) { + return $.datepicker[ "_" + options + "Datepicker" ]. + apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) ); + } + if ( options === "option" && arguments.length === 2 && typeof arguments[ 1 ] === "string" ) { + return $.datepicker[ "_" + options + "Datepicker" ]. + apply( $.datepicker, [ this[ 0 ] ].concat( otherArgs ) ); + } + return this.each( function() { + if ( typeof options === "string" ) { + $.datepicker[ "_" + options + "Datepicker" ] + .apply( $.datepicker, [ this ].concat( otherArgs ) ); + } else { + $.datepicker._attachDatepicker( this, options ); + } + } ); +}; + +$.datepicker = new Datepicker(); // singleton instance +$.datepicker.initialized = false; +$.datepicker.uuid = new Date().getTime(); +$.datepicker.version = "1.14.1"; + +var widgetsDatepicker = $.datepicker; + + +/*! + * jQuery UI Dialog 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license */ //>>label: Dialog //>>group: Widgets //>>description: Displays customizable dialog windows. -//>>docs: http://api.jqueryui.com/dialog/ -//>>demos: http://jqueryui.com/dialog/ +//>>docs: https://api.jqueryui.com/dialog/ +//>>demos: https://jqueryui.com/dialog/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/dialog.css //>>css.theme: ../../themes/base/theme.css - $.widget( "ui.dialog", { - version: "1.12.1", + version: "1.14.1", options: { appendTo: "body", autoOpen: true, @@ -11998,6 +11938,7 @@ $.widget( "ui.dialog", { resizable: true, show: null, title: null, + uiDialogTitleHeadingLevel: 0, width: 300, // Callbacks @@ -12144,7 +12085,7 @@ $.widget( "ui.dialog", { // Hiding a focused element doesn't trigger blur in WebKit // so in case we have nothing to focus on, explicitly blur the active element // https://bugs.webkit.org/show_bug.cgi?id=47182 - $.ui.safeBlur( $.ui.safeActiveElement( this.document[ 0 ] ) ); + $( this.document[ 0 ].activeElement ).trigger( "blur" ); } this._hide( this.uiDialog, this.options.hide, function() { @@ -12188,7 +12129,7 @@ $.widget( "ui.dialog", { } this._isOpen = true; - this.opener = $( $.ui.safeActiveElement( this.document[ 0 ] ) ); + this.opener = $( this.document[ 0 ].activeElement ); this._size(); this._position(); @@ -12207,7 +12148,7 @@ $.widget( "ui.dialog", { that._trigger( "focus" ); } ); - // Track the dialog immediately upon openening in case a focus event + // Track the dialog immediately upon opening in case a focus event // somehow occurs outside of the dialog before an element inside the // dialog is focused (#10152) this._makeFocusTarget(); @@ -12243,22 +12184,18 @@ $.widget( "ui.dialog", { hasFocus.eq( 0 ).trigger( "focus" ); }, - _keepFocus: function( event ) { - function checkFocus() { - var activeElement = $.ui.safeActiveElement( this.document[ 0 ] ), - isActive = this.uiDialog[ 0 ] === activeElement || - $.contains( this.uiDialog[ 0 ], activeElement ); - if ( !isActive ) { - this._focusTabbable(); - } + _restoreTabbableFocus: function() { + var activeElement = this.document[ 0 ].activeElement, + isActive = this.uiDialog[ 0 ] === activeElement || + $.contains( this.uiDialog[ 0 ], activeElement ); + if ( !isActive ) { + this._focusTabbable(); } - event.preventDefault(); - checkFocus.call( this ); + }, - // support: IE - // IE <= 8 doesn't prevent moving focus even with event.preventDefault() - // so we check again later - this._delay( checkFocus ); + _keepFocus: function( event ) { + event.preventDefault(); + this._restoreTabbableFocus(); }, _createWrapper: function() { @@ -12268,7 +12205,8 @@ $.widget( "ui.dialog", { // Setting tabIndex makes the div focusable tabIndex: -1, - role: "dialog" + role: "dialog", + "aria-modal": this.options.modal ? "true" : null } ) .appendTo( this._appendTo() ); @@ -12287,8 +12225,8 @@ $.widget( "ui.dialog", { return; } var tabbables = this.uiDialog.find( ":tabbable" ), - first = tabbables.filter( ":first" ), - last = tabbables.filter( ":last" ); + first = tabbables.first(), + last = tabbables.last(); if ( ( event.target === last[ 0 ] || event.target === this.uiDialog[ 0 ] ) && !event.shiftKey ) { @@ -12341,9 +12279,6 @@ $.widget( "ui.dialog", { } } ); - // Support: IE - // Use type="button" to prevent enter keypresses in textboxes from closing the - // dialog in IE (#9312) this.uiDialogTitlebarClose = $( "" ) .button( { label: $( "
" ).text( this.options.closeText ).html(), @@ -12360,7 +12295,13 @@ $.widget( "ui.dialog", { } } ); - uiDialogTitle = $( "" ).uniqueId().prependTo( this.uiDialogTitlebar ); + var uiDialogHeadingLevel = Number.isInteger( this.options.uiDialogTitleHeadingLevel ) && + this.options.uiDialogTitleHeadingLevel > 0 && + this.options.uiDialogTitleHeadingLevel <= 6 ? + "h" + this.options.uiDialogTitleHeadingLevel : "span"; + + uiDialogTitle = $( "<" + uiDialogHeadingLevel + ">" ) + .uniqueId().prependTo( this.uiDialogTitlebar ); this._addClass( uiDialogTitle, "ui-dialog-title" ); this._title( uiDialogTitle ); @@ -12399,14 +12340,14 @@ $.widget( "ui.dialog", { this.uiDialogButtonPane.remove(); this.uiButtonSet.empty(); - if ( $.isEmptyObject( buttons ) || ( $.isArray( buttons ) && !buttons.length ) ) { + if ( $.isEmptyObject( buttons ) || ( Array.isArray( buttons ) && !buttons.length ) ) { this._removeClass( this.uiDialog, "ui-dialog-buttons" ); return; } $.each( buttons, function( name, props ) { var click, buttonOptions; - props = $.isFunction( props ) ? + props = typeof props === "function" ? { click: props, text: name } : props; @@ -12686,6 +12627,10 @@ $.widget( "ui.dialog", { if ( key === "title" ) { this._title( this.uiDialogTitlebar.find( ".ui-dialog-title" ) ); } + + if ( key === "modal" ) { + uiDialog.attr( "aria-modal", value ? "true" : null ); + } }, _size: function() { @@ -12781,20 +12726,19 @@ $.widget( "ui.dialog", { if ( !this.document.data( "ui-dialog-overlays" ) ) { // Prevent use of anchors and inputs - // Using _on() for an event handler shared across many instances is - // safe because the dialogs stack and must be closed in reverse order - this._on( this.document, { - focusin: function( event ) { - if ( isOpening ) { - return; - } - - if ( !this._allowInteraction( event ) ) { - event.preventDefault(); - this._trackingInstances()[ 0 ]._focusTabbable(); - } + // This doesn't use `_on()` because it is a shared event handler + // across all open modal dialogs. + this.document.on( "focusin.ui-dialog", function( event ) { + if ( isOpening ) { + return; } - } ); + + var instance = this._trackingInstances()[ 0 ]; + if ( !instance._allowInteraction( event ) ) { + event.preventDefault(); + instance._focusTabbable(); + } + }.bind( this ) ); } this.overlay = $( "
" ) @@ -12817,7 +12761,7 @@ $.widget( "ui.dialog", { var overlays = this.document.data( "ui-dialog-overlays" ) - 1; if ( !overlays ) { - this._off( this.document, "focusin" ); + this.document.off( "focusin.ui-dialog" ); this.document.removeData( "ui-dialog-overlays" ); } else { this.document.data( "ui-dialog-overlays", overlays ); @@ -12831,7 +12775,7 @@ $.widget( "ui.dialog", { // DEPRECATED // TODO: switch return back to widget declaration at top of file when this is removed -if ( $.uiBackCompat !== false ) { +if ( $.uiBackCompat === true ) { // Backcompat for dialogClass option $.widget( "ui.dialog", $.ui.dialog, { @@ -12857,510 +12801,28 @@ var widgetsDialog = $.ui.dialog; /*! - * jQuery UI Droppable 1.12.1 - * http://jqueryui.com + * jQuery UI Progressbar 1.14.1 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: Droppable -//>>group: Interactions -//>>description: Enables drop targets for draggable elements. -//>>docs: http://api.jqueryui.com/droppable/ -//>>demos: http://jqueryui.com/droppable/ - - - -$.widget( "ui.droppable", { - version: "1.12.1", - widgetEventPrefix: "drop", - options: { - accept: "*", - addClasses: true, - greedy: false, - scope: "default", - tolerance: "intersect", - - // Callbacks - activate: null, - deactivate: null, - drop: null, - out: null, - over: null - }, - _create: function() { - - var proportions, - o = this.options, - accept = o.accept; - - this.isover = false; - this.isout = true; - - this.accept = $.isFunction( accept ) ? accept : function( d ) { - return d.is( accept ); - }; - - this.proportions = function( /* valueToWrite */ ) { - if ( arguments.length ) { - - // Store the droppable's proportions - proportions = arguments[ 0 ]; - } else { - - // Retrieve or derive the droppable's proportions - return proportions ? - proportions : - proportions = { - width: this.element[ 0 ].offsetWidth, - height: this.element[ 0 ].offsetHeight - }; - } - }; - - this._addToManager( o.scope ); - - o.addClasses && this._addClass( "ui-droppable" ); - - }, - - _addToManager: function( scope ) { - - // Add the reference and positions to the manager - $.ui.ddmanager.droppables[ scope ] = $.ui.ddmanager.droppables[ scope ] || []; - $.ui.ddmanager.droppables[ scope ].push( this ); - }, - - _splice: function( drop ) { - var i = 0; - for ( ; i < drop.length; i++ ) { - if ( drop[ i ] === this ) { - drop.splice( i, 1 ); - } - } - }, - - _destroy: function() { - var drop = $.ui.ddmanager.droppables[ this.options.scope ]; - - this._splice( drop ); - }, - - _setOption: function( key, value ) { - - if ( key === "accept" ) { - this.accept = $.isFunction( value ) ? value : function( d ) { - return d.is( value ); - }; - } else if ( key === "scope" ) { - var drop = $.ui.ddmanager.droppables[ this.options.scope ]; - - this._splice( drop ); - this._addToManager( value ); - } - - this._super( key, value ); - }, - - _activate: function( event ) { - var draggable = $.ui.ddmanager.current; - - this._addActiveClass(); - if ( draggable ) { - this._trigger( "activate", event, this.ui( draggable ) ); - } - }, - - _deactivate: function( event ) { - var draggable = $.ui.ddmanager.current; - - this._removeActiveClass(); - if ( draggable ) { - this._trigger( "deactivate", event, this.ui( draggable ) ); - } - }, - - _over: function( event ) { - - var draggable = $.ui.ddmanager.current; - - // Bail if draggable and droppable are same element - if ( !draggable || ( draggable.currentItem || - draggable.element )[ 0 ] === this.element[ 0 ] ) { - return; - } - - if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || - draggable.element ) ) ) { - this._addHoverClass(); - this._trigger( "over", event, this.ui( draggable ) ); - } - - }, - - _out: function( event ) { - - var draggable = $.ui.ddmanager.current; - - // Bail if draggable and droppable are same element - if ( !draggable || ( draggable.currentItem || - draggable.element )[ 0 ] === this.element[ 0 ] ) { - return; - } - - if ( this.accept.call( this.element[ 0 ], ( draggable.currentItem || - draggable.element ) ) ) { - this._removeHoverClass(); - this._trigger( "out", event, this.ui( draggable ) ); - } - - }, - - _drop: function( event, custom ) { - - var draggable = custom || $.ui.ddmanager.current, - childrenIntersection = false; - - // Bail if draggable and droppable are same element - if ( !draggable || ( draggable.currentItem || - draggable.element )[ 0 ] === this.element[ 0 ] ) { - return false; - } - - this.element - .find( ":data(ui-droppable)" ) - .not( ".ui-draggable-dragging" ) - .each( function() { - var inst = $( this ).droppable( "instance" ); - if ( - inst.options.greedy && - !inst.options.disabled && - inst.options.scope === draggable.options.scope && - inst.accept.call( - inst.element[ 0 ], ( draggable.currentItem || draggable.element ) - ) && - intersect( - draggable, - $.extend( inst, { offset: inst.element.offset() } ), - inst.options.tolerance, event - ) - ) { - childrenIntersection = true; - return false; } - } ); - if ( childrenIntersection ) { - return false; - } - - if ( this.accept.call( this.element[ 0 ], - ( draggable.currentItem || draggable.element ) ) ) { - this._removeActiveClass(); - this._removeHoverClass(); - - this._trigger( "drop", event, this.ui( draggable ) ); - return this.element; - } - - return false; - - }, - - ui: function( c ) { - return { - draggable: ( c.currentItem || c.element ), - helper: c.helper, - position: c.position, - offset: c.positionAbs - }; - }, - - // Extension points just to make backcompat sane and avoid duplicating logic - // TODO: Remove in 1.13 along with call to it below - _addHoverClass: function() { - this._addClass( "ui-droppable-hover" ); - }, - - _removeHoverClass: function() { - this._removeClass( "ui-droppable-hover" ); - }, - - _addActiveClass: function() { - this._addClass( "ui-droppable-active" ); - }, - - _removeActiveClass: function() { - this._removeClass( "ui-droppable-active" ); - } -} ); - -var intersect = $.ui.intersect = ( function() { - function isOverAxis( x, reference, size ) { - return ( x >= reference ) && ( x < ( reference + size ) ); - } - - return function( draggable, droppable, toleranceMode, event ) { - - if ( !droppable.offset ) { - return false; - } - - var x1 = ( draggable.positionAbs || - draggable.position.absolute ).left + draggable.margins.left, - y1 = ( draggable.positionAbs || - draggable.position.absolute ).top + draggable.margins.top, - x2 = x1 + draggable.helperProportions.width, - y2 = y1 + draggable.helperProportions.height, - l = droppable.offset.left, - t = droppable.offset.top, - r = l + droppable.proportions().width, - b = t + droppable.proportions().height; - - switch ( toleranceMode ) { - case "fit": - return ( l <= x1 && x2 <= r && t <= y1 && y2 <= b ); - case "intersect": - return ( l < x1 + ( draggable.helperProportions.width / 2 ) && // Right Half - x2 - ( draggable.helperProportions.width / 2 ) < r && // Left Half - t < y1 + ( draggable.helperProportions.height / 2 ) && // Bottom Half - y2 - ( draggable.helperProportions.height / 2 ) < b ); // Top Half - case "pointer": - return isOverAxis( event.pageY, t, droppable.proportions().height ) && - isOverAxis( event.pageX, l, droppable.proportions().width ); - case "touch": - return ( - ( y1 >= t && y1 <= b ) || // Top edge touching - ( y2 >= t && y2 <= b ) || // Bottom edge touching - ( y1 < t && y2 > b ) // Surrounded vertically - ) && ( - ( x1 >= l && x1 <= r ) || // Left edge touching - ( x2 >= l && x2 <= r ) || // Right edge touching - ( x1 < l && x2 > r ) // Surrounded horizontally - ); - default: - return false; - } - }; -} )(); - -/* - This manager tracks offsets of draggables and droppables -*/ -$.ui.ddmanager = { - current: null, - droppables: { "default": [] }, - prepareOffsets: function( t, event ) { - - var i, j, - m = $.ui.ddmanager.droppables[ t.options.scope ] || [], - type = event ? event.type : null, // workaround for #2317 - list = ( t.currentItem || t.element ).find( ":data(ui-droppable)" ).addBack(); - - droppablesLoop: for ( i = 0; i < m.length; i++ ) { - - // No disabled and non-accepted - if ( m[ i ].options.disabled || ( t && !m[ i ].accept.call( m[ i ].element[ 0 ], - ( t.currentItem || t.element ) ) ) ) { - continue; - } - - // Filter out elements in the current dragged item - for ( j = 0; j < list.length; j++ ) { - if ( list[ j ] === m[ i ].element[ 0 ] ) { - m[ i ].proportions().height = 0; - continue droppablesLoop; - } - } - - m[ i ].visible = m[ i ].element.css( "display" ) !== "none"; - if ( !m[ i ].visible ) { - continue; - } - - // Activate the droppable if used directly from draggables - if ( type === "mousedown" ) { - m[ i ]._activate.call( m[ i ], event ); - } - - m[ i ].offset = m[ i ].element.offset(); - m[ i ].proportions( { - width: m[ i ].element[ 0 ].offsetWidth, - height: m[ i ].element[ 0 ].offsetHeight - } ); - - } - - }, - drop: function( draggable, event ) { - - var dropped = false; - - // Create a copy of the droppables in case the list changes during the drop (#9116) - $.each( ( $.ui.ddmanager.droppables[ draggable.options.scope ] || [] ).slice(), function() { - - if ( !this.options ) { - return; - } - if ( !this.options.disabled && this.visible && - intersect( draggable, this, this.options.tolerance, event ) ) { - dropped = this._drop.call( this, event ) || dropped; - } - - if ( !this.options.disabled && this.visible && this.accept.call( this.element[ 0 ], - ( draggable.currentItem || draggable.element ) ) ) { - this.isout = true; - this.isover = false; - this._deactivate.call( this, event ); - } - - } ); - return dropped; - - }, - dragStart: function( draggable, event ) { - - // Listen for scrolling so that if the dragging causes scrolling the position of the - // droppables can be recalculated (see #5003) - draggable.element.parentsUntil( "body" ).on( "scroll.droppable", function() { - if ( !draggable.options.refreshPositions ) { - $.ui.ddmanager.prepareOffsets( draggable, event ); - } - } ); - }, - drag: function( draggable, event ) { - - // If you have a highly dynamic page, you might try this option. It renders positions - // every time you move the mouse. - if ( draggable.options.refreshPositions ) { - $.ui.ddmanager.prepareOffsets( draggable, event ); - } - - // Run through all droppables and check their positions based on specific tolerance options - $.each( $.ui.ddmanager.droppables[ draggable.options.scope ] || [], function() { - - if ( this.options.disabled || this.greedyChild || !this.visible ) { - return; - } - - var parentInstance, scope, parent, - intersects = intersect( draggable, this, this.options.tolerance, event ), - c = !intersects && this.isover ? - "isout" : - ( intersects && !this.isover ? "isover" : null ); - if ( !c ) { - return; - } - - if ( this.options.greedy ) { - - // find droppable parents with same scope - scope = this.options.scope; - parent = this.element.parents( ":data(ui-droppable)" ).filter( function() { - return $( this ).droppable( "instance" ).options.scope === scope; - } ); - - if ( parent.length ) { - parentInstance = $( parent[ 0 ] ).droppable( "instance" ); - parentInstance.greedyChild = ( c === "isover" ); - } - } - - // We just moved into a greedy child - if ( parentInstance && c === "isover" ) { - parentInstance.isover = false; - parentInstance.isout = true; - parentInstance._out.call( parentInstance, event ); - } - - this[ c ] = true; - this[ c === "isout" ? "isover" : "isout" ] = false; - this[ c === "isover" ? "_over" : "_out" ].call( this, event ); - - // We just moved out of a greedy child - if ( parentInstance && c === "isout" ) { - parentInstance.isout = false; - parentInstance.isover = true; - parentInstance._over.call( parentInstance, event ); - } - } ); - - }, - dragStop: function( draggable, event ) { - draggable.element.parentsUntil( "body" ).off( "scroll.droppable" ); - - // Call prepareOffsets one final time since IE does not fire return scroll events when - // overflow was caused by drag (see #5003) - if ( !draggable.options.refreshPositions ) { - $.ui.ddmanager.prepareOffsets( draggable, event ); - } - } -}; - -// DEPRECATED -// TODO: switch return back to widget declaration at top of file when this is removed -if ( $.uiBackCompat !== false ) { - - // Backcompat for activeClass and hoverClass options - $.widget( "ui.droppable", $.ui.droppable, { - options: { - hoverClass: false, - activeClass: false - }, - _addActiveClass: function() { - this._super(); - if ( this.options.activeClass ) { - this.element.addClass( this.options.activeClass ); - } - }, - _removeActiveClass: function() { - this._super(); - if ( this.options.activeClass ) { - this.element.removeClass( this.options.activeClass ); - } - }, - _addHoverClass: function() { - this._super(); - if ( this.options.hoverClass ) { - this.element.addClass( this.options.hoverClass ); - } - }, - _removeHoverClass: function() { - this._super(); - if ( this.options.hoverClass ) { - this.element.removeClass( this.options.hoverClass ); - } - } - } ); -} - -var widgetsDroppable = $.ui.droppable; - - -/*! - * jQuery UI Progressbar 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: Progressbar //>>group: Widgets -// jscs:disable maximumLineLength +/* eslint-disable max-len */ //>>description: Displays a status indicator for loading state, standard percentage, and other progress indicators. -// jscs:enable maximumLineLength -//>>docs: http://api.jqueryui.com/progressbar/ -//>>demos: http://jqueryui.com/progressbar/ +/* eslint-enable max-len */ +//>>docs: https://api.jqueryui.com/progressbar/ +//>>demos: https://jqueryui.com/progressbar/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/progressbar.css //>>css.theme: ../../themes/base/theme.css - var widgetsProgressbar = $.widget( "ui.progressbar", { - version: "1.12.1", + version: "1.14.1", options: { classes: { "ui-progressbar": "ui-corner-all", @@ -13502,324 +12964,28 @@ var widgetsProgressbar = $.widget( "ui.progressbar", { /*! - * jQuery UI Selectable 1.12.1 - * http://jqueryui.com + * jQuery UI Selectmenu 1.14.1 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license - */ - -//>>label: Selectable -//>>group: Interactions -//>>description: Allows groups of elements to be selected with the mouse. -//>>docs: http://api.jqueryui.com/selectable/ -//>>demos: http://jqueryui.com/selectable/ -//>>css.structure: ../../themes/base/selectable.css - - - -var widgetsSelectable = $.widget( "ui.selectable", $.ui.mouse, { - version: "1.12.1", - options: { - appendTo: "body", - autoRefresh: true, - distance: 0, - filter: "*", - tolerance: "touch", - - // Callbacks - selected: null, - selecting: null, - start: null, - stop: null, - unselected: null, - unselecting: null - }, - _create: function() { - var that = this; - - this._addClass( "ui-selectable" ); - - this.dragged = false; - - // Cache selectee children based on filter - this.refresh = function() { - that.elementPos = $( that.element[ 0 ] ).offset(); - that.selectees = $( that.options.filter, that.element[ 0 ] ); - that._addClass( that.selectees, "ui-selectee" ); - that.selectees.each( function() { - var $this = $( this ), - selecteeOffset = $this.offset(), - pos = { - left: selecteeOffset.left - that.elementPos.left, - top: selecteeOffset.top - that.elementPos.top - }; - $.data( this, "selectable-item", { - element: this, - $element: $this, - left: pos.left, - top: pos.top, - right: pos.left + $this.outerWidth(), - bottom: pos.top + $this.outerHeight(), - startselected: false, - selected: $this.hasClass( "ui-selected" ), - selecting: $this.hasClass( "ui-selecting" ), - unselecting: $this.hasClass( "ui-unselecting" ) - } ); - } ); - }; - this.refresh(); - - this._mouseInit(); - - this.helper = $( "
" ); - this._addClass( this.helper, "ui-selectable-helper" ); - }, - - _destroy: function() { - this.selectees.removeData( "selectable-item" ); - this._mouseDestroy(); - }, - - _mouseStart: function( event ) { - var that = this, - options = this.options; - - this.opos = [ event.pageX, event.pageY ]; - this.elementPos = $( this.element[ 0 ] ).offset(); - - if ( this.options.disabled ) { - return; - } - - this.selectees = $( options.filter, this.element[ 0 ] ); - - this._trigger( "start", event ); - - $( options.appendTo ).append( this.helper ); - - // position helper (lasso) - this.helper.css( { - "left": event.pageX, - "top": event.pageY, - "width": 0, - "height": 0 - } ); - - if ( options.autoRefresh ) { - this.refresh(); - } - - this.selectees.filter( ".ui-selected" ).each( function() { - var selectee = $.data( this, "selectable-item" ); - selectee.startselected = true; - if ( !event.metaKey && !event.ctrlKey ) { - that._removeClass( selectee.$element, "ui-selected" ); - selectee.selected = false; - that._addClass( selectee.$element, "ui-unselecting" ); - selectee.unselecting = true; - - // selectable UNSELECTING callback - that._trigger( "unselecting", event, { - unselecting: selectee.element - } ); - } - } ); - - $( event.target ).parents().addBack().each( function() { - var doSelect, - selectee = $.data( this, "selectable-item" ); - if ( selectee ) { - doSelect = ( !event.metaKey && !event.ctrlKey ) || - !selectee.$element.hasClass( "ui-selected" ); - that._removeClass( selectee.$element, doSelect ? "ui-unselecting" : "ui-selected" ) - ._addClass( selectee.$element, doSelect ? "ui-selecting" : "ui-unselecting" ); - selectee.unselecting = !doSelect; - selectee.selecting = doSelect; - selectee.selected = doSelect; - - // selectable (UN)SELECTING callback - if ( doSelect ) { - that._trigger( "selecting", event, { - selecting: selectee.element - } ); - } else { - that._trigger( "unselecting", event, { - unselecting: selectee.element - } ); - } - return false; - } - } ); - - }, - - _mouseDrag: function( event ) { - - this.dragged = true; - - if ( this.options.disabled ) { - return; - } - - var tmp, - that = this, - options = this.options, - x1 = this.opos[ 0 ], - y1 = this.opos[ 1 ], - x2 = event.pageX, - y2 = event.pageY; - - if ( x1 > x2 ) { tmp = x2; x2 = x1; x1 = tmp; } - if ( y1 > y2 ) { tmp = y2; y2 = y1; y1 = tmp; } - this.helper.css( { left: x1, top: y1, width: x2 - x1, height: y2 - y1 } ); - - this.selectees.each( function() { - var selectee = $.data( this, "selectable-item" ), - hit = false, - offset = {}; - - //prevent helper from being selected if appendTo: selectable - if ( !selectee || selectee.element === that.element[ 0 ] ) { - return; - } - - offset.left = selectee.left + that.elementPos.left; - offset.right = selectee.right + that.elementPos.left; - offset.top = selectee.top + that.elementPos.top; - offset.bottom = selectee.bottom + that.elementPos.top; - - if ( options.tolerance === "touch" ) { - hit = ( !( offset.left > x2 || offset.right < x1 || offset.top > y2 || - offset.bottom < y1 ) ); - } else if ( options.tolerance === "fit" ) { - hit = ( offset.left > x1 && offset.right < x2 && offset.top > y1 && - offset.bottom < y2 ); - } - - if ( hit ) { - - // SELECT - if ( selectee.selected ) { - that._removeClass( selectee.$element, "ui-selected" ); - selectee.selected = false; - } - if ( selectee.unselecting ) { - that._removeClass( selectee.$element, "ui-unselecting" ); - selectee.unselecting = false; - } - if ( !selectee.selecting ) { - that._addClass( selectee.$element, "ui-selecting" ); - selectee.selecting = true; - - // selectable SELECTING callback - that._trigger( "selecting", event, { - selecting: selectee.element - } ); - } - } else { - - // UNSELECT - if ( selectee.selecting ) { - if ( ( event.metaKey || event.ctrlKey ) && selectee.startselected ) { - that._removeClass( selectee.$element, "ui-selecting" ); - selectee.selecting = false; - that._addClass( selectee.$element, "ui-selected" ); - selectee.selected = true; - } else { - that._removeClass( selectee.$element, "ui-selecting" ); - selectee.selecting = false; - if ( selectee.startselected ) { - that._addClass( selectee.$element, "ui-unselecting" ); - selectee.unselecting = true; - } - - // selectable UNSELECTING callback - that._trigger( "unselecting", event, { - unselecting: selectee.element - } ); - } - } - if ( selectee.selected ) { - if ( !event.metaKey && !event.ctrlKey && !selectee.startselected ) { - that._removeClass( selectee.$element, "ui-selected" ); - selectee.selected = false; - - that._addClass( selectee.$element, "ui-unselecting" ); - selectee.unselecting = true; - - // selectable UNSELECTING callback - that._trigger( "unselecting", event, { - unselecting: selectee.element - } ); - } - } - } - } ); - - return false; - }, - - _mouseStop: function( event ) { - var that = this; - - this.dragged = false; - - $( ".ui-unselecting", this.element[ 0 ] ).each( function() { - var selectee = $.data( this, "selectable-item" ); - that._removeClass( selectee.$element, "ui-unselecting" ); - selectee.unselecting = false; - selectee.startselected = false; - that._trigger( "unselected", event, { - unselected: selectee.element - } ); - } ); - $( ".ui-selecting", this.element[ 0 ] ).each( function() { - var selectee = $.data( this, "selectable-item" ); - that._removeClass( selectee.$element, "ui-selecting" ) - ._addClass( selectee.$element, "ui-selected" ); - selectee.selecting = false; - selectee.selected = true; - selectee.startselected = true; - that._trigger( "selected", event, { - selected: selectee.element - } ); - } ); - this._trigger( "stop", event ); - - this.helper.remove(); - - return false; - } - -} ); - - -/*! - * jQuery UI Selectmenu 1.12.1 - * http://jqueryui.com - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: Selectmenu //>>group: Widgets -// jscs:disable maximumLineLength +/* eslint-disable max-len */ //>>description: Duplicates and extends the functionality of a native HTML select element, allowing it to be customizable in behavior and appearance far beyond the limitations of a native select. -// jscs:enable maximumLineLength -//>>docs: http://api.jqueryui.com/selectmenu/ -//>>demos: http://jqueryui.com/selectmenu/ +/* eslint-enable max-len */ +//>>docs: https://api.jqueryui.com/selectmenu/ +//>>demos: https://jqueryui.com/selectmenu/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/selectmenu.css, ../../themes/base/button.css //>>css.theme: ../../themes/base/theme.css - var widgetsSelectmenu = $.widget( "ui.selectmenu", [ $.ui.formResetMixin, { - version: "1.12.1", + version: "1.14.1", defaultElement: "", widgetEventPrefix: "spin", options: { @@ -16847,11 +14452,6 @@ $.widget( "ui.spinner", { this.previous = this.element.val(); }, blur: function( event ) { - if ( this.cancelBlur ) { - delete this.cancelBlur; - return; - } - this._stop(); this._refresh(); if ( this.previous !== this.element.val() ) { @@ -16859,9 +14459,13 @@ $.widget( "ui.spinner", { } }, mousewheel: function( event, delta ) { - if ( !delta ) { + var activeElement = this.document[ 0 ].activeElement; + var isActive = this.element[ 0 ] === activeElement; + + if ( !isActive || !delta ) { return; } + if ( !this.spinning && !this._start( event ) ) { return false; } @@ -16883,20 +14487,13 @@ $.widget( "ui.spinner", { // If the input is focused then this.previous is properly set from // when the input first received focus. If the input is not focused // then we need to set this.previous based on the value before spinning. - previous = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ) ? + previous = this.element[ 0 ] === this.document[ 0 ].activeElement ? this.previous : this.element.val(); function checkFocus() { - var isActive = this.element[ 0 ] === $.ui.safeActiveElement( this.document[ 0 ] ); + var isActive = this.element[ 0 ] === this.document[ 0 ].activeElement; if ( !isActive ) { this.element.trigger( "focus" ); this.previous = previous; - - // support: IE - // IE sets focus asynchronously, so we need to check if focus - // moved off of the input because the user clicked on the button. - this._delay( function() { - this.previous = previous; - } ); } } @@ -16904,16 +14501,6 @@ $.widget( "ui.spinner", { event.preventDefault(); checkFocus.call( this ); - // Support: IE - // IE doesn't prevent moving focus even with event.preventDefault() - // so we set a flag to know when we should ignore the blur event - // and check (again) if focus moved off of the input. - this.cancelBlur = true; - this._delay( function() { - delete this.cancelBlur; - checkFocus.call( this ); - } ); - if ( this._start( event ) === false ) { return; } @@ -17059,7 +14646,7 @@ $.widget( "ui.spinner", { var incremental = this.options.incremental; if ( incremental ) { - return $.isFunction( incremental ) ? + return typeof incremental === "function" ? incremental( i ) : Math.floor( i * i * i / 50000 - i * i / 500 + 17 * i / 200 + 1 ); } @@ -17157,7 +14744,7 @@ $.widget( "ui.spinner", { this.buttons.button( value ? "disable" : "enable" ); }, - _setOptions: spinnerModifer( function( options ) { + _setOptions: spinnerModifier( function( options ) { this._super( options ); } ), @@ -17224,7 +14811,7 @@ $.widget( "ui.spinner", { this.uiSpinner.replaceWith( this.element ); }, - stepUp: spinnerModifer( function( steps ) { + stepUp: spinnerModifier( function( steps ) { this._stepUp( steps ); } ), _stepUp: function( steps ) { @@ -17234,7 +14821,7 @@ $.widget( "ui.spinner", { } }, - stepDown: spinnerModifer( function( steps ) { + stepDown: spinnerModifier( function( steps ) { this._stepDown( steps ); } ), _stepDown: function( steps ) { @@ -17244,11 +14831,11 @@ $.widget( "ui.spinner", { } }, - pageUp: spinnerModifer( function( pages ) { + pageUp: spinnerModifier( function( pages ) { this._stepUp( ( pages || 1 ) * this.options.page ); } ), - pageDown: spinnerModifer( function( pages ) { + pageDown: spinnerModifier( function( pages ) { this._stepDown( ( pages || 1 ) * this.options.page ); } ), @@ -17256,7 +14843,7 @@ $.widget( "ui.spinner", { if ( !arguments.length ) { return this._parse( this.element.val() ); } - spinnerModifer( this._value ).call( this, newVal ); + spinnerModifier( this._value ).call( this, newVal ); }, widget: function() { @@ -17266,7 +14853,7 @@ $.widget( "ui.spinner", { // DEPRECATED // TODO: switch return back to widget declaration at top of file when this is removed -if ( $.uiBackCompat !== false ) { +if ( $.uiBackCompat === true ) { // Backcompat for spinner html extension points $.widget( "ui.spinner", $.ui.spinner, { @@ -17293,27 +14880,26 @@ var widgetsSpinner = $.ui.spinner; /*! - * jQuery UI Tabs 1.12.1 - * http://jqueryui.com + * jQuery UI Tabs 1.14.1 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: Tabs //>>group: Widgets //>>description: Transforms a set of container elements into a tab structure. -//>>docs: http://api.jqueryui.com/tabs/ -//>>demos: http://jqueryui.com/tabs/ +//>>docs: https://api.jqueryui.com/tabs/ +//>>demos: https://jqueryui.com/tabs/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/tabs.css //>>css.theme: ../../themes/base/theme.css - $.widget( "ui.tabs", { - version: "1.12.1", + version: "1.14.1", delay: 300, options: { active: null, @@ -17371,8 +14957,8 @@ $.widget( "ui.tabs", { // Take disabling tabs via class attribute from HTML // into account and update option properly. - if ( $.isArray( options.disabled ) ) { - options.disabled = $.unique( options.disabled.concat( + if ( Array.isArray( options.disabled ) ) { + options.disabled = $.uniqueSort( options.disabled.concat( $.map( this.tabs.filter( ".ui-state-disabled" ), function( li ) { return that.tabs.index( li ); } ) @@ -17396,14 +14982,14 @@ $.widget( "ui.tabs", { _initialActive: function() { var active = this.options.active, collapsible = this.options.collapsible, - locationHash = location.hash.substring( 1 ); + locationHashDecoded = decodeURIComponent( location.hash.substring( 1 ) ); if ( active === null ) { // check the fragment identifier in the URL - if ( locationHash ) { + if ( locationHashDecoded ) { this.tabs.each( function( i, tab ) { - if ( $( tab ).attr( "aria-controls" ) === locationHash ) { + if ( $( tab ).attr( "aria-controls" ) === locationHashDecoded ) { active = i; return false; } @@ -17445,7 +15031,7 @@ $.widget( "ui.tabs", { }, _tabKeydown: function( event ) { - var focusedTab = $( $.ui.safeActiveElement( this.document[ 0 ] ) ).closest( "li" ), + var focusedTab = $( this.document[ 0 ].activeElement ).closest( "li" ), selectedIndex = this.tabs.index( focusedTab ), goingForward = true; @@ -17587,10 +15173,6 @@ $.widget( "ui.tabs", { } }, - _sanitizeSelector: function( hash ) { - return hash ? hash.replace( /[!"$%&'()*+,.\/:;<=>?@\[\]\^`{|}~]/g, "\\$&" ) : ""; - }, - refresh: function() { var options = this.options, lis = this.tablist.children( ":has(a[href])" ); @@ -17682,18 +15264,6 @@ $.widget( "ui.tabs", { if ( $( this ).is( ".ui-state-disabled" ) ) { event.preventDefault(); } - } ) - - // Support: IE <9 - // Preventing the default action in mousedown doesn't prevent IE - // from focusing the element, so if the anchor gets focused, blur. - // We don't have to worry about focusing the previously focused - // element since clicking on a non-focusable element should focus - // the body anyway. - .on( "focus" + this.eventNamespace, ".ui-tabs-anchor", function() { - if ( $( this ).closest( "li" ).is( ".ui-state-disabled" ) ) { - this.blur(); - } } ); this.tabs = this.tablist.find( "> li:has(a[href])" ) @@ -17707,7 +15277,6 @@ $.widget( "ui.tabs", { return $( "a", this )[ 0 ]; } ) .attr( { - role: "presentation", tabIndex: -1 } ); this._addClass( this.anchors, "ui-tabs-anchor" ); @@ -17722,9 +15291,9 @@ $.widget( "ui.tabs", { // Inline tab if ( that._isLocal( anchor ) ) { - selector = anchor.hash; + selector = decodeURIComponent( anchor.hash ); panelId = selector.substring( 1 ); - panel = that.element.find( that._sanitizeSelector( selector ) ); + panel = that.element.find( "#" + CSS.escape( panelId ) ); // remote tab } else { @@ -17779,7 +15348,7 @@ $.widget( "ui.tabs", { _setOptionDisabled: function( disabled ) { var currentItem, li, i; - if ( $.isArray( disabled ) ) { + if ( Array.isArray( disabled ) ) { if ( !disabled.length ) { disabled = false; } else if ( disabled.length === this.anchors.length ) { @@ -18010,7 +15579,7 @@ $.widget( "ui.tabs", { // meta-function to give users option to provide a href string instead of a numerical index. if ( typeof index === "string" ) { index = this.anchors.index( this.anchors.filter( "[href$='" + - $.ui.escapeSelector( index ) + "']" ) ); + CSS.escape( index ) + "']" ) ); } return index; @@ -18067,7 +15636,7 @@ $.widget( "ui.tabs", { disabled = false; } else { index = this._getIndex( index ); - if ( $.isArray( disabled ) ) { + if ( Array.isArray( disabled ) ) { disabled = $.map( disabled, function( num ) { return num !== index ? num : null; } ); @@ -18093,7 +15662,7 @@ $.widget( "ui.tabs", { if ( $.inArray( index, disabled ) !== -1 ) { return; } - if ( $.isArray( disabled ) ) { + if ( Array.isArray( disabled ) ) { disabled = $.merge( [ index ], disabled ).sort(); } else { disabled = [ index ]; @@ -18132,32 +15701,19 @@ $.widget( "ui.tabs", { this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); - // Support: jQuery <1.8 - // jQuery <1.8 returns false if the request is canceled in beforeSend, - // but as of 1.8, $.ajax() always returns a jqXHR object. - if ( this.xhr && this.xhr.statusText !== "canceled" ) { + if ( this.xhr.statusText !== "canceled" ) { this._addClass( tab, "ui-tabs-loading" ); panel.attr( "aria-busy", "true" ); this.xhr .done( function( response, status, jqXHR ) { + panel.html( response ); + that._trigger( "load", event, eventData ); - // support: jQuery <1.8 - // http://bugs.jquery.com/ticket/11778 - setTimeout( function() { - panel.html( response ); - that._trigger( "load", event, eventData ); - - complete( jqXHR, status ); - }, 1 ); + complete( jqXHR, status ); } ) .fail( function( jqXHR, status ) { - - // support: jQuery <1.8 - // http://bugs.jquery.com/ticket/11778 - setTimeout( function() { - complete( jqXHR, status ); - }, 1 ); + complete( jqXHR, status ); } ); } }, @@ -18165,10 +15721,7 @@ $.widget( "ui.tabs", { _ajaxSettings: function( anchor, event, eventData ) { var that = this; return { - - // Support: IE <11 only - // Strip any hash that exists to prevent errors with the Ajax request - url: anchor.attr( "href" ).replace( /#.*$/, "" ), + url: anchor.attr( "href" ), beforeSend: function( jqXHR, settings ) { return that._trigger( "beforeLoad", event, $.extend( { jqXHR: jqXHR, ajaxSettings: settings }, eventData ) ); @@ -18178,13 +15731,13 @@ $.widget( "ui.tabs", { _getPanelForTab: function( tab ) { var id = $( tab ).attr( "aria-controls" ); - return this.element.find( this._sanitizeSelector( "#" + id ) ); + return this.element.find( "#" + CSS.escape( id ) ); } } ); // DEPRECATED // TODO: Switch return back to widget declaration at top of file when this is removed -if ( $.uiBackCompat !== false ) { +if ( $.uiBackCompat === true ) { // Backcompat for ui-tab class (now ui-tabs-tab) $.widget( "ui.tabs", $.ui.tabs, { @@ -18199,36 +15752,32 @@ var widgetsTabs = $.ui.tabs; /*! - * jQuery UI Tooltip 1.12.1 - * http://jqueryui.com + * jQuery UI Tooltip 1.14.1 + * https://jqueryui.com * - * Copyright jQuery Foundation and other contributors + * Copyright OpenJS Foundation and other contributors * Released under the MIT license. - * http://jquery.org/license + * https://jquery.org/license */ //>>label: Tooltip //>>group: Widgets //>>description: Shows additional information for any element on hover or focus. -//>>docs: http://api.jqueryui.com/tooltip/ -//>>demos: http://jqueryui.com/tooltip/ +//>>docs: https://api.jqueryui.com/tooltip/ +//>>demos: https://jqueryui.com/tooltip/ //>>css.structure: ../../themes/base/core.css //>>css.structure: ../../themes/base/tooltip.css //>>css.theme: ../../themes/base/theme.css - $.widget( "ui.tooltip", { - version: "1.12.1", + version: "1.14.1", options: { classes: { "ui-tooltip": "ui-corner-all ui-widget-shadow" }, content: function() { - - // support: IE<9, Opera in jQuery <1.7 - // .text() can't accept undefined, so coerce to a string - var title = $( this ).attr( "title" ) || ""; + var title = $( this ).attr( "title" ); // Escape title, since we're going from an attribute to raw HTML return $( "" ).text( title ).html(); @@ -18255,7 +15804,7 @@ $.widget( "ui.tooltip", { describedby.push( id ); elem .data( "ui-tooltip-id", id ) - .attr( "aria-describedby", $.trim( describedby.join( " " ) ) ); + .attr( "aria-describedby", String.prototype.trim.call( describedby.join( " " ) ) ); }, _removeDescribedBy: function( elem ) { @@ -18268,7 +15817,7 @@ $.widget( "ui.tooltip", { } elem.removeData( "ui-tooltip-id" ); - describedby = $.trim( describedby.join( " " ) ); + describedby = String.prototype.trim.call( describedby.join( " " ) ); if ( describedby ) { elem.attr( "aria-describedby", describedby ); } else { @@ -18410,25 +15959,20 @@ $.widget( "ui.tooltip", { content = contentOption.call( target[ 0 ], function( response ) { - // IE may instantly serve a cached response for ajax requests - // delay this call to _open so the other call to _open runs first - that._delay( function() { + // Ignore async response if tooltip was closed already + if ( !target.data( "ui-tooltip-open" ) ) { + return; + } - // Ignore async response if tooltip was closed already - if ( !target.data( "ui-tooltip-open" ) ) { - return; - } - - // JQuery creates a special event for focusin when it doesn't - // exist natively. To improve performance, the native event - // object is reused and the type is changed. Therefore, we can't - // rely on the type being correct after the event finished - // bubbling, so we set it back to the previous value. (#8740) - if ( event ) { - event.type = eventType; - } - this._open( event, target, response ); - } ); + // JQuery creates a special event for focusin when it doesn't + // exist natively. To improve performance, the native event + // object is reused and the type is changed. Therefore, we can't + // rely on the type being correct after the event finished + // bubbling, so we set it back to the previous value. (#8740) + if ( event ) { + event.type = eventType; + } + that._open( event, target, response ); } ); if ( content ) { this._open( event, target, content ); @@ -18514,7 +16058,7 @@ $.widget( "ui.tooltip", { position( positionOption.of ); clearInterval( delayedShow ); } - }, $.fx.interval ); + }, 13 ); } this._trigger( "open", event, { tooltip: tooltip } ); @@ -18535,7 +16079,10 @@ $.widget( "ui.tooltip", { // tooltips will handle this in destroy. if ( target[ 0 ] !== this.element[ 0 ] ) { events.remove = function() { - this._removeTooltip( this._find( target ).tooltip ); + var targetElement = this._find( target ); + if ( targetElement ) { + this._removeTooltip( targetElement.tooltip ); + } }; } @@ -18635,6 +16182,10 @@ $.widget( "ui.tooltip", { }, _removeTooltip: function( tooltip ) { + + // Clear the interval for delayed tracking tooltips + clearInterval( this.delayedShow ); + tooltip.remove(); delete this.tooltips[ tooltip.attr( "id" ) ]; }, @@ -18681,7 +16232,7 @@ $.widget( "ui.tooltip", { // DEPRECATED // TODO: Switch return back to widget declaration at top of file when this is removed -if ( $.uiBackCompat !== false ) { +if ( $.uiBackCompat === true ) { // Backcompat for tooltipClass option $.widget( "ui.tooltip", $.ui.tooltip, { @@ -18702,5 +16253,2557 @@ var widgetsTooltip = $.ui.tooltip; +// Create a local jQuery because jQuery Color relies on it and the +// global may not exist with AMD and a custom build (#10199). +// This module is a noop if used as a regular AMD module. +// eslint-disable-next-line no-unused-vars +var jQuery = $; -})); \ No newline at end of file + +/*! + * jQuery Color Animations v3.0.0 + * https://github.com/jquery/jquery-color + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + * + * Date: Wed May 15 16:49:44 2024 +0200 + */ + + + var stepHooks = "backgroundColor borderBottomColor borderLeftColor borderRightColor " + + "borderTopColor color columnRuleColor outlineColor textDecorationColor textEmphasisColor", + + class2type = {}, + toString = class2type.toString, + + // plusequals test for += 100 -= 100 + rplusequals = /^([\-+])=\s*(\d+\.?\d*)/, + + // a set of RE's that can match strings and generate color tuples. + stringParsers = [ { + re: /rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, + parse: function( execResult ) { + return [ + execResult[ 1 ], + execResult[ 2 ], + execResult[ 3 ], + execResult[ 4 ] + ]; + } + }, { + re: /rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, + parse: function( execResult ) { + return [ + execResult[ 1 ] * 2.55, + execResult[ 2 ] * 2.55, + execResult[ 3 ] * 2.55, + execResult[ 4 ] + ]; + } + }, { + + // this regex ignores A-F because it's compared against an already lowercased string + re: /#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/, + parse: function( execResult ) { + return [ + parseInt( execResult[ 1 ], 16 ), + parseInt( execResult[ 2 ], 16 ), + parseInt( execResult[ 3 ], 16 ), + execResult[ 4 ] ? + ( parseInt( execResult[ 4 ], 16 ) / 255 ).toFixed( 2 ) : + 1 + ]; + } + }, { + + // this regex ignores A-F because it's compared against an already lowercased string + re: /#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/, + parse: function( execResult ) { + return [ + parseInt( execResult[ 1 ] + execResult[ 1 ], 16 ), + parseInt( execResult[ 2 ] + execResult[ 2 ], 16 ), + parseInt( execResult[ 3 ] + execResult[ 3 ], 16 ), + execResult[ 4 ] ? + ( parseInt( execResult[ 4 ] + execResult[ 4 ], 16 ) / 255 ) + .toFixed( 2 ) : + 1 + ]; + } + }, { + re: /hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/, + space: "hsla", + parse: function( execResult ) { + return [ + execResult[ 1 ], + execResult[ 2 ] / 100, + execResult[ 3 ] / 100, + execResult[ 4 ] + ]; + } + } ], + + // jQuery.Color( ) + color = jQuery.Color = function( color, green, blue, alpha ) { + return new jQuery.Color.fn.parse( color, green, blue, alpha ); + }, + spaces = { + rgba: { + props: { + red: { + idx: 0, + type: "byte" + }, + green: { + idx: 1, + type: "byte" + }, + blue: { + idx: 2, + type: "byte" + } + } + }, + + hsla: { + props: { + hue: { + idx: 0, + type: "degrees" + }, + saturation: { + idx: 1, + type: "percent" + }, + lightness: { + idx: 2, + type: "percent" + } + } + } + }, + propTypes = { + "byte": { + floor: true, + max: 255 + }, + "percent": { + max: 1 + }, + "degrees": { + mod: 360, + floor: true + } + }, + + // colors = jQuery.Color.names + colors, + + // local aliases of functions called often + each = jQuery.each; + +// define cache name and alpha properties +// for rgba and hsla spaces +each( spaces, function( spaceName, space ) { + space.cache = "_" + spaceName; + space.props.alpha = { + idx: 3, + type: "percent", + def: 1 + }; +} ); + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), + function( _i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); + } ); + +function getType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + return typeof obj === "object" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} + +function clamp( value, prop, allowEmpty ) { + var type = propTypes[ prop.type ] || {}; + + if ( value == null ) { + return ( allowEmpty || !prop.def ) ? null : prop.def; + } + + // ~~ is an short way of doing floor for positive numbers + value = type.floor ? ~~value : parseFloat( value ); + + if ( type.mod ) { + + // we add mod before modding to make sure that negatives values + // get converted properly: -10 -> 350 + return ( value + type.mod ) % type.mod; + } + + // for now all property types without mod have min and max + return Math.min( type.max, Math.max( 0, value ) ); +} + +function stringParse( string ) { + var inst = color(), + rgba = inst._rgba = []; + + string = string.toLowerCase(); + + each( stringParsers, function( _i, parser ) { + var parsed, + match = parser.re.exec( string ), + values = match && parser.parse( match ), + spaceName = parser.space || "rgba"; + + if ( values ) { + parsed = inst[ spaceName ]( values ); + + // if this was an rgba parse the assignment might happen twice + // oh well.... + inst[ spaces[ spaceName ].cache ] = parsed[ spaces[ spaceName ].cache ]; + rgba = inst._rgba = parsed._rgba; + + // exit each( stringParsers ) here because we matched + return false; + } + } ); + + // Found a stringParser that handled it + if ( rgba.length ) { + + // if this came from a parsed string, force "transparent" when alpha is 0 + // chrome, (and maybe others) return "transparent" as rgba(0,0,0,0) + if ( rgba.join() === "0,0,0,0" ) { + jQuery.extend( rgba, colors.transparent ); + } + return inst; + } + + // named colors + return colors[ string ]; +} + +color.fn = jQuery.extend( color.prototype, { + parse: function( red, green, blue, alpha ) { + if ( red === undefined ) { + this._rgba = [ null, null, null, null ]; + return this; + } + if ( red.jquery || red.nodeType ) { + red = jQuery( red ).css( green ); + green = undefined; + } + + var inst = this, + type = getType( red ), + rgba = this._rgba = []; + + // more than 1 argument specified - assume ( red, green, blue, alpha ) + if ( green !== undefined ) { + red = [ red, green, blue, alpha ]; + type = "array"; + } + + if ( type === "string" ) { + return this.parse( stringParse( red ) || colors._default ); + } + + if ( type === "array" ) { + each( spaces.rgba.props, function( _key, prop ) { + rgba[ prop.idx ] = clamp( red[ prop.idx ], prop ); + } ); + return this; + } + + if ( type === "object" ) { + if ( red instanceof color ) { + each( spaces, function( _spaceName, space ) { + if ( red[ space.cache ] ) { + inst[ space.cache ] = red[ space.cache ].slice(); + } + } ); + } else { + each( spaces, function( _spaceName, space ) { + var cache = space.cache; + each( space.props, function( key, prop ) { + + // if the cache doesn't exist, and we know how to convert + if ( !inst[ cache ] && space.to ) { + + // if the value was null, we don't need to copy it + // if the key was alpha, we don't need to copy it either + if ( key === "alpha" || red[ key ] == null ) { + return; + } + inst[ cache ] = space.to( inst._rgba ); + } + + // this is the only case where we allow nulls for ALL properties. + // call clamp with alwaysAllowEmpty + inst[ cache ][ prop.idx ] = clamp( red[ key ], prop, true ); + } ); + + // everything defined but alpha? + if ( inst[ cache ] && jQuery.inArray( + null, + inst[ cache ].slice( 0, 3 ) + ) < 0 ) { + + // use the default of 1 + if ( inst[ cache ][ 3 ] == null ) { + inst[ cache ][ 3 ] = 1; + } + + if ( space.from ) { + inst._rgba = space.from( inst[ cache ] ); + } + } + } ); + } + return this; + } + }, + is: function( compare ) { + var is = color( compare ), + same = true, + inst = this; + + each( spaces, function( _, space ) { + var localCache, + isCache = is[ space.cache ]; + if ( isCache ) { + localCache = inst[ space.cache ] || space.to && space.to( inst._rgba ) || []; + each( space.props, function( _, prop ) { + if ( isCache[ prop.idx ] != null ) { + same = ( isCache[ prop.idx ] === localCache[ prop.idx ] ); + return same; + } + } ); + } + return same; + } ); + return same; + }, + _space: function() { + var used = [], + inst = this; + each( spaces, function( spaceName, space ) { + if ( inst[ space.cache ] ) { + used.push( spaceName ); + } + } ); + return used.pop(); + }, + transition: function( other, distance ) { + var end = color( other ), + spaceName = end._space(), + space = spaces[ spaceName ], + startColor = this.alpha() === 0 ? color( "transparent" ) : this, + start = startColor[ space.cache ] || space.to( startColor._rgba ), + result = start.slice(); + + end = end[ space.cache ]; + each( space.props, function( _key, prop ) { + var index = prop.idx, + startValue = start[ index ], + endValue = end[ index ], + type = propTypes[ prop.type ] || {}; + + // if null, don't override start value + if ( endValue === null ) { + return; + } + + // if null - use end + if ( startValue === null ) { + result[ index ] = endValue; + } else { + if ( type.mod ) { + if ( endValue - startValue > type.mod / 2 ) { + startValue += type.mod; + } else if ( startValue - endValue > type.mod / 2 ) { + startValue -= type.mod; + } + } + result[ index ] = clamp( ( endValue - startValue ) * distance + startValue, prop ); + } + } ); + return this[ spaceName ]( result ); + }, + blend: function( opaque ) { + + // if we are already opaque - return ourself + if ( this._rgba[ 3 ] === 1 ) { + return this; + } + + var rgb = this._rgba.slice(), + a = rgb.pop(), + blend = color( opaque )._rgba; + + return color( jQuery.map( rgb, function( v, i ) { + return ( 1 - a ) * blend[ i ] + a * v; + } ) ); + }, + toRgbaString: function() { + var prefix = "rgba(", + rgba = jQuery.map( this._rgba, function( v, i ) { + if ( v != null ) { + return v; + } + return i > 2 ? 1 : 0; + } ); + + if ( rgba[ 3 ] === 1 ) { + rgba.pop(); + prefix = "rgb("; + } + + return prefix + rgba.join( ", " ) + ")"; + }, + toHslaString: function() { + var prefix = "hsla(", + hsla = jQuery.map( this.hsla(), function( v, i ) { + if ( v == null ) { + v = i > 2 ? 1 : 0; + } + + // catch 1 and 2 + if ( i && i < 3 ) { + v = Math.round( v * 100 ) + "%"; + } + return v; + } ); + + if ( hsla[ 3 ] === 1 ) { + hsla.pop(); + prefix = "hsl("; + } + return prefix + hsla.join( ", " ) + ")"; + }, + toHexString: function( includeAlpha ) { + var rgba = this._rgba.slice(), + alpha = rgba.pop(); + + if ( includeAlpha ) { + rgba.push( ~~( alpha * 255 ) ); + } + + return "#" + jQuery.map( rgba, function( v ) { + + // default to 0 when nulls exist + return ( "0" + ( v || 0 ).toString( 16 ) ).substr( -2 ); + } ).join( "" ); + }, + toString: function() { + return this.toRgbaString(); + } +} ); +color.fn.parse.prototype = color.fn; + +// hsla conversions adapted from: +// https://code.google.com/p/maashaack/source/browse/packages/graphics/trunk/src/graphics/colors/HUE2RGB.as?r=5021 + +function hue2rgb( p, q, h ) { + h = ( h + 1 ) % 1; + if ( h * 6 < 1 ) { + return p + ( q - p ) * h * 6; + } + if ( h * 2 < 1 ) { + return q; + } + if ( h * 3 < 2 ) { + return p + ( q - p ) * ( ( 2 / 3 ) - h ) * 6; + } + return p; +} + +spaces.hsla.to = function( rgba ) { + if ( rgba[ 0 ] == null || rgba[ 1 ] == null || rgba[ 2 ] == null ) { + return [ null, null, null, rgba[ 3 ] ]; + } + var r = rgba[ 0 ] / 255, + g = rgba[ 1 ] / 255, + b = rgba[ 2 ] / 255, + a = rgba[ 3 ], + max = Math.max( r, g, b ), + min = Math.min( r, g, b ), + diff = max - min, + add = max + min, + l = add * 0.5, + h, s; + + if ( min === max ) { + h = 0; + } else if ( r === max ) { + h = ( 60 * ( g - b ) / diff ) + 360; + } else if ( g === max ) { + h = ( 60 * ( b - r ) / diff ) + 120; + } else { + h = ( 60 * ( r - g ) / diff ) + 240; + } + + // chroma (diff) == 0 means greyscale which, by definition, saturation = 0% + // otherwise, saturation is based on the ratio of chroma (diff) to lightness (add) + if ( diff === 0 ) { + s = 0; + } else if ( l <= 0.5 ) { + s = diff / add; + } else { + s = diff / ( 2 - add ); + } + return [ Math.round( h ) % 360, s, l, a == null ? 1 : a ]; +}; + +spaces.hsla.from = function( hsla ) { + if ( hsla[ 0 ] == null || hsla[ 1 ] == null || hsla[ 2 ] == null ) { + return [ null, null, null, hsla[ 3 ] ]; + } + var h = hsla[ 0 ] / 360, + s = hsla[ 1 ], + l = hsla[ 2 ], + a = hsla[ 3 ], + q = l <= 0.5 ? l * ( 1 + s ) : l + s - l * s, + p = 2 * l - q; + + return [ + Math.round( hue2rgb( p, q, h + ( 1 / 3 ) ) * 255 ), + Math.round( hue2rgb( p, q, h ) * 255 ), + Math.round( hue2rgb( p, q, h - ( 1 / 3 ) ) * 255 ), + a + ]; +}; + + +each( spaces, function( spaceName, space ) { + var props = space.props, + cache = space.cache, + to = space.to, + from = space.from; + + // makes rgba() and hsla() + color.fn[ spaceName ] = function( value ) { + + // generate a cache for this space if it doesn't exist + if ( to && !this[ cache ] ) { + this[ cache ] = to( this._rgba ); + } + if ( value === undefined ) { + return this[ cache ].slice(); + } + + var ret, + type = getType( value ), + arr = ( type === "array" || type === "object" ) ? value : arguments, + local = this[ cache ].slice(); + + each( props, function( key, prop ) { + var val = arr[ type === "object" ? key : prop.idx ]; + if ( val == null ) { + val = local[ prop.idx ]; + } + local[ prop.idx ] = clamp( val, prop ); + } ); + + if ( from ) { + ret = color( from( local ) ); + ret[ cache ] = local; + return ret; + } else { + return color( local ); + } + }; + + // makes red() green() blue() alpha() hue() saturation() lightness() + each( props, function( key, prop ) { + + // alpha is included in more than one space + if ( color.fn[ key ] ) { + return; + } + color.fn[ key ] = function( value ) { + var local, cur, match, fn, + vtype = getType( value ); + + if ( key === "alpha" ) { + fn = this._hsla ? "hsla" : "rgba"; + } else { + fn = spaceName; + } + local = this[ fn ](); + cur = local[ prop.idx ]; + + if ( vtype === "undefined" ) { + return cur; + } + + if ( vtype === "function" ) { + value = value.call( this, cur ); + vtype = getType( value ); + } + if ( value == null && prop.empty ) { + return this; + } + if ( vtype === "string" ) { + match = rplusequals.exec( value ); + if ( match ) { + value = cur + parseFloat( match[ 2 ] ) * ( match[ 1 ] === "+" ? 1 : -1 ); + } + } + local[ prop.idx ] = value; + return this[ fn ]( local ); + }; + } ); +} ); + +// add cssHook and .fx.step function for each named hook. +// accept a space separated string of properties +color.hook = function( hook ) { + var hooks = hook.split( " " ); + each( hooks, function( _i, hook ) { + jQuery.cssHooks[ hook ] = { + set: function( elem, value ) { + var parsed; + + if ( value !== "transparent" && + ( getType( value ) !== "string" || + ( parsed = stringParse( value ) ) ) ) { + value = color( parsed || value ); + value = value.toRgbaString(); + } + elem.style[ hook ] = value; + } + }; + jQuery.fx.step[ hook ] = function( fx ) { + if ( !fx.colorInit ) { + fx.start = color( fx.elem, hook ); + fx.end = color( fx.end ); + fx.colorInit = true; + } + jQuery.cssHooks[ hook ].set( fx.elem, fx.start.transition( fx.end, fx.pos ) ); + }; + } ); + +}; + +color.hook( stepHooks ); + +jQuery.cssHooks.borderColor = { + expand: function( value ) { + var expanded = {}; + + each( [ "Top", "Right", "Bottom", "Left" ], function( _i, part ) { + expanded[ "border" + part + "Color" ] = value; + } ); + return expanded; + } +}; + +// Basic color names only. +// Usage of any of the other color names requires adding yourself or including +// jquery.color.svg-names.js. +colors = jQuery.Color.names = { + + // 4.1. Basic color keywords + aqua: "#00ffff", + black: "#000000", + blue: "#0000ff", + fuchsia: "#ff00ff", + gray: "#808080", + green: "#008000", + lime: "#00ff00", + maroon: "#800000", + navy: "#000080", + olive: "#808000", + purple: "#800080", + red: "#ff0000", + silver: "#c0c0c0", + teal: "#008080", + white: "#ffffff", + yellow: "#ffff00", + + // 4.2.3. "transparent" color keyword + transparent: [ null, null, null, 0 ], + + _default: "#ffffff" +}; + + +/*! + * jQuery UI Effects 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Effects Core +//>>group: Effects +/* eslint-disable max-len */ +//>>description: Extends the internal jQuery effects. Includes morphing and easing. Required by all other effects. +/* eslint-enable max-len */ +//>>docs: https://api.jqueryui.com/category/effects-core/ +//>>demos: https://jqueryui.com/effect/ + + +var dataSpace = "ui-effects-", + dataSpaceStyle = "ui-effects-style", + dataSpaceAnimated = "ui-effects-animated"; + +$.effects = { + effect: {} +}; + +/******************************************************************************/ +/****************************** CLASS ANIMATIONS ******************************/ +/******************************************************************************/ +( function() { + +var classAnimationActions = [ "add", "remove", "toggle" ], + shorthandStyles = { + border: 1, + borderBottom: 1, + borderColor: 1, + borderLeft: 1, + borderRight: 1, + borderTop: 1, + borderWidth: 1, + margin: 1, + padding: 1 + }; + +$.each( + [ "borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle" ], + function( _, prop ) { + $.fx.step[ prop ] = function( fx ) { + if ( fx.end !== "none" && !fx.setAttr || fx.pos === 1 && !fx.setAttr ) { + jQuery.style( fx.elem, prop, fx.end ); + fx.setAttr = true; + } + }; + } +); + +function camelCase( string ) { + return string.replace( /-([\da-z])/gi, function( all, letter ) { + return letter.toUpperCase(); + } ); +} + +function getElementStyles( elem ) { + var key, len, + style = elem.ownerDocument.defaultView.getComputedStyle( elem ), + styles = {}; + + len = style.length; + while ( len-- ) { + key = style[ len ]; + if ( typeof style[ key ] === "string" ) { + styles[ camelCase( key ) ] = style[ key ]; + } + } + + return styles; +} + +function styleDifference( oldStyle, newStyle ) { + var diff = {}, + name, value; + + for ( name in newStyle ) { + value = newStyle[ name ]; + if ( oldStyle[ name ] !== value ) { + if ( !shorthandStyles[ name ] ) { + if ( $.fx.step[ name ] || !isNaN( parseFloat( value ) ) ) { + diff[ name ] = value; + } + } + } + } + + return diff; +} + +$.effects.animateClass = function( value, duration, easing, callback ) { + var o = $.speed( duration, easing, callback ); + + return this.queue( function() { + var animated = $( this ), + baseClass = animated.attr( "class" ) || "", + applyClassChange, + allAnimations = o.children ? animated.find( "*" ).addBack() : animated; + + // Map the animated objects to store the original styles. + allAnimations = allAnimations.map( function() { + var el = $( this ); + return { + el: el, + start: getElementStyles( this ) + }; + } ); + + // Apply class change + applyClassChange = function() { + $.each( classAnimationActions, function( i, action ) { + if ( value[ action ] ) { + animated[ action + "Class" ]( value[ action ] ); + } + } ); + }; + applyClassChange(); + + // Map all animated objects again - calculate new styles and diff + allAnimations = allAnimations.map( function() { + this.end = getElementStyles( this.el[ 0 ] ); + this.diff = styleDifference( this.start, this.end ); + return this; + } ); + + // Apply original class + animated.attr( "class", baseClass ); + + // Map all animated objects again - this time collecting a promise + allAnimations = allAnimations.map( function() { + var styleInfo = this, + dfd = $.Deferred(), + opts = $.extend( {}, o, { + queue: false, + complete: function() { + dfd.resolve( styleInfo ); + } + } ); + + this.el.animate( this.diff, opts ); + return dfd.promise(); + } ); + + // Once all animations have completed: + $.when.apply( $, allAnimations.get() ).done( function() { + + // Set the final class + applyClassChange(); + + // For each animated element, + // clear all css properties that were animated + $.each( arguments, function() { + var el = this.el; + $.each( this.diff, function( key ) { + el.css( key, "" ); + } ); + } ); + + // This is guarnteed to be there if you use jQuery.speed() + // it also handles dequeuing the next anim... + o.complete.call( animated[ 0 ] ); + } ); + } ); +}; + +$.fn.extend( { + addClass: ( function( orig ) { + return function( classNames, speed, easing, callback ) { + return speed ? + $.effects.animateClass.call( this, + { add: classNames }, speed, easing, callback ) : + orig.apply( this, arguments ); + }; + } )( $.fn.addClass ), + + removeClass: ( function( orig ) { + return function( classNames, speed, easing, callback ) { + return arguments.length > 1 ? + $.effects.animateClass.call( this, + { remove: classNames }, speed, easing, callback ) : + orig.apply( this, arguments ); + }; + } )( $.fn.removeClass ), + + toggleClass: ( function( orig ) { + return function( classNames, force, speed, easing, callback ) { + if ( typeof force === "boolean" || force === undefined ) { + if ( !speed ) { + + // Without speed parameter + return orig.apply( this, arguments ); + } else { + return $.effects.animateClass.call( this, + ( force ? { add: classNames } : { remove: classNames } ), + speed, easing, callback ); + } + } else { + + // Without force parameter + return $.effects.animateClass.call( this, + { toggle: classNames }, force, speed, easing ); + } + }; + } )( $.fn.toggleClass ), + + switchClass: function( remove, add, speed, easing, callback ) { + return $.effects.animateClass.call( this, { + add: add, + remove: remove + }, speed, easing, callback ); + } +} ); + +} )(); + +/******************************************************************************/ +/*********************************** EFFECTS **********************************/ +/******************************************************************************/ + +( function() { + +if ( $.expr && $.expr.pseudos && $.expr.pseudos.animated ) { + $.expr.pseudos.animated = ( function( orig ) { + return function( elem ) { + return !!$( elem ).data( dataSpaceAnimated ) || orig( elem ); + }; + } )( $.expr.pseudos.animated ); +} + +if ( $.uiBackCompat === true ) { + $.extend( $.effects, { + + // Saves a set of properties in a data storage + save: function( element, set ) { + var i = 0, length = set.length; + for ( ; i < length; i++ ) { + if ( set[ i ] !== null ) { + element.data( dataSpace + set[ i ], element[ 0 ].style[ set[ i ] ] ); + } + } + }, + + // Restores a set of previously saved properties from a data storage + restore: function( element, set ) { + var val, i = 0, length = set.length; + for ( ; i < length; i++ ) { + if ( set[ i ] !== null ) { + val = element.data( dataSpace + set[ i ] ); + element.css( set[ i ], val ); + } + } + }, + + setMode: function( el, mode ) { + if ( mode === "toggle" ) { + mode = el.is( ":hidden" ) ? "show" : "hide"; + } + return mode; + }, + + // Wraps the element around a wrapper that copies position properties + createWrapper: function( element ) { + + // If the element is already wrapped, return it + if ( element.parent().is( ".ui-effects-wrapper" ) ) { + return element.parent(); + } + + // Wrap the element + var props = { + width: element.outerWidth( true ), + height: element.outerHeight( true ), + "float": element.css( "float" ) + }, + wrapper = $( "
" ) + .addClass( "ui-effects-wrapper" ) + .css( { + fontSize: "100%", + background: "transparent", + border: "none", + margin: 0, + padding: 0 + } ), + + // Store the size in case width/height are defined in % - Fixes #5245 + size = { + width: element.width(), + height: element.height() + }, + active = document.activeElement; + + // Support: Firefox + // Firefox incorrectly exposes anonymous content + // https://bugzilla.mozilla.org/show_bug.cgi?id=561664 + try { + // eslint-disable-next-line no-unused-expressions + active.id; + } catch ( e ) { + active = document.body; + } + + element.wrap( wrapper ); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).trigger( "focus" ); + } + + // Hotfix for jQuery 1.4 since some change in wrap() seems to actually + // lose the reference to the wrapped element + wrapper = element.parent(); + + // Transfer positioning properties to the wrapper + if ( element.css( "position" ) === "static" ) { + wrapper.css( { position: "relative" } ); + element.css( { position: "relative" } ); + } else { + $.extend( props, { + position: element.css( "position" ), + zIndex: element.css( "z-index" ) + } ); + $.each( [ "top", "left", "bottom", "right" ], function( i, pos ) { + props[ pos ] = element.css( pos ); + if ( isNaN( parseInt( props[ pos ], 10 ) ) ) { + props[ pos ] = "auto"; + } + } ); + element.css( { + position: "relative", + top: 0, + left: 0, + right: "auto", + bottom: "auto" + } ); + } + element.css( size ); + + return wrapper.css( props ).show(); + }, + + removeWrapper: function( element ) { + var active = document.activeElement; + + if ( element.parent().is( ".ui-effects-wrapper" ) ) { + element.parent().replaceWith( element ); + + // Fixes #7595 - Elements lose focus when wrapped. + if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) { + $( active ).trigger( "focus" ); + } + } + + return element; + } + } ); +} + +$.extend( $.effects, { + version: "1.14.1", + + define: function( name, mode, effect ) { + if ( !effect ) { + effect = mode; + mode = "effect"; + } + + $.effects.effect[ name ] = effect; + $.effects.effect[ name ].mode = mode; + + return effect; + }, + + scaledDimensions: function( element, percent, direction ) { + if ( percent === 0 ) { + return { + height: 0, + width: 0, + outerHeight: 0, + outerWidth: 0 + }; + } + + var x = direction !== "horizontal" ? ( ( percent || 100 ) / 100 ) : 1, + y = direction !== "vertical" ? ( ( percent || 100 ) / 100 ) : 1; + + return { + height: element.height() * y, + width: element.width() * x, + outerHeight: element.outerHeight() * y, + outerWidth: element.outerWidth() * x + }; + + }, + + clipToBox: function( animation ) { + return { + width: animation.clip.right - animation.clip.left, + height: animation.clip.bottom - animation.clip.top, + left: animation.clip.left, + top: animation.clip.top + }; + }, + + // Injects recently queued functions to be first in line (after "inprogress") + unshift: function( element, queueLength, count ) { + var queue = element.queue(); + + if ( queueLength > 1 ) { + queue.splice.apply( queue, + [ 1, 0 ].concat( queue.splice( queueLength, count ) ) ); + } + element.dequeue(); + }, + + saveStyle: function( element ) { + element.data( dataSpaceStyle, element[ 0 ].style.cssText ); + }, + + restoreStyle: function( element ) { + element[ 0 ].style.cssText = element.data( dataSpaceStyle ) || ""; + element.removeData( dataSpaceStyle ); + }, + + mode: function( element, mode ) { + var hidden = element.is( ":hidden" ); + + if ( mode === "toggle" ) { + mode = hidden ? "show" : "hide"; + } + if ( hidden ? mode === "hide" : mode === "show" ) { + mode = "none"; + } + return mode; + }, + + // Translates a [top,left] array into a baseline value + getBaseline: function( origin, original ) { + var y, x; + + switch ( origin[ 0 ] ) { + case "top": + y = 0; + break; + case "middle": + y = 0.5; + break; + case "bottom": + y = 1; + break; + default: + y = origin[ 0 ] / original.height; + } + + switch ( origin[ 1 ] ) { + case "left": + x = 0; + break; + case "center": + x = 0.5; + break; + case "right": + x = 1; + break; + default: + x = origin[ 1 ] / original.width; + } + + return { + x: x, + y: y + }; + }, + + // Creates a placeholder element so that the original element can be made absolute + createPlaceholder: function( element ) { + var placeholder, + cssPosition = element.css( "position" ), + position = element.position(); + + // Lock in margins first to account for form elements, which + // will change margin if you explicitly set height + // see: https://jsfiddle.net/JZSMt/3/ https://bugs.webkit.org/show_bug.cgi?id=107380 + // Support: Safari + element.css( { + marginTop: element.css( "marginTop" ), + marginBottom: element.css( "marginBottom" ), + marginLeft: element.css( "marginLeft" ), + marginRight: element.css( "marginRight" ) + } ) + .outerWidth( element.outerWidth() ) + .outerHeight( element.outerHeight() ); + + if ( /^(static|relative)/.test( cssPosition ) ) { + cssPosition = "absolute"; + + placeholder = $( "<" + element[ 0 ].nodeName + ">" ).insertAfter( element ).css( { + + // Convert inline to inline block to account for inline elements + // that turn to inline block based on content (like img) + display: /^(inline|ruby)/.test( element.css( "display" ) ) ? + "inline-block" : + "block", + visibility: "hidden", + + // Margins need to be set to account for margin collapse + marginTop: element.css( "marginTop" ), + marginBottom: element.css( "marginBottom" ), + marginLeft: element.css( "marginLeft" ), + marginRight: element.css( "marginRight" ), + "float": element.css( "float" ) + } ) + .outerWidth( element.outerWidth() ) + .outerHeight( element.outerHeight() ) + .addClass( "ui-effects-placeholder" ); + + element.data( dataSpace + "placeholder", placeholder ); + } + + element.css( { + position: cssPosition, + left: position.left, + top: position.top + } ); + + return placeholder; + }, + + removePlaceholder: function( element ) { + var dataKey = dataSpace + "placeholder", + placeholder = element.data( dataKey ); + + if ( placeholder ) { + placeholder.remove(); + element.removeData( dataKey ); + } + }, + + // Removes a placeholder if it exists and restores + // properties that were modified during placeholder creation + cleanUp: function( element ) { + $.effects.restoreStyle( element ); + $.effects.removePlaceholder( element ); + }, + + setTransition: function( element, list, factor, value ) { + value = value || {}; + $.each( list, function( i, x ) { + var unit = element.cssUnit( x ); + if ( unit[ 0 ] > 0 ) { + value[ x ] = unit[ 0 ] * factor + unit[ 1 ]; + } + } ); + return value; + } +} ); + +// Return an effect options object for the given parameters: +function _normalizeArguments( effect, options, speed, callback ) { + + // Allow passing all options as the first parameter + if ( $.isPlainObject( effect ) ) { + options = effect; + effect = effect.effect; + } + + // Convert to an object + effect = { effect: effect }; + + // Catch (effect, null, ...) + if ( options == null ) { + options = {}; + } + + // Catch (effect, callback) + if ( typeof options === "function" ) { + callback = options; + speed = null; + options = {}; + } + + // Catch (effect, speed, ?) + if ( typeof options === "number" || $.fx.speeds[ options ] ) { + callback = speed; + speed = options; + options = {}; + } + + // Catch (effect, options, callback) + if ( typeof speed === "function" ) { + callback = speed; + speed = null; + } + + // Add options to effect + if ( options ) { + $.extend( effect, options ); + } + + speed = speed || options.duration; + effect.duration = $.fx.off ? 0 : + typeof speed === "number" ? speed : + speed in $.fx.speeds ? $.fx.speeds[ speed ] : + $.fx.speeds._default; + + effect.complete = callback || options.complete; + + return effect; +} + +function standardAnimationOption( option ) { + + // Valid standard speeds (nothing, number, named speed) + if ( !option || typeof option === "number" || $.fx.speeds[ option ] ) { + return true; + } + + // Invalid strings - treat as "normal" speed + if ( typeof option === "string" && !$.effects.effect[ option ] ) { + return true; + } + + // Complete callback + if ( typeof option === "function" ) { + return true; + } + + // Options hash (but not naming an effect) + if ( typeof option === "object" && !option.effect ) { + return true; + } + + // Didn't match any standard API + return false; +} + +$.fn.extend( { + effect: function( /* effect, options, speed, callback */ ) { + var args = _normalizeArguments.apply( this, arguments ), + effectMethod = $.effects.effect[ args.effect ], + defaultMode = effectMethod.mode, + queue = args.queue, + queueName = queue || "fx", + complete = args.complete, + mode = args.mode, + modes = [], + prefilter = function( next ) { + var el = $( this ), + normalizedMode = $.effects.mode( el, mode ) || defaultMode; + + // Sentinel for duck-punching the :animated pseudo-selector + el.data( dataSpaceAnimated, true ); + + // Save effect mode for later use, + // we can't just call $.effects.mode again later, + // as the .show() below destroys the initial state + modes.push( normalizedMode ); + + // See $.uiBackCompat inside of run() for removal of defaultMode in 1.14 + if ( defaultMode && ( normalizedMode === "show" || + ( normalizedMode === defaultMode && normalizedMode === "hide" ) ) ) { + el.show(); + } + + if ( !defaultMode || normalizedMode !== "none" ) { + $.effects.saveStyle( el ); + } + + if ( typeof next === "function" ) { + next(); + } + }; + + if ( $.fx.off || !effectMethod ) { + + // Delegate to the original method (e.g., .show()) if possible + if ( mode ) { + return this[ mode ]( args.duration, complete ); + } else { + return this.each( function() { + if ( complete ) { + complete.call( this ); + } + } ); + } + } + + function run( next ) { + var elem = $( this ); + + function cleanup() { + elem.removeData( dataSpaceAnimated ); + + $.effects.cleanUp( elem ); + + if ( args.mode === "hide" ) { + elem.hide(); + } + + done(); + } + + function done() { + if ( typeof complete === "function" ) { + complete.call( elem[ 0 ] ); + } + + if ( typeof next === "function" ) { + next(); + } + } + + // Override mode option on a per element basis, + // as toggle can be either show or hide depending on element state + args.mode = modes.shift(); + + if ( $.uiBackCompat === true && !defaultMode ) { + if ( elem.is( ":hidden" ) ? mode === "hide" : mode === "show" ) { + + // Call the core method to track "olddisplay" properly + elem[ mode ](); + done(); + } else { + effectMethod.call( elem[ 0 ], args, done ); + } + } else { + if ( args.mode === "none" ) { + + // Call the core method to track "olddisplay" properly + elem[ mode ](); + done(); + } else { + effectMethod.call( elem[ 0 ], args, cleanup ); + } + } + } + + // Run prefilter on all elements first to ensure that + // any showing or hiding happens before placeholder creation, + // which ensures that any layout changes are correctly captured. + return queue === false ? + this.each( prefilter ).each( run ) : + this.queue( queueName, prefilter ).queue( queueName, run ); + }, + + show: ( function( orig ) { + return function( option ) { + if ( standardAnimationOption( option ) ) { + return orig.apply( this, arguments ); + } else { + var args = _normalizeArguments.apply( this, arguments ); + args.mode = "show"; + return this.effect.call( this, args ); + } + }; + } )( $.fn.show ), + + hide: ( function( orig ) { + return function( option ) { + if ( standardAnimationOption( option ) ) { + return orig.apply( this, arguments ); + } else { + var args = _normalizeArguments.apply( this, arguments ); + args.mode = "hide"; + return this.effect.call( this, args ); + } + }; + } )( $.fn.hide ), + + toggle: ( function( orig ) { + return function( option ) { + if ( standardAnimationOption( option ) || typeof option === "boolean" ) { + return orig.apply( this, arguments ); + } else { + var args = _normalizeArguments.apply( this, arguments ); + args.mode = "toggle"; + return this.effect.call( this, args ); + } + }; + } )( $.fn.toggle ), + + cssUnit: function( key ) { + var style = this.css( key ), + val = []; + + $.each( [ "em", "px", "%", "pt" ], function( i, unit ) { + if ( style.indexOf( unit ) > 0 ) { + val = [ parseFloat( style ), unit ]; + } + } ); + return val; + }, + + cssClip: function( clipObj ) { + if ( clipObj ) { + return this.css( "clip", "rect(" + clipObj.top + "px " + clipObj.right + "px " + + clipObj.bottom + "px " + clipObj.left + "px)" ); + } + return parseClip( this.css( "clip" ), this ); + }, + + transfer: function( options, done ) { + var element = $( this ), + target = $( options.to ), + targetFixed = target.css( "position" ) === "fixed", + body = $( "body" ), + fixTop = targetFixed ? body.scrollTop() : 0, + fixLeft = targetFixed ? body.scrollLeft() : 0, + endPosition = target.offset(), + animation = { + top: endPosition.top - fixTop, + left: endPosition.left - fixLeft, + height: target.innerHeight(), + width: target.innerWidth() + }, + startPosition = element.offset(), + transfer = $( "
" ); + + transfer + .appendTo( "body" ) + .addClass( options.className ) + .css( { + top: startPosition.top - fixTop, + left: startPosition.left - fixLeft, + height: element.innerHeight(), + width: element.innerWidth(), + position: targetFixed ? "fixed" : "absolute" + } ) + .animate( animation, options.duration, options.easing, function() { + transfer.remove(); + if ( typeof done === "function" ) { + done(); + } + } ); + } +} ); + +function parseClip( str, element ) { + var outerWidth = element.outerWidth(), + outerHeight = element.outerHeight(), + clipRegex = /^rect\((-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto),?\s*(-?\d*\.?\d*px|-?\d+%|auto)\)$/, + values = clipRegex.exec( str ) || [ "", 0, outerWidth, outerHeight, 0 ]; + + return { + top: parseFloat( values[ 1 ] ) || 0, + right: values[ 2 ] === "auto" ? outerWidth : parseFloat( values[ 2 ] ), + bottom: values[ 3 ] === "auto" ? outerHeight : parseFloat( values[ 3 ] ), + left: parseFloat( values[ 4 ] ) || 0 + }; +} + +$.fx.step.clip = function( fx ) { + if ( !fx.clipInit ) { + fx.start = $( fx.elem ).cssClip(); + if ( typeof fx.end === "string" ) { + fx.end = parseClip( fx.end, fx.elem ); + } + fx.clipInit = true; + } + + $( fx.elem ).cssClip( { + top: fx.pos * ( fx.end.top - fx.start.top ) + fx.start.top, + right: fx.pos * ( fx.end.right - fx.start.right ) + fx.start.right, + bottom: fx.pos * ( fx.end.bottom - fx.start.bottom ) + fx.start.bottom, + left: fx.pos * ( fx.end.left - fx.start.left ) + fx.start.left + } ); +}; + +} )(); + +/******************************************************************************/ +/*********************************** EASING ***********************************/ +/******************************************************************************/ + +( function() { + +// Based on easing equations from Robert Penner (http://robertpenner.com/easing) + +var baseEasings = {}; + +$.each( [ "Quad", "Cubic", "Quart", "Quint", "Expo" ], function( i, name ) { + baseEasings[ name ] = function( p ) { + return Math.pow( p, i + 2 ); + }; +} ); + +$.extend( baseEasings, { + Sine: function( p ) { + return 1 - Math.cos( p * Math.PI / 2 ); + }, + Circ: function( p ) { + return 1 - Math.sqrt( 1 - p * p ); + }, + Elastic: function( p ) { + return p === 0 || p === 1 ? p : + -Math.pow( 2, 8 * ( p - 1 ) ) * Math.sin( ( ( p - 1 ) * 80 - 7.5 ) * Math.PI / 15 ); + }, + Back: function( p ) { + return p * p * ( 3 * p - 2 ); + }, + Bounce: function( p ) { + var pow2, + bounce = 4; + + while ( p < ( ( pow2 = Math.pow( 2, --bounce ) ) - 1 ) / 11 ) {} + return 1 / Math.pow( 4, 3 - bounce ) - 7.5625 * Math.pow( ( pow2 * 3 - 2 ) / 22 - p, 2 ); + } +} ); + +$.each( baseEasings, function( name, easeIn ) { + $.easing[ "easeIn" + name ] = easeIn; + $.easing[ "easeOut" + name ] = function( p ) { + return 1 - easeIn( 1 - p ); + }; + $.easing[ "easeInOut" + name ] = function( p ) { + return p < 0.5 ? + easeIn( p * 2 ) / 2 : + 1 - easeIn( p * -2 + 2 ) / 2; + }; +} ); + +} )(); + +var effect = $.effects; + + +/*! + * jQuery UI Effects Blind 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Blind Effect +//>>group: Effects +//>>description: Blinds the element. +//>>docs: https://api.jqueryui.com/blind-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectBlind = $.effects.define( "blind", "hide", function( options, done ) { + var map = { + up: [ "bottom", "top" ], + vertical: [ "bottom", "top" ], + down: [ "top", "bottom" ], + left: [ "right", "left" ], + horizontal: [ "right", "left" ], + right: [ "left", "right" ] + }, + element = $( this ), + direction = options.direction || "up", + start = element.cssClip(), + animate = { clip: $.extend( {}, start ) }, + placeholder = $.effects.createPlaceholder( element ); + + animate.clip[ map[ direction ][ 0 ] ] = animate.clip[ map[ direction ][ 1 ] ]; + + if ( options.mode === "show" ) { + element.cssClip( animate.clip ); + if ( placeholder ) { + placeholder.css( $.effects.clipToBox( animate ) ); + } + + animate.clip = start; + } + + if ( placeholder ) { + placeholder.animate( $.effects.clipToBox( animate ), options.duration, options.easing ); + } + + element.animate( animate, { + queue: false, + duration: options.duration, + easing: options.easing, + complete: done + } ); +} ); + + +/*! + * jQuery UI Effects Bounce 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Bounce Effect +//>>group: Effects +//>>description: Bounces an element horizontally or vertically n times. +//>>docs: https://api.jqueryui.com/bounce-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectBounce = $.effects.define( "bounce", function( options, done ) { + var upAnim, downAnim, refValue, + element = $( this ), + + // Defaults: + mode = options.mode, + hide = mode === "hide", + show = mode === "show", + direction = options.direction || "up", + distance = options.distance, + times = options.times || 5, + + // Number of internal animations + anims = times * 2 + ( show || hide ? 1 : 0 ), + speed = options.duration / anims, + easing = options.easing, + + // Utility: + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + motion = ( direction === "up" || direction === "left" ), + i = 0, + + queuelen = element.queue().length; + + $.effects.createPlaceholder( element ); + + refValue = element.css( ref ); + + // Default distance for the BIGGEST bounce is the outer Distance / 3 + if ( !distance ) { + distance = element[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; + } + + if ( show ) { + downAnim = { opacity: 1 }; + downAnim[ ref ] = refValue; + + // If we are showing, force opacity 0 and set the initial position + // then do the "first" animation + element + .css( "opacity", 0 ) + .css( ref, motion ? -distance * 2 : distance * 2 ) + .animate( downAnim, speed, easing ); + } + + // Start at the smallest distance if we are hiding + if ( hide ) { + distance = distance / Math.pow( 2, times - 1 ); + } + + downAnim = {}; + downAnim[ ref ] = refValue; + + // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here + for ( ; i < times; i++ ) { + upAnim = {}; + upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; + + element + .animate( upAnim, speed, easing ) + .animate( downAnim, speed, easing ); + + distance = hide ? distance * 2 : distance / 2; + } + + // Last Bounce when Hiding + if ( hide ) { + upAnim = { opacity: 0 }; + upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; + + element.animate( upAnim, speed, easing ); + } + + element.queue( done ); + + $.effects.unshift( element, queuelen, anims + 1 ); +} ); + + +/*! + * jQuery UI Effects Clip 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Clip Effect +//>>group: Effects +//>>description: Clips the element on and off like an old TV. +//>>docs: https://api.jqueryui.com/clip-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectClip = $.effects.define( "clip", "hide", function( options, done ) { + var start, + animate = {}, + element = $( this ), + direction = options.direction || "vertical", + both = direction === "both", + horizontal = both || direction === "horizontal", + vertical = both || direction === "vertical"; + + start = element.cssClip(); + animate.clip = { + top: vertical ? ( start.bottom - start.top ) / 2 : start.top, + right: horizontal ? ( start.right - start.left ) / 2 : start.right, + bottom: vertical ? ( start.bottom - start.top ) / 2 : start.bottom, + left: horizontal ? ( start.right - start.left ) / 2 : start.left + }; + + $.effects.createPlaceholder( element ); + + if ( options.mode === "show" ) { + element.cssClip( animate.clip ); + animate.clip = start; + } + + element.animate( animate, { + queue: false, + duration: options.duration, + easing: options.easing, + complete: done + } ); + +} ); + + +/*! + * jQuery UI Effects Drop 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Drop Effect +//>>group: Effects +//>>description: Moves an element in one direction and hides it at the same time. +//>>docs: https://api.jqueryui.com/drop-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectDrop = $.effects.define( "drop", "hide", function( options, done ) { + + var distance, + element = $( this ), + mode = options.mode, + show = mode === "show", + direction = options.direction || "left", + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + motion = ( direction === "up" || direction === "left" ) ? "-=" : "+=", + oppositeMotion = ( motion === "+=" ) ? "-=" : "+=", + animation = { + opacity: 0 + }; + + $.effects.createPlaceholder( element ); + + distance = options.distance || + element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ) / 2; + + animation[ ref ] = motion + distance; + + if ( show ) { + element.css( animation ); + + animation[ ref ] = oppositeMotion + distance; + animation.opacity = 1; + } + + // Animate + element.animate( animation, { + queue: false, + duration: options.duration, + easing: options.easing, + complete: done + } ); +} ); + + +/*! + * jQuery UI Effects Explode 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Explode Effect +//>>group: Effects +/* eslint-disable max-len */ +//>>description: Explodes an element in all directions into n pieces. Implodes an element to its original wholeness. +/* eslint-enable max-len */ +//>>docs: https://api.jqueryui.com/explode-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectExplode = $.effects.define( "explode", "hide", function( options, done ) { + + var i, j, left, top, mx, my, + rows = options.pieces ? Math.round( Math.sqrt( options.pieces ) ) : 3, + cells = rows, + element = $( this ), + mode = options.mode, + show = mode === "show", + + // Show and then visibility:hidden the element before calculating offset + offset = element.show().css( "visibility", "hidden" ).offset(), + + // Width and height of a piece + width = Math.ceil( element.outerWidth() / cells ), + height = Math.ceil( element.outerHeight() / rows ), + pieces = []; + + // Children animate complete: + function childComplete() { + pieces.push( this ); + if ( pieces.length === rows * cells ) { + animComplete(); + } + } + + // Clone the element for each row and cell. + for ( i = 0; i < rows; i++ ) { // ===> + top = offset.top + i * height; + my = i - ( rows - 1 ) / 2; + + for ( j = 0; j < cells; j++ ) { // ||| + left = offset.left + j * width; + mx = j - ( cells - 1 ) / 2; + + // Create a clone of the now hidden main element that will be absolute positioned + // within a wrapper div off the -left and -top equal to size of our pieces + element + .clone() + .appendTo( "body" ) + .wrap( "
" ) + .css( { + position: "absolute", + visibility: "visible", + left: -j * width, + top: -i * height + } ) + + // Select the wrapper - make it overflow: hidden and absolute positioned based on + // where the original was located +left and +top equal to the size of pieces + .parent() + .addClass( "ui-effects-explode" ) + .css( { + position: "absolute", + overflow: "hidden", + width: width, + height: height, + left: left + ( show ? mx * width : 0 ), + top: top + ( show ? my * height : 0 ), + opacity: show ? 0 : 1 + } ) + .animate( { + left: left + ( show ? 0 : mx * width ), + top: top + ( show ? 0 : my * height ), + opacity: show ? 1 : 0 + }, options.duration || 500, options.easing, childComplete ); + } + } + + function animComplete() { + element.css( { + visibility: "visible" + } ); + $( pieces ).remove(); + done(); + } +} ); + + +/*! + * jQuery UI Effects Fade 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Fade Effect +//>>group: Effects +//>>description: Fades the element. +//>>docs: https://api.jqueryui.com/fade-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectFade = $.effects.define( "fade", "toggle", function( options, done ) { + var show = options.mode === "show"; + + $( this ) + .css( "opacity", show ? 0 : 1 ) + .animate( { + opacity: show ? 1 : 0 + }, { + queue: false, + duration: options.duration, + easing: options.easing, + complete: done + } ); +} ); + + +/*! + * jQuery UI Effects Fold 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Fold Effect +//>>group: Effects +//>>description: Folds an element first horizontally and then vertically. +//>>docs: https://api.jqueryui.com/fold-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectFold = $.effects.define( "fold", "hide", function( options, done ) { + + // Create element + var element = $( this ), + mode = options.mode, + show = mode === "show", + hide = mode === "hide", + size = options.size || 15, + percent = /([0-9]+)%/.exec( size ), + horizFirst = !!options.horizFirst, + ref = horizFirst ? [ "right", "bottom" ] : [ "bottom", "right" ], + duration = options.duration / 2, + + placeholder = $.effects.createPlaceholder( element ), + + start = element.cssClip(), + animation1 = { clip: $.extend( {}, start ) }, + animation2 = { clip: $.extend( {}, start ) }, + + distance = [ start[ ref[ 0 ] ], start[ ref[ 1 ] ] ], + + queuelen = element.queue().length; + + if ( percent ) { + size = parseInt( percent[ 1 ], 10 ) / 100 * distance[ hide ? 0 : 1 ]; + } + animation1.clip[ ref[ 0 ] ] = size; + animation2.clip[ ref[ 0 ] ] = size; + animation2.clip[ ref[ 1 ] ] = 0; + + if ( show ) { + element.cssClip( animation2.clip ); + if ( placeholder ) { + placeholder.css( $.effects.clipToBox( animation2 ) ); + } + + animation2.clip = start; + } + + // Animate + element + .queue( function( next ) { + if ( placeholder ) { + placeholder + .animate( $.effects.clipToBox( animation1 ), duration, options.easing ) + .animate( $.effects.clipToBox( animation2 ), duration, options.easing ); + } + + next(); + } ) + .animate( animation1, duration, options.easing ) + .animate( animation2, duration, options.easing ) + .queue( done ); + + $.effects.unshift( element, queuelen, 4 ); +} ); + + +/*! + * jQuery UI Effects Highlight 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Highlight Effect +//>>group: Effects +//>>description: Highlights the background of an element in a defined color for a custom duration. +//>>docs: https://api.jqueryui.com/highlight-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectHighlight = $.effects.define( "highlight", "show", function( options, done ) { + var element = $( this ), + animation = { + backgroundColor: element.css( "backgroundColor" ) + }; + + if ( options.mode === "hide" ) { + animation.opacity = 0; + } + + $.effects.saveStyle( element ); + + element + .css( { + backgroundImage: "none", + backgroundColor: options.color || "#ffff99" + } ) + .animate( animation, { + queue: false, + duration: options.duration, + easing: options.easing, + complete: done + } ); +} ); + + +/*! + * jQuery UI Effects Size 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Size Effect +//>>group: Effects +//>>description: Resize an element to a specified width and height. +//>>docs: https://api.jqueryui.com/size-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectSize = $.effects.define( "size", function( options, done ) { + + // Create element + var baseline, factor, temp, + element = $( this ), + + // Copy for children + cProps = [ "fontSize" ], + vProps = [ "borderTopWidth", "borderBottomWidth", "paddingTop", "paddingBottom" ], + hProps = [ "borderLeftWidth", "borderRightWidth", "paddingLeft", "paddingRight" ], + + // Set options + mode = options.mode, + restore = mode !== "effect", + scale = options.scale || "both", + origin = options.origin || [ "middle", "center" ], + position = element.css( "position" ), + pos = element.position(), + original = $.effects.scaledDimensions( element ), + from = options.from || original, + to = options.to || $.effects.scaledDimensions( element, 0 ); + + $.effects.createPlaceholder( element ); + + if ( mode === "show" ) { + temp = from; + from = to; + to = temp; + } + + // Set scaling factor + factor = { + from: { + y: from.height / original.height, + x: from.width / original.width + }, + to: { + y: to.height / original.height, + x: to.width / original.width + } + }; + + // Scale the css box + if ( scale === "box" || scale === "both" ) { + + // Vertical props scaling + if ( factor.from.y !== factor.to.y ) { + from = $.effects.setTransition( element, vProps, factor.from.y, from ); + to = $.effects.setTransition( element, vProps, factor.to.y, to ); + } + + // Horizontal props scaling + if ( factor.from.x !== factor.to.x ) { + from = $.effects.setTransition( element, hProps, factor.from.x, from ); + to = $.effects.setTransition( element, hProps, factor.to.x, to ); + } + } + + // Scale the content + if ( scale === "content" || scale === "both" ) { + + // Vertical props scaling + if ( factor.from.y !== factor.to.y ) { + from = $.effects.setTransition( element, cProps, factor.from.y, from ); + to = $.effects.setTransition( element, cProps, factor.to.y, to ); + } + } + + // Adjust the position properties based on the provided origin points + if ( origin ) { + baseline = $.effects.getBaseline( origin, original ); + from.top = ( original.outerHeight - from.outerHeight ) * baseline.y + pos.top; + from.left = ( original.outerWidth - from.outerWidth ) * baseline.x + pos.left; + to.top = ( original.outerHeight - to.outerHeight ) * baseline.y + pos.top; + to.left = ( original.outerWidth - to.outerWidth ) * baseline.x + pos.left; + } + delete from.outerHeight; + delete from.outerWidth; + element.css( from ); + + // Animate the children if desired + if ( scale === "content" || scale === "both" ) { + + vProps = vProps.concat( [ "marginTop", "marginBottom" ] ).concat( cProps ); + hProps = hProps.concat( [ "marginLeft", "marginRight" ] ); + + // Only animate children with width attributes specified + // TODO: is this right? should we include anything with css width specified as well + element.find( "*[width]" ).each( function() { + var child = $( this ), + childOriginal = $.effects.scaledDimensions( child ), + childFrom = { + height: childOriginal.height * factor.from.y, + width: childOriginal.width * factor.from.x, + outerHeight: childOriginal.outerHeight * factor.from.y, + outerWidth: childOriginal.outerWidth * factor.from.x + }, + childTo = { + height: childOriginal.height * factor.to.y, + width: childOriginal.width * factor.to.x, + outerHeight: childOriginal.height * factor.to.y, + outerWidth: childOriginal.width * factor.to.x + }; + + // Vertical props scaling + if ( factor.from.y !== factor.to.y ) { + childFrom = $.effects.setTransition( child, vProps, factor.from.y, childFrom ); + childTo = $.effects.setTransition( child, vProps, factor.to.y, childTo ); + } + + // Horizontal props scaling + if ( factor.from.x !== factor.to.x ) { + childFrom = $.effects.setTransition( child, hProps, factor.from.x, childFrom ); + childTo = $.effects.setTransition( child, hProps, factor.to.x, childTo ); + } + + if ( restore ) { + $.effects.saveStyle( child ); + } + + // Animate children + child.css( childFrom ); + child.animate( childTo, options.duration, options.easing, function() { + + // Restore children + if ( restore ) { + $.effects.restoreStyle( child ); + } + } ); + } ); + } + + // Animate + element.animate( to, { + queue: false, + duration: options.duration, + easing: options.easing, + complete: function() { + + var offset = element.offset(); + + if ( to.opacity === 0 ) { + element.css( "opacity", from.opacity ); + } + + if ( !restore ) { + element + .css( "position", position === "static" ? "relative" : position ) + .offset( offset ); + + // Need to save style here so that automatic style restoration + // doesn't restore to the original styles from before the animation. + $.effects.saveStyle( element ); + } + + done(); + } + } ); + +} ); + + +/*! + * jQuery UI Effects Scale 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Scale Effect +//>>group: Effects +//>>description: Grows or shrinks an element and its content. +//>>docs: https://api.jqueryui.com/scale-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectScale = $.effects.define( "scale", function( options, done ) { + + // Create element + var el = $( this ), + mode = options.mode, + percent = parseInt( options.percent, 10 ) || + ( parseInt( options.percent, 10 ) === 0 ? 0 : ( mode !== "effect" ? 0 : 100 ) ), + + newOptions = $.extend( true, { + from: $.effects.scaledDimensions( el ), + to: $.effects.scaledDimensions( el, percent, options.direction || "both" ), + origin: options.origin || [ "middle", "center" ] + }, options ); + + // Fade option to support puff + if ( options.fade ) { + newOptions.from.opacity = 1; + newOptions.to.opacity = 0; + } + + $.effects.effect.size.call( this, newOptions, done ); +} ); + + +/*! + * jQuery UI Effects Puff 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Puff Effect +//>>group: Effects +//>>description: Creates a puff effect by scaling the element up and hiding it at the same time. +//>>docs: https://api.jqueryui.com/puff-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectPuff = $.effects.define( "puff", "hide", function( options, done ) { + var newOptions = $.extend( true, {}, options, { + fade: true, + percent: parseInt( options.percent, 10 ) || 150 + } ); + + $.effects.effect.scale.call( this, newOptions, done ); +} ); + + +/*! + * jQuery UI Effects Pulsate 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Pulsate Effect +//>>group: Effects +//>>description: Pulsates an element n times by changing the opacity to zero and back. +//>>docs: https://api.jqueryui.com/pulsate-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectPulsate = $.effects.define( "pulsate", "show", function( options, done ) { + var element = $( this ), + mode = options.mode, + show = mode === "show", + hide = mode === "hide", + showhide = show || hide, + + // Showing or hiding leaves off the "last" animation + anims = ( ( options.times || 5 ) * 2 ) + ( showhide ? 1 : 0 ), + duration = options.duration / anims, + animateTo = 0, + i = 1, + queuelen = element.queue().length; + + if ( show || !element.is( ":visible" ) ) { + element.css( "opacity", 0 ).show(); + animateTo = 1; + } + + // Anims - 1 opacity "toggles" + for ( ; i < anims; i++ ) { + element.animate( { opacity: animateTo }, duration, options.easing ); + animateTo = 1 - animateTo; + } + + element.animate( { opacity: animateTo }, duration, options.easing ); + + element.queue( done ); + + $.effects.unshift( element, queuelen, anims + 1 ); +} ); + + +/*! + * jQuery UI Effects Shake 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Shake Effect +//>>group: Effects +//>>description: Shakes an element horizontally or vertically n times. +//>>docs: https://api.jqueryui.com/shake-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectShake = $.effects.define( "shake", function( options, done ) { + + var i = 1, + element = $( this ), + direction = options.direction || "left", + distance = options.distance || 20, + times = options.times || 3, + anims = times * 2 + 1, + speed = Math.round( options.duration / anims ), + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + positiveMotion = ( direction === "up" || direction === "left" ), + animation = {}, + animation1 = {}, + animation2 = {}, + + queuelen = element.queue().length; + + $.effects.createPlaceholder( element ); + + // Animation + animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance; + animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2; + animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2; + + // Animate + element.animate( animation, speed, options.easing ); + + // Shakes + for ( ; i < times; i++ ) { + element + .animate( animation1, speed, options.easing ) + .animate( animation2, speed, options.easing ); + } + + element + .animate( animation1, speed, options.easing ) + .animate( animation, speed / 2, options.easing ) + .queue( done ); + + $.effects.unshift( element, queuelen, anims + 1 ); +} ); + + +/*! + * jQuery UI Effects Slide 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Slide Effect +//>>group: Effects +//>>description: Slides an element in and out of the viewport. +//>>docs: https://api.jqueryui.com/slide-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effectsEffectSlide = $.effects.define( "slide", "show", function( options, done ) { + var startClip, startRef, + element = $( this ), + map = { + up: [ "bottom", "top" ], + down: [ "top", "bottom" ], + left: [ "right", "left" ], + right: [ "left", "right" ] + }, + mode = options.mode, + direction = options.direction || "left", + ref = ( direction === "up" || direction === "down" ) ? "top" : "left", + positiveMotion = ( direction === "up" || direction === "left" ), + distance = options.distance || + element[ ref === "top" ? "outerHeight" : "outerWidth" ]( true ), + animation = {}; + + $.effects.createPlaceholder( element ); + + startClip = element.cssClip(); + startRef = element.position()[ ref ]; + + // Define hide animation + animation[ ref ] = ( positiveMotion ? -1 : 1 ) * distance + startRef; + animation.clip = element.cssClip(); + animation.clip[ map[ direction ][ 1 ] ] = animation.clip[ map[ direction ][ 0 ] ]; + + // Reverse the animation if we're showing + if ( mode === "show" ) { + element.cssClip( animation.clip ); + element.css( ref, animation[ ref ] ); + animation.clip = startClip; + animation[ ref ] = startRef; + } + + // Actually animate + element.animate( animation, { + queue: false, + duration: options.duration, + easing: options.easing, + complete: done + } ); +} ); + + +/*! + * jQuery UI Effects Transfer 1.14.1 + * https://jqueryui.com + * + * Copyright OpenJS Foundation and other contributors + * Released under the MIT license. + * https://jquery.org/license + */ + +//>>label: Transfer Effect +//>>group: Effects +//>>description: Displays a transfer effect from one element to another. +//>>docs: https://api.jqueryui.com/transfer-effect/ +//>>demos: https://jqueryui.com/effect/ + + +var effect; +if ( $.uiBackCompat === true ) { + effect = $.effects.define( "transfer", function( options, done ) { + $( this ).transfer( options, done ); + } ); +} +var effectsEffectTransfer = effect; + + + + +} ); \ No newline at end of file diff --git a/src/Yavsc/wwwroot/js/jquery-ui.min.js b/src/Yavsc/wwwroot/js/jquery-ui.min.js index 918cf40d..0d51df62 100644 --- a/src/Yavsc/wwwroot/js/jquery-ui.min.js +++ b/src/Yavsc/wwwroot/js/jquery-ui.min.js @@ -1 +1,6 @@ -!function(t){"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)}(function(I){I.ui=I.ui||{};I.ui.version="1.12.1";var n,i=0,r=Array.prototype.slice;I.cleanData=(n=I.cleanData,function(t){var e,i,s;for(s=0;null!=(i=t[s]);s++)try{(e=I._data(i,"events"))&&e.remove&&I(i).triggerHandler("remove")}catch(t){}n(t)}),I.widget=function(t,i,e){var s,n,o,a={},r=t.split(".")[0],h=r+"-"+(t=t.split(".")[1]);return e||(e=i,i=I.Widget),I.isArray(e)&&(e=I.extend.apply(null,[{}].concat(e))),I.expr[":"][h.toLowerCase()]=function(t){return!!I.data(t,h)},I[r]=I[r]||{},s=I[r][t],n=I[r][t]=function(t,e){if(!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},I.extend(n,s,{version:e.version,_proto:I.extend({},e),_childConstructors:[]}),(o=new i).options=I.widget.extend({},o.options),I.each(e,function(e,o){I.isFunction(o)?a[e]=function(){function s(){return i.prototype[e].apply(this,arguments)}function n(t){return i.prototype[e].apply(this,t)}return function(){var t,e=this._super,i=this._superApply;return this._super=s,this._superApply=n,t=o.apply(this,arguments),this._super=e,this._superApply=i,t}}():a[e]=o}),n.prototype=I.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},a,{constructor:n,namespace:r,widgetName:t,widgetFullName:h}),s?(I.each(s._childConstructors,function(t,e){var i=e.prototype;I.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),I.widget.bridge(t,n),n},I.widget.extend=function(t){for(var e,i,s=r.call(arguments,1),n=0,o=s.length;n",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=I(e||this.defaultElement||this)[0],this.element=I(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=I(),this.hoverable=I(),this.focusable=I(),this.classesElementLookup={},e!==this&&(I.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=I(e.style?e.ownerDocument:e.document||e),this.window=I(this.document[0].defaultView||this.document[0].parentWindow)),this.options=I.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:I.noop,_create:I.noop,_init:I.noop,destroy:function(){var i=this;this._destroy(),I.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:I.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return I.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=I.widget.extend({},this.options[t]),n=0;n
"),s=i.children()[0];return I("body").append(i),t=s.offsetWidth,i.css("overflow","scroll"),t===(e=s.offsetWidth)&&(e=i[0].clientWidth),i.remove(),n=t-e},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),s="scroll"===e||"auto"===e&&t.widthk(x(s),x(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(I.extend(l,{using:t}))})},I.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,o=s.width,a=t.left-e.collisionPosition.marginLeft,r=n-a,h=a+e.collisionWidth-o-n;e.collisionWidth>o?0o?0")[0],m=c.each;function _(t,e,i){var s=g[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),isNaN(t)?e.def:s.mod?(t+s.mod)%s.mod:t<0?0:s.maxo.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=_((n-s)*a+s,e)))}),this[e](l)},blend:function(t){if(1===this._rgba[3])return this;var e=this._rgba.slice(),i=e.pop(),s=p(t)._rgba;return p(c.map(e,function(t,e){return(1-i)*s[e]+i*t}))},toRgbaString:function(){var t="rgba(",e=c.map(this._rgba,function(t,e){return null==t?2
").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),(i[0]===n||I.contains(i[0],n))&&I(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(I.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),I.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),(t[0]===e||I.contains(t[0],e))&&I(e).trigger("focus")),t}}),I.extend(I.effects,{version:"1.12.1",define:function(t,e,i){return i||(i=e,e="effect"),I.effects.effect[t]=i,I.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){if(0===e)return{height:0,width:0,outerHeight:0,outerWidth:0};var s="horizontal"!==i?(e||100)/100:1,n="vertical"!==i?(e||100)/100:1;return{height:t.height()*n,width:t.width()*s,outerHeight:t.outerHeight()*n,outerWidth:t.outerWidth()*s}},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(h+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=h+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){I.effects.restoreStyle(t),I.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},I.each(t,function(t,e){var i=s.cssUnit(e);0").appendTo("body").addClass(t.className).css({top:c.top-a,left:c.left-r,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(l,t.duration,t.easing,function(){u.remove(),I.isFunction(e)&&e()})}}),I.fx.step.clip=function(t){t.clipInit||(t.start=I(t.elem).cssClip(),"string"==typeof t.end&&(t.end=a(t.end,t.elem)),t.clipInit=!0),I(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})}}(),s={},I.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){s[t]=function(t){return Math.pow(t,e+2)}}),I.extend(s,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),I.each(s,function(t,e){I.easing["easeIn"+t]=e,I.easing["easeOut"+t]=function(t){return 1-e(1-t)},I.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});I.effects,I.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=I(this),n=t.direction||"up",o=s.cssClip(),a={clip:I.extend({},o)},r=I.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(I.effects.clipToBox(a)),a.clip=o),r&&r.animate(I.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),I.effects.define("bounce",function(t,e){var i,s,n,o=I(this),a=t.mode,r="hide"===a,h="show"===a,l=t.direction||"up",c=t.distance,u=t.times||5,d=2*u+(h||r?1:0),p=t.duration/d,f=t.easing,g="up"===l||"down"===l?"top":"left",m="up"===l||"left"===l,_=0,v=o.queue().length;for(I.effects.createPlaceholder(o),n=o.css(g),c||(c=o["top"===g?"outerHeight":"outerWidth"]()/3),h&&((s={opacity:1})[g]=n,o.css("opacity",0).css(g,m?2*-c:2*c).animate(s,p,f)),r&&(c/=Math.pow(2,u-1)),(s={})[g]=n;_").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),I.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;I(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),I.effects.define("fold","hide",function(e,t){var i=I(this),s=e.mode,n="show"===s,o="hide"===s,a=e.size||15,r=/([0-9]+)%/.exec(a),h=!!e.horizFirst?["right","bottom"]:["bottom","right"],l=e.duration/2,c=I.effects.createPlaceholder(i),u=i.cssClip(),d={clip:I.extend({},u)},p={clip:I.extend({},u)},f=[u[h[0]],u[h[1]]],g=i.queue().length;r&&(a=parseInt(r[1],10)/100*f[o?0:1]),d.clip[h[0]]=a,p.clip[h[0]]=a,p.clip[h[1]]=0,n&&(i.cssClip(p.clip),c&&c.css(I.effects.clipToBox(p)),p.clip=u),i.queue(function(t){c&&c.animate(I.effects.clipToBox(d),l,e.easing).animate(I.effects.clipToBox(p),l,e.easing),t()}).animate(d,l,e.easing).animate(p,l,e.easing).queue(t),I.effects.unshift(i,g,4)}),I.effects.define("highlight","show",function(t,e){var i=I(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),I.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),I.effects.define("size",function(n,e){var t,o,i,s=I(this),a=["fontSize"],r=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],h=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],l=n.mode,c="effect"!==l,u=n.scale||"both",d=n.origin||["middle","center"],p=s.css("position"),f=s.position(),g=I.effects.scaledDimensions(s),m=n.from||g,_=n.to||I.effects.scaledDimensions(s,0);I.effects.createPlaceholder(s),"show"===l&&(i=m,m=_,_=i),o={from:{y:m.height/g.height,x:m.width/g.width},to:{y:_.height/g.height,x:_.width/g.width}},"box"!==u&&"both"!==u||(o.from.y!==o.to.y&&(m=I.effects.setTransition(s,r,o.from.y,m),_=I.effects.setTransition(s,r,o.to.y,_)),o.from.x!==o.to.x&&(m=I.effects.setTransition(s,h,o.from.x,m),_=I.effects.setTransition(s,h,o.to.x,_))),"content"!==u&&"both"!==u||o.from.y!==o.to.y&&(m=I.effects.setTransition(s,a,o.from.y,m),_=I.effects.setTransition(s,a,o.to.y,_)),d&&(t=I.effects.getBaseline(d,g),m.top=(g.outerHeight-m.outerHeight)*t.y+f.top,m.left=(g.outerWidth-m.outerWidth)*t.x+f.left,_.top=(g.outerHeight-_.outerHeight)*t.y+f.top,_.left=(g.outerWidth-_.outerWidth)*t.x+f.left),s.css(m),"content"!==u&&"both"!==u||(r=r.concat(["marginTop","marginBottom"]).concat(a),h=h.concat(["marginLeft","marginRight"]),s.find("*[width]").each(function(){var t=I(this),e=I.effects.scaledDimensions(t),i={height:e.height*o.from.y,width:e.width*o.from.x,outerHeight:e.outerHeight*o.from.y,outerWidth:e.outerWidth*o.from.x},s={height:e.height*o.to.y,width:e.width*o.to.x,outerHeight:e.height*o.to.y,outerWidth:e.width*o.to.x};o.from.y!==o.to.y&&(i=I.effects.setTransition(t,r,o.from.y,i),s=I.effects.setTransition(t,r,o.to.y,s)),o.from.x!==o.to.x&&(i=I.effects.setTransition(t,h,o.from.x,i),s=I.effects.setTransition(t,h,o.to.x,s)),c&&I.effects.saveStyle(t),t.css(i),t.animate(s,n.duration,n.easing,function(){c&&I.effects.restoreStyle(t)})})),s.animate(_,{queue:!1,duration:n.duration,easing:n.easing,complete:function(){var t=s.offset();0===_.opacity&&s.css("opacity",m.opacity),c||(s.css("position","static"===p?"relative":p).offset(t),I.effects.saveStyle(s)),e()}})}),I.effects.define("scale",function(t,e){var i=I(this),s=t.mode,n=parseInt(t.percent,10)||(0===parseInt(t.percent,10)?0:"effect"!==s?0:100),o=I.extend(!0,{from:I.effects.scaledDimensions(i),to:I.effects.scaledDimensions(i,n,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(o.from.opacity=1,o.to.opacity=0),I.effects.effect.size.call(this,o,e)}),I.effects.define("puff","hide",function(t,e){var i=I.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});I.effects.effect.scale.call(this,i,e)}),I.effects.define("pulsate","show",function(t,e){var i=I(this),s=t.mode,n="show"===s,o=n||"hide"===s,a=2*(t.times||5)+(o?1:0),r=t.duration/a,h=0,l=1,c=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),h=1);l?@[\]^`{|}~])/g,function(t){return t.replace(e,"\\$1")}),I.fn.labels=function(){var t,e,i,s,n;return this[0].labels&&this[0].labels.length?this.pushStack(this[0].labels):(s=this.eq(0).parents("label"),(i=this.attr("id"))&&(n=(t=this.eq(0).parents().last()).add(t.length?t.siblings():this.siblings()),e="label[for='"+I.ui.escapeSelector(i)+"']",s=s.add(n.find(e).addBack(e))),this.pushStack(s))},I.fn.scrollParent=function(t){var e=this.css("position"),i="absolute"===e,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/,n=this.parents().filter(function(){var t=I(this);return(!i||"static"!==t.css("position"))&&s.test(t.css("overflow")+t.css("overflow-y")+t.css("overflow-x"))}).eq(0);return"fixed"!==e&&n.length?n:I(this[0].ownerDocument||document)},I.extend(I.expr[":"],{tabbable:function(t){var e=I.attr(t,"tabindex"),i=null!=e;return(!i||0<=e)&&I.ui.focusable(t,i)}}),I.fn.extend({uniqueId:(o=0,function(){return this.each(function(){this.id||(this.id="ui-id-"+ ++o)})}),removeUniqueId:function(){return this.each(function(){/^ui-id-\d+$/.test(this.id)&&I(this).removeAttr("id")})}}),I.widget("ui.accordion",{version:"1.12.1",options:{active:0,animate:{},classes:{"ui-accordion-header":"ui-corner-top","ui-accordion-header-collapsed":"ui-corner-all","ui-accordion-content":"ui-corner-bottom"},collapsible:!1,event:"click",header:"> li > :first-child, > :not(li):even",heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=I(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():I()}},_createIcons:function(){var t,e,i=this.options.icons;i&&(t=I(""),this._addClass(t,"ui-accordion-header-icon","ui-icon "+i.header),t.prependTo(this.headers),e=this.active.children(".ui-accordion-header-icon"),this._removeClass(e,i.header)._addClass(e,null,i.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"!==t?("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e&&this._createIcons())):this._activate(e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t),this._toggleClass(this.headers.add(this.headers.next()),null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=I.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(I(t.target).attr("tabIndex",-1),I(n).attr("tabIndex",0),I(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===I.ui.keyCode.UP&&t.ctrlKey&&I(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=I()):!1===t.active?this._activate(0):this.active.length&&!I.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=I()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=I(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=I(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=I(this).outerHeight(!0)}),this.headers.next().each(function(){I(this).height(Math.max(0,i-I(this).innerHeight()+I(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=I(this).is(":visible");t||I(this).show(),i=Math.max(i,I(this).css("height","").height()),t||I(this).hide()}).height(i))},_activate:function(t){var e=this._findActive(t)[0];e!==this.active[0]&&(e=e||this.active[0],this._eventHandler({target:e,currentTarget:e,preventDefault:I.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):I()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&I.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e,i,s=this.options,n=this.active,o=I(t.currentTarget),a=o[0]===n[0],r=a&&s.collapsible,h=r?I():o.next(),l={oldHeader:n,oldPanel:n.next(),newHeader:r?I():o,newPanel:h};t.preventDefault(),a&&!s.collapsible||!1===this._trigger("beforeActivate",t,l)||(s.active=!r&&this.headers.index(o),this.active=a?I():o,this._toggle(l),this._removeClass(n,"ui-accordion-header-active","ui-state-active"),s.icons&&(e=n.children(".ui-accordion-header-icon"),this._removeClass(e,null,s.icons.activeHeader)._addClass(e,null,s.icons.header)),a||(this._removeClass(o,"ui-accordion-header-collapsed")._addClass(o,"ui-accordion-header-active","ui-state-active"),s.icons&&(i=o.children(".ui-accordion-header-icon"),this._removeClass(i,null,s.icons.header)._addClass(i,null,s.icons.activeHeader)),this._addClass(o.next(),"ui-accordion-content-active")))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(I(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){var s,n,o,a=this,r=0,h=t.css("box-sizing"),l=t.length&&(!i.length||t.index()",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault()},"click .ui-menu-item":function(t){var e=I(t.target),i=I(I.ui.safeActiveElement(this.document[0]));!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer)))},"mouseenter .ui-menu-item":function(t){if(!this.previousFilter){var e=I(t.target).closest(".ui-menu-item"),i=I(t.currentTarget);e[0]===i[0]&&(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))}},mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this.element.find(this.options.items).eq(0);e||this.focus(t,i)},blur:function(t){this._delay(function(){!I.contains(this.element[0],I.ui.safeActiveElement(this.document[0]))&&this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t),this.mouseHandled=!1}})},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=I(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n,o=!0;switch(t.keyCode){case I.ui.keyCode.PAGE_UP:this.previousPage(t);break;case I.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case I.ui.keyCode.HOME:this._move("first","first",t);break;case I.ui.keyCode.END:this._move("last","last",t);break;case I.ui.keyCode.UP:this.previous(t);break;case I.ui.keyCode.DOWN:this.next(t);break;case I.ui.keyCode.LEFT:this.collapse(t);break;case I.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case I.ui.keyCode.ENTER:case I.ui.keyCode.SPACE:this._activate(t);break;case I.ui.keyCode.ESCAPE:this.collapse(t);break;default:o=!1,i=this.previousFilter||"",n=!1,s=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),s===i?n=!0:s=i+s,e=this._filterMenuItems(s),(e=n&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(s=String.fromCharCode(t.keyCode),e=this._filterMenuItems(s)),e.length?(this.focus(t,e),this.previousFilter=s,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}o&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,i,s,n=this,o=this.options.icons.submenu,a=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),e=a.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=I(this),e=t.prev(),i=I("").data("ui-menu-submenu-caret",!0);n._addClass(i,"ui-menu-icon","ui-icon "+o),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(e,"ui-menu","ui-widget ui-widget-content ui-front"),(t=a.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=I(this);n._isDivider(t)&&n._addClass(t,"ui-menu-divider","ui-widget-content")}),s=(i=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(s,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!I.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){if("icons"===t){var i=this.element.find(".ui-menu-icon");this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)}this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i,s,n;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),s=this.active.children(".ui-menu-item-wrapper"),this._addClass(s,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",s.attr("id")),n=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(n,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s,n,o,a;this._hasScroll()&&(e=parseFloat(I.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(I.css(this.activeMenu[0],"paddingTop"))||0,s=t.offset().top-this.activeMenu.offset().top-e-i,n=this.activeMenu.scrollTop(),o=this.activeMenu.height(),a=t.outerHeight(),s<0?this.activeMenu.scrollTop(n+s):o",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,o="input"===t;this.isMultiLine=e||!o&&this._isContentEditable(this.element),this.valueMethod=this.element[e||o?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=I.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)return i=!1,void(this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault());if(!s){var e=I.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){if(n)return n=!1,void t.preventDefault();this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(clearTimeout(this.searching),this.close(t),this._change(t))}}),this._initSource(),this.menu=I("
    ").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault(),this.cancelBlur=!0,this._delay(function(){delete this.cancelBlur,this.element[0]!==I.ui.safeActiveElement(this.document[0])&&this.element.trigger("focus")})},menufocus:function(t,e){var i,s;if(this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent&&/^mouse/.test(t.originalEvent.type)))return this.menu.blur(),void this.document.one("mousemove",function(){I(t.target).trigger(t.originalEvent)});s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&I.trim(i).length&&(this.liveRegion.children().hide(),I("
    ").text(i).appendTo(this.liveRegion))},menuselect:function(t,e){var i=e.item.data("ui-autocomplete-item"),s=this.previous;this.element[0]!==I.ui.safeActiveElement(this.document[0])&&(this.element.trigger("focus"),this.previous=s,this._delay(function(){this.previous=s,this.selectedItem=i})),!1!==this._trigger("select",t,{item:i})&&this._value(i.value),this.term=this._value(),this.close(t),this.selectedItem=i}}),this.liveRegion=I("
    ",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||I.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?I(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_initSource:function(){var i,s,n=this;I.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(I.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=I.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(!t||e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length").append(I("
    ").text(e.label)).appendTo(t)},_move:function(t,e){if(this.menu.element.is(":visible"))return this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),void this.menu.blur()):void this.menu[t](e);this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())},_isContentEditable:function(t){if(!t.length)return!1;var e=t.prop("contentEditable");return"inherit"===e?this._isContentEditable(t.parent()):"true"===e}}),I.extend(I.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(I.ui.autocomplete.escapeRegex(e),"i");return I.grep(t,function(t){return i.test(t.label||t.value||t)})}}),I.widget("ui.autocomplete",I.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1").text(e).appendTo(this.liveRegion))}});I.ui.autocomplete;var a=/ui-corner-([a-z]){2,6}/g;I.widget("ui.controlgroup",{version:"1.12.1",defaultElement:"
    ",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var a=this,r=[];I.each(this.options.items,function(n,t){var e,o={};if(t)return"controlgroupLabel"===n?((e=a.element.find(t)).each(function(){var t=I(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("")}),a._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),void(r=r.concat(e.get()))):void(I.fn[n]&&(o=a["_"+n+"Options"]?a["_"+n+"Options"]("middle"):{classes:{}},a.element.find(t).each(function(){var t=I(this),e=t[n]("instance"),i=I.widget.extend({},o);if("button"!==n||!t.parent(".ui-spinner").length){e||(e=t[n]()[n]("instance")),e&&(i.classes=a._resolveClassesValues(i.classes,e)),t[n](i);var s=t[n]("widget");I.data(s[0],"ui-controlgroup-data",e||t[n]("instance")),r.push(s[0])}})))}),this.childWidgets=I(I.unique(r)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=I(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){var i=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,i)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){var e=this._buildSimpleOptions(t,"ui-spinner");return e.classes["ui-spinner-up"]="",e.classes["ui-spinner-down"]="",e},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:!!e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return I.each(i,function(t){var e=s.options.classes[t]||"";e=I.trim(e.replace(a,"")),n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"!==t?this.refresh():this._callChildMethod(e?"disable":"enable")},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,this.options.onlyVisible&&(n=n.filter(":visible")),n.length&&(I.each(["first","last"],function(t,e){var i=n[e]().data("ui-controlgroup-data");if(i&&o["_"+i.widgetName+"Options"]){var s=o["_"+i.widgetName+"Options"](1===n.length?"only":e);s.classes=o._resolveClassesValues(s.classes,i),i.element[i.widgetName](s)}else o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}});I.widget("ui.checkboxradio",[I.ui.formResetMixin,{version:"1.12.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e,i=this,s=this._super()||{};return this._readType(),e=this.element.labels(),this.label=I(e[e.length-1]),this.label.length||I.error("No label found for checkboxradio widget"),this.originalLabel="",this.label.contents().not(this.element[0]).each(function(){i.originalLabel+=3===this.nodeType?I(this).text():this.outerHTML}),this.originalLabel&&(s.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(s.disabled=t),s},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&(this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this.icon&&this._addClass(this.icon,null,"ui-state-hover")),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||I.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+I.ui.escapeSelector(t)+"']";return t?(this.form.length?I(this.form[0].elements).filter(e):I(e).filter(function(){return 0===I(this).form().length})).not(this.element):I([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=I(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){if("label"!==t||e){if(this._super(t,e),"disabled"===t)return this._toggleClass(this.label,null,"ui-state-disabled",e),void(this.element[0].disabled=e);this.refresh()}},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=I(""),this.iconSpace=I(" "),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),this.iconSpace&&(t=t.not(this.iconSpace[0])),t.remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]);var d;I.ui.checkboxradio;I.widget("ui.button",{version:"1.12.1",defaultElement:"").addClass(this._triggerClass).html(n?I("").attr({src:n,alt:s,title:s}):s)),t[a?"before":"after"](e.trigger),e.trigger.on("click",function(){return I.datepicker._datepickerShowing&&I.datepicker._lastInput===t[0]?I.datepicker._hideDatepicker():(I.datepicker._datepickerShowing&&I.datepicker._lastInput!==t[0]&&I.datepicker._hideDatepicker(),I.datepicker._showDatepicker(t[0])),!1}))},_autoSize:function(t){if(this._get(t,"autoSize")&&!t.inline){var e,i,s,n,o=new Date(2009,11,20),a=this._get(t,"dateFormat");a.match(/[DM]/)&&(e=function(t){for(n=s=i=0;ni&&(i=t[n].length,s=n);return s},o.setMonth(e(this._get(t,a.match(/MM/)?"monthNames":"monthNamesShort"))),o.setDate(e(this._get(t,a.match(/DD/)?"dayNames":"dayNamesShort"))+20-o.getDay())),t.input.attr("size",this._formatDate(t,o).length)}},_inlineDatepicker:function(t,e){var i=I(t);i.hasClass(this.markerClassName)||(i.addClass(this.markerClassName).append(e.dpDiv),I.data(t,"datepicker",e),this._setDate(e,this._getDefaultDate(e),!0),this._updateDatepicker(e),this._updateAlternate(e),e.settings.disabled&&this._disableDatepicker(t),e.dpDiv.css("display","block"))},_dialogDatepicker:function(t,e,i,s,n){var o,a,r,h,l,c=this._dialogInst;return c||(this.uuid+=1,o="dp"+this.uuid,this._dialogInput=I(""),this._dialogInput.on("keydown",this._doKeyDown),I("body").append(this._dialogInput),(c=this._dialogInst=this._newInst(this._dialogInput,!1)).settings={},I.data(this._dialogInput[0],"datepicker",c)),_(c.settings,s||{}),e=e&&e.constructor===Date?this._formatDate(c,e):e,this._dialogInput.val(e),this._pos=n?n.length?n:[n.pageX,n.pageY]:null,this._pos||(a=document.documentElement.clientWidth,r=document.documentElement.clientHeight,h=document.documentElement.scrollLeft||document.body.scrollLeft,l=document.documentElement.scrollTop||document.body.scrollTop,this._pos=[a/2-100+h,r/2-150+l]),this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px"),c.settings.onSelect=i,this._inDialog=!0,this.dpDiv.addClass(this._dialogClass),this._showDatepicker(this._dialogInput[0]),I.blockUI&&I.blockUI(this.dpDiv),I.data(this._dialogInput[0],"datepicker",c),this},_destroyDatepicker:function(t){var e,i=I(t),s=I.data(t,"datepicker");i.hasClass(this.markerClassName)&&(e=t.nodeName.toLowerCase(),I.removeData(t,"datepicker"),"input"===e?(s.append.remove(),s.trigger.remove(),i.removeClass(this.markerClassName).off("focus",this._showDatepicker).off("keydown",this._doKeyDown).off("keypress",this._doKeyPress).off("keyup",this._doKeyUp)):"div"!==e&&"span"!==e||i.removeClass(this.markerClassName).empty(),p===s&&(p=null))},_enableDatepicker:function(e){var t,i,s=I(e),n=I.data(e,"datepicker");s.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!1,n.trigger.filter("button").each(function(){this.disabled=!1}).end().filter("img").css({opacity:"1.0",cursor:""})):"div"!==t&&"span"!==t||((i=s.children("."+this._inlineClass)).children().removeClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!1)),this._disabledInputs=I.map(this._disabledInputs,function(t){return t===e?null:t}))},_disableDatepicker:function(e){var t,i,s=I(e),n=I.data(e,"datepicker");s.hasClass(this.markerClassName)&&("input"===(t=e.nodeName.toLowerCase())?(e.disabled=!0,n.trigger.filter("button").each(function(){this.disabled=!0}).end().filter("img").css({opacity:"0.5",cursor:"default"})):"div"!==t&&"span"!==t||((i=s.children("."+this._inlineClass)).children().addClass("ui-state-disabled"),i.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled",!0)),this._disabledInputs=I.map(this._disabledInputs,function(t){return t===e?null:t}),this._disabledInputs[this._disabledInputs.length]=e)},_isDisabledDatepicker:function(t){if(!t)return!1;for(var e=0;er&&sh&&ne;)--Z<0&&(Z=11,tt--);for(t.drawMonth=Z,t.drawYear=tt,i=this._get(t,"prevText"),i=K?this.formatDate(i,this._daylightSavingAdjust(new Date(tt,Z-$,1)),this._getFormatConfig(t)):i,s=this._canAdjustMonth(t,-1,tt,Z)?""+i+"":q?"":""+i+"",n=this._get(t,"nextText"),n=K?this.formatDate(n,this._daylightSavingAdjust(new Date(tt,Z+$,1)),this._getFormatConfig(t)):n,o=this._canAdjustMonth(t,1,tt,Z)?""+n+"":q?"":""+n+"",a=this._get(t,"currentText"),r=this._get(t,"gotoCurrent")&&t.currentDay?G:B,a=K?this.formatDate(a,r,this._getFormatConfig(t)):a,h=t.inline?"":"",l=j?"
    "+(Y?h:"")+(this._isInRange(t,r)?"":"")+(Y?"":h)+"
    ":"",c=parseInt(this._get(t,"firstDay"),10),c=isNaN(c)?0:c,u=this._get(t,"showWeek"),d=this._get(t,"dayNames"),p=this._get(t,"dayNamesMin"),f=this._get(t,"monthNames"),g=this._get(t,"monthNamesShort"),m=this._get(t,"beforeShowDay"),_=this._get(t,"showOtherMonths"),v=this._get(t,"selectOtherMonths"),b=this._getDefaultDate(t),y="",k=0;k"+(/all|left/.test(I)&&0===k?Y?o:s:"")+(/all|right/.test(I)&&0===k?Y?s:o:"")+this._generateMonthYearHeader(t,Z,tt,Q,J,0",P=u?"":"",w=0;w<7;w++)P+="";for(T+=P+"",S=this._getDaysInMonth(tt,Z),tt===t.selectedYear&&Z===t.selectedMonth&&(t.selectedDay=Math.min(t.selectedDay,S)),H=(this._getFirstDayOfMonth(tt,Z)-c+7)%7,z=Math.ceil((H+S)/7),O=X&&this.maxRows>z?this.maxRows:z,this.maxRows=O,A=this._daylightSavingAdjust(new Date(tt,Z,1-H)),N=0;N",W=u?"":"",w=0;w<7;w++)E=m?m.apply(t.input?t.input[0]:null,[A]):[!0,""],L=(F=A.getMonth()!==Z)&&!v||!E[0]||Q&&A"+(F&&!_?" ":L?""+A.getDate()+"":""+A.getDate()+"")+"",A.setDate(A.getDate()+1),A=this._daylightSavingAdjust(A);T+=W+""}11<++Z&&(Z=0,tt++),x+=T+="
    "+this._get(t,"weekHeader")+""+p[M]+"
    "+this._get(t,"calculateWeek")(A)+"
    "+(X?"
    "+(0
    ":""):"")}y+=x}return y+=l,t._keyEvent=!1,y},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var h,l,c,u,d,p,f,g,m=this._get(t,"changeMonth"),_=this._get(t,"changeYear"),v=this._get(t,"showMonthAfterYear"),b="
    ",y="";if(o||!m)y+=""+a[e]+"";else{for(h=s&&s.getFullYear()===i,l=n&&n.getFullYear()===i,y+=""}if(v||(b+=y+(!o&&m&&_?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!_)b+=""+i+"";else{for(u=this._get(t,"yearRange").split(":"),d=(new Date).getFullYear(),f=(p=function(t){var e=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?d+parseInt(t,10):parseInt(t,10);return isNaN(e)?d:e})(u[0]),g=Math.max(f,p(u[1]||"")),f=s?Math.max(f,s.getFullYear()):f,g=n?Math.min(g,n.getFullYear()):g,t.yearshtml+="",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),v&&(b+=(!o&&m&&_?"":" ")+y),b+="
    "},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),o=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),a=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,o)));t.selectedDay=a.getDate(),t.drawMonth=t.selectedMonth=a.getMonth(),t.drawYear=t.selectedYear=a.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),s=this._getMinMaxDate(t,"max"),n=i&&e=n.getTime())&&(!o||e.getTime()<=o.getTime())&&(!a||e.getFullYear()>=a)&&(!r||e.getFullYear()<=r)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:e="string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);var n=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),n,this._getFormatConfig(t))}}),I.fn.datepicker=function(t){if(!this.length)return this;I.datepicker.initialized||(I(document).on("mousedown",I.datepicker._checkExternalClick),I.datepicker.initialized=!0),0===I("#"+I.datepicker._mainDivId).length&&I("body").append(I.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"!=typeof t||"isDisabled"!==t&&"getDate"!==t&&"widget"!==t?"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?I.datepicker["_"+t+"Datepicker"].apply(I.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?I.datepicker["_"+t+"Datepicker"].apply(I.datepicker,[this].concat(e)):I.datepicker._attachDatepicker(this,t)}):I.datepicker["_"+t+"Datepicker"].apply(I.datepicker,[this[0]].concat(e))},I.datepicker=new f,I.datepicker.initialized=!1,I.datepicker.uuid=(new Date).getTime(),I.datepicker.version="1.12.1";I.datepicker,I.ui.ie=!!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase());var v=!1;I(document).on("mouseup",function(){v=!1});I.widget("ui.mouse",{version:"1.12.1",options:{cancel:"input, textarea, button, select, option",distance:1,delay:0},_mouseInit:function(){var e=this;this.element.on("mousedown."+this.widgetName,function(t){return e._mouseDown(t)}).on("click."+this.widgetName,function(t){if(!0===I.data(t.target,e.widgetName+".preventClickEvent"))return I.removeData(t.target,e.widgetName+".preventClickEvent"),t.stopImmediatePropagation(),!1}),this.started=!1},_mouseDestroy:function(){this.element.off("."+this.widgetName),this._mouseMoveDelegate&&this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate)},_mouseDown:function(t){if(!v){this._mouseMoved=!1,this._mouseStarted&&this._mouseUp(t),this._mouseDownEvent=t;var e=this,i=1===t.which,s=!("string"!=typeof this.options.cancel||!t.target.nodeName)&&I(t.target).closest(this.options.cancel).length;return!(i&&!s&&this._mouseCapture(t))||(this.mouseDelayMet=!this.options.delay,this.mouseDelayMet||(this._mouseDelayTimer=setTimeout(function(){e.mouseDelayMet=!0},this.options.delay)),this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(t),!this._mouseStarted)?(t.preventDefault(),!0):(!0===I.data(t.target,this.widgetName+".preventClickEvent")&&I.removeData(t.target,this.widgetName+".preventClickEvent"),this._mouseMoveDelegate=function(t){return e._mouseMove(t)},this._mouseUpDelegate=function(t){return e._mouseUp(t)},this.document.on("mousemove."+this.widgetName,this._mouseMoveDelegate).on("mouseup."+this.widgetName,this._mouseUpDelegate),t.preventDefault(),v=!0))}},_mouseMove:function(t){if(this._mouseMoved){if(I.ui.ie&&(!document.documentMode||document.documentMode<9)&&!t.button)return this._mouseUp(t);if(!t.which)if(t.originalEvent.altKey||t.originalEvent.ctrlKey||t.originalEvent.metaKey||t.originalEvent.shiftKey)this.ignoreMissingWhich=!0;else if(!this.ignoreMissingWhich)return this._mouseUp(t)}return(t.which||t.button)&&(this._mouseMoved=!0),this._mouseStarted?(this._mouseDrag(t),t.preventDefault()):(this._mouseDistanceMet(t)&&this._mouseDelayMet(t)&&(this._mouseStarted=!1!==this._mouseStart(this._mouseDownEvent,t),this._mouseStarted?this._mouseDrag(t):this._mouseUp(t)),!this._mouseStarted)},_mouseUp:function(t){this.document.off("mousemove."+this.widgetName,this._mouseMoveDelegate).off("mouseup."+this.widgetName,this._mouseUpDelegate),this._mouseStarted&&(this._mouseStarted=!1,t.target===this._mouseDownEvent.target&&I.data(t.target,this.widgetName+".preventClickEvent",!0),this._mouseStop(t)),this._mouseDelayTimer&&(clearTimeout(this._mouseDelayTimer),delete this._mouseDelayTimer),this.ignoreMissingWhich=!1,v=!1,t.preventDefault()},_mouseDistanceMet:function(t){return Math.max(Math.abs(this._mouseDownEvent.pageX-t.pageX),Math.abs(this._mouseDownEvent.pageY-t.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),I.ui.plugin={add:function(t,e,i){var s,n=I.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=I.ui.safeActiveElement(this.document[0]);I(t.target).closest(e).length||I.ui.safeBlur(e)},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),I.ui.ddmanager&&(I.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0i[2]&&(h=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3]&&(l=i[3]+this.offset.click.top)),a.grid&&(n=a.grid[1]?this.originalPageY+Math.round((l-this.originalPageY)/a.grid[1])*a.grid[1]:this.originalPageY,l=i?n-this.offset.click.top>=i[1]||n-this.offset.click.top>i[3]?n:n-this.offset.click.top>=i[1]?n-a.grid[1]:n+a.grid[1]:n,o=a.grid[0]?this.originalPageX+Math.round((h-this.originalPageX)/a.grid[0])*a.grid[0]:this.originalPageX,h=i?o-this.offset.click.left>=i[0]||o-this.offset.click.left>i[2]?o:o-this.offset.click.left>=i[0]?o-a.grid[0]:o+a.grid[0]:o),"y"===a.axis&&(h=this.originalPageX),"x"===a.axis&&(l=this.originalPageY)),{top:l-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:r?0:this.offset.scroll.top),left:h-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:r?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),I.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),I.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),I.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=I.extend({},t,{item:i.element});i.sortables=[],I(i.options.connectToSortable).each(function(){var t=I(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=I.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,I.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){I.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,I.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,this!==e&&this._intersectsWith(this.containerCache)&&I.contains(e.element[0],this.element[0])&&(t=!1),t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,I.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,I.each(n.sortables,function(){this.refreshPositions()}))})}}),I.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=I("body"),n=i.options;s.css("cursor")&&(n._cursor=s.css("cursor")),s.css("cursor",n.cursor)},stop:function(t,e,i){var s=i.options;s._cursor&&I("body").css("cursor",s._cursor)}}),I.ui.plugin.add("draggable","opacity",{start:function(t,e,i){var s=I(e.helper),n=i.options;s.css("opacity")&&(n._opacity=s.css("opacity")),s.css("opacity",n.opacity)},stop:function(t,e,i){var s=i.options;s._opacity&&I(e.helper).css("opacity",s._opacity)}}),I.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY
    ").css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&I(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy();var t,e=function(t){I(t).removeData("resizable").removeData("ui-resizable").off(".resizable").find(".ui-resizable-handle").remove()};return this.elementIsWrapper&&(e(this.element),t=this.element,this.originalElement.css({position:t.css("position"),width:t.outerWidth(),height:t.outerHeight(),top:t.css("top"),left:t.css("left")}).insertAfter(t),t.remove()),this.originalElement.css("resize",this.originalResizeStyle),e(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles()}},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(I(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=I(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.append(n);this._renderAxis=function(t){var e,i,s,n;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=I(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=I(this.handles[e],this.element),n=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),s=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(s,n),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._handles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)((i=I(this.handles[e])[0])===t.target||I.contains(i,t.target))&&(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s,n=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),n.containment&&(e+=I(n.containment).scrollLeft()||0,i+=I(n.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:o.width(),height:o.height()},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:o.width(),height:o.height()},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof n.aspectRatio?n.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=I(".ui-resizable-"+this.axis).css("cursor"),I("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e,i,s=this.originalMousePosition,n=this.axis,o=t.pageX-s.left||0,a=t.pageY-s.top||0,r=this._change[n];return this._updatePrevProperties(),r&&(e=r.apply(this,[t,o,a]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),i=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),I.isEmptyObject(i)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n,o,a,r,h=this.options,l=this;return this._helper&&(s=(i=(e=this._proportionallyResizeElements).length&&/textarea/i.test(e[0].nodeName))&&this._hasScroll(e[0],"left")?0:l.sizeDiff.height,n=i?0:l.sizeDiff.width,o={width:l.helper.width()-n,height:l.helper.height()-s},a=parseFloat(l.element.css("left"))+(l.position.left-l.originalPosition.left)||null,r=parseFloat(l.element.css("top"))+(l.position.top-l.originalPosition.top)||null,h.animate||this.element.css(I.extend(o,{top:r,left:a})),l.helper.height(l.size.height),l.helper.width(l.size.width),this._helper&&!h.animate&&this._proportionallyResize()),I("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s,n,o,a=this.options;o={minWidth:this._isNumber(a.minWidth)?a.minWidth:0,maxWidth:this._isNumber(a.maxWidth)?a.maxWidth:1/0,minHeight:this._isNumber(a.minHeight)?a.minHeight:0,maxHeight:this._isNumber(a.maxHeight)?a.maxHeight:1/0},(this._aspectRatio||t)&&(e=o.minHeight*this.aspectRatio,s=o.minWidth/this.aspectRatio,i=o.maxHeight*this.aspectRatio,n=o.maxWidth/this.aspectRatio,e>o.minWidth&&(o.minWidth=e),s>o.minHeight&&(o.minHeight=s),it.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,h=this.originalPosition.top+this.originalSize.height,l=/sw|nw|w/.test(i),c=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=r-e.minWidth),s&&l&&(t.left=r-e.maxWidth),a&&c&&(t.top=h-e.minHeight),n&&c&&(t.top=h-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e
    "),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return I.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return I.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return I.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return I.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){I.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),I.ui.plugin.add("resizable","animate",{stop:function(e){var i=I(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,a=n?0:i.sizeDiff.width,r={width:i.size.width-a,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,l=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(I.extend(r,l&&h?{top:l,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&I(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),I.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,n,o,a,r=I(this).resizable("instance"),h=r.options,l=r.element,c=h.containment,u=c instanceof I?c.get(0):/parent/.test(c)?l.parent().get(0):c;u&&(r.containerElement=I(u),/document/.test(c)||c===document?(r.containerOffset={left:0,top:0},r.containerPosition={left:0,top:0},r.parentData={element:I(document),left:0,top:0,width:I(document).width(),height:I(document).height()||document.body.parentNode.scrollHeight}):(i=I(u),s=[],I(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=r._num(i.css("padding"+e))}),r.containerOffset=i.offset(),r.containerPosition=i.position(),r.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=r.containerOffset,e=r.containerSize.height,n=r.containerSize.width,o=r._hasScroll(u,"left")?u.scrollWidth:n,a=r._hasScroll(u)?u.scrollHeight:e,r.parentData={element:u,left:t.left,top:t.top,width:o,height:a}))},resize:function(t){var e,i,s,n,o=I(this).resizable("instance"),a=o.options,r=o.containerOffset,h=o.position,l=o._aspectRatio||t.shiftKey,c={top:0,left:0},u=o.containerElement,d=!0;u[0]!==document&&/static/.test(u.css("position"))&&(c=r),h.left<(o._helper?r.left:0)&&(o.size.width=o.size.width+(o._helper?o.position.left-r.left:o.position.left-c.left),l&&(o.size.height=o.size.width/o.aspectRatio,d=!1),o.position.left=a.helper?r.left:0),h.top<(o._helper?r.top:0)&&(o.size.height=o.size.height+(o._helper?o.position.top-r.top:o.position.top),l&&(o.size.width=o.size.height*o.aspectRatio,d=!1),o.position.top=o._helper?r.top:0),s=o.containerElement.get(0)===o.element.parent().get(0),n=/relative|absolute/.test(o.containerElement.css("position")),s&&n?(o.offset.left=o.parentData.left+o.position.left,o.offset.top=o.parentData.top+o.position.top):(o.offset.left=o.element.offset().left,o.offset.top=o.element.offset().top),e=Math.abs(o.sizeDiff.width+(o._helper?o.offset.left-c.left:o.offset.left-r.left)),i=Math.abs(o.sizeDiff.height+(o._helper?o.offset.top-c.top:o.offset.top-r.top)),e+o.size.width>=o.parentData.width&&(o.size.width=o.parentData.width-e,l&&(o.size.height=o.size.width/o.aspectRatio,d=!1)),i+o.size.height>=o.parentData.height&&(o.size.height=o.parentData.height-i,l&&(o.size.width=o.size.height*o.aspectRatio,d=!1)),d||(o.position.left=o.prevPosition.left,o.position.top=o.prevPosition.top,o.size.width=o.prevSize.width,o.size.height=o.prevSize.height)},stop:function(){var t=I(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=I(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,h=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&I(this).css({left:a.left-s.left-i.left,width:r,height:h}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&I(this).css({left:a.left-s.left-i.left,width:r,height:h})}}),I.ui.plugin.add("resizable","alsoResize",{start:function(){var t=I(this).resizable("instance").options;I(t.alsoResize).each(function(){var t=I(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=I(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};I(s.alsoResize).each(function(){var t=I(this),s=I(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];I.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){I(this).removeData("ui-resizable-alsoresize")}}),I.ui.plugin.add("resizable","ghost",{start:function(){var t=I(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==I.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=I(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=I(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),I.ui.plugin.add("resizable","grid",{resize:function(){var t,e=I(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,h=r[0]||1,l=r[1]||1,c=Math.round((s.width-n.width)/h)*h,u=Math.round((s.height-n.height)/l)*l,d=n.width+c,p=n.height+u,f=i.maxWidth&&i.maxWidthd,_=i.minHeight&&i.minHeight>p;i.grid=r,m&&(d+=h),_&&(p+=l),f&&(d-=h),g&&(p-=l),/^(se|s|e)$/.test(a)?(e.size.width=d,e.size.height=p):/^(ne)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.top=o.top-u):/^(sw)$/.test(a)?(e.size.width=d,e.size.height=p,e.position.left=o.left-c):((p-l<=0||d-h<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",n+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=I(I.ui.safeActiveElement(this.document[0])),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;t||(t=this.element.find("[autofocus]")),t.length||(t=this.element.find(":tabbable")),t.length||(t=this.uiDialogButtonPane.find(":tabbable")),t.length||(t=this.uiDialogTitlebarClose.filter(":tabbable")),t.length||(t=this.uiDialog),t.eq(0).trigger("focus")},_keepFocus:function(t){function e(){var t=I.ui.safeActiveElement(this.document[0]);this.uiDialog[0]===t||I.contains(this.uiDialog[0],t)||this._focusTabbable()}t.preventDefault(),e.call(this),this._delay(e)},_createWrapper:function(){this.uiDialog=I("
    ").hide().attr({tabIndex:-1,role:"dialog"}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){if(this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===I.ui.keyCode.ESCAPE)return t.preventDefault(),void this.close(t);if(t.keyCode===I.ui.keyCode.TAB&&!t.isDefaultPrevented()){var e=this.uiDialog.find(":tabbable"),i=e.filter(":first"),s=e.filter(":last");t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault())}},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){var t;this.uiDialogTitlebar=I("
    "),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){I(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=I("").button({label:I("").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}}),t=I("").uniqueId().prependTo(this.uiDialogTitlebar),this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=I("
    "),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=I("
    ").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var n=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),I.isEmptyObject(t)||I.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(I.each(t,function(t,e){var i,s;e=I.isFunction(e)?{click:e,text:t}:e,e=I.extend({type:"button"},e),i=e.click,s={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,I("",e).button(s).appendTo(n.uiButtonSet).on("click",function(){i.apply(n.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(I(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(I(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var o=this,a=this.options,t=a.resizable,e=this.uiDialog.css("position"),i="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function r(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:a.maxWidth,maxHeight:a.maxHeight,minWidth:a.minWidth,minHeight:this._minHeight(),handles:i,start:function(t,e){o._addClass(I(this),"ui-dialog-resizing"),o._blockFrames(),o._trigger("resizeStart",t,r(e))},resize:function(t,e){o._trigger("resize",t,r(e))},stop:function(t,e){var i=o.uiDialog.offset(),s=i.left-o.document.scrollLeft(),n=i.top-o.document.scrollTop();a.height=o.uiDialog.height(),a.width=o.uiDialog.width(),a.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=n?"+":"")+n,of:o.window},o._removeClass(I(this),"ui-dialog-resizing"),o._unblockFrames(),o._trigger("resizeStop",t,r(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=I(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=I.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||(t=[],this.document.data("ui-dialog-instances",t)),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};I.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s,n=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:I("").text(""+this.options.closeText).html()}),"draggable"===t&&((i=n.is(":data(ui-draggable)"))&&!e&&n.draggable("destroy"),!i&&e&&this._makeDraggable()),"position"===t&&this._position(),"resizable"===t&&((s=n.is(":data(ui-resizable)"))&&!e&&n.resizable("destroy"),s&&"string"==typeof e&&n.resizable("option","handles",e),s||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")))},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=I(this);return I("
    ").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!I(t.target).closest(".ui-dialog").length||!!I(t.target).closest(".ui-datepicker").length},_createOverlay:function(){if(this.options.modal){var e=!0;this._delay(function(){e=!1}),this.document.data("ui-dialog-overlays")||this._on(this.document,{focusin:function(t){e||this._allowInteraction(t)||(t.preventDefault(),this._trackingInstances()[0]._focusTabbable())}}),this.overlay=I("
    ").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1)}},_destroyOverlay:function(){if(this.options.modal&&this.overlay){var t=this.document.data("ui-dialog-overlays")-1;t?this.document.data("ui-dialog-overlays",t):(this._off(this.document,"focusin"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null}}}),!1!==I.uiBackCompat&&I.widget("ui.dialog",I.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}});I.ui.dialog;I.widget("ui.droppable",{version:"1.12.1",widgetEventPrefix:"drop",options:{accept:"*",addClasses:!0,greedy:!1,scope:"default",tolerance:"intersect",activate:null,deactivate:null,drop:null,out:null,over:null},_create:function(){var t,e=this.options,i=e.accept;this.isover=!1,this.isout=!0,this.accept=I.isFunction(i)?i:function(t){return t.is(i)},this.proportions=function(){if(!arguments.length)return t||(t={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight});t=arguments[0]},this._addToManager(e.scope),e.addClasses&&this._addClass("ui-droppable")},_addToManager:function(t){I.ui.ddmanager.droppables[t]=I.ui.ddmanager.droppables[t]||[],I.ui.ddmanager.droppables[t].push(this)},_splice:function(t){for(var e=0;e").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=I("
    ").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),I.widget("ui.selectable",I.ui.mouse,{version:"1.12.1",options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch",selected:null,selecting:null,start:null,stop:null,unselected:null,unselecting:null},_create:function(){var s=this;this._addClass("ui-selectable"),this.dragged=!1,this.refresh=function(){s.elementPos=I(s.element[0]).offset(),s.selectees=I(s.options.filter,s.element[0]),s._addClass(s.selectees,"ui-selectee"),s.selectees.each(function(){var t=I(this),e=t.offset(),i={left:e.left-s.elementPos.left,top:e.top-s.elementPos.top};I.data(this,"selectable-item",{element:this,$element:t,left:i.left,top:i.top,right:i.left+t.outerWidth(),bottom:i.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this._mouseInit(),this.helper=I("
    "),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=I(this.element[0]).offset(),this.options.disabled||(this.selectees=I(t.filter,this.element[0]),this._trigger("start",i),I(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=I.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),I(i.target).parents().addBack().each(function(){var t,e=I.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){if(this.dragged=!0,!this.options.disabled){var t,n=this,o=this.options,a=this.opos[0],r=this.opos[1],h=s.pageX,l=s.pageY;return hh||i.rightl||i.bottoma&&i.rightr&&i.bottom",options:{appendTo:null,classes:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"},disabled:null,icons:{button:"ui-icon-triangle-1-s"},position:{my:"left top",at:"left bottom",collision:"none"},width:!1,change:null,close:null,focus:null,open:null,select:null},_create:function(){var t=this.element.uniqueId().attr("id");this.ids={element:t,button:t+"-button",menu:t+"-menu"},this._drawButton(),this._drawMenu(),this._bindFormResetHandler(),this._rendered=!1,this.menuItems=I()},_drawButton:function(){var t,e=this,i=this._parseOption(this.element.find("option:selected"),this.element[0].selectedIndex);this.labels=this.element.labels().attr("for",this.ids.button),this._on(this.labels,{click:function(t){this.button.focus(),t.preventDefault()}}),this.element.hide(),this.button=I("",{tabindex:this.options.disabled?-1:0,id:this.ids.button,role:"combobox","aria-expanded":"false","aria-autocomplete":"list","aria-owns":this.ids.menu,"aria-haspopup":"true",title:this.element.attr("title")}).insertAfter(this.element),this._addClass(this.button,"ui-selectmenu-button ui-selectmenu-button-closed","ui-button ui-widget"),t=I("").appendTo(this.button),this._addClass(t,"ui-selectmenu-icon","ui-icon "+this.options.icons.button),this.buttonItem=this._renderButtonItem(i).appendTo(this.button),!1!==this.options.width&&this._resizeButton(),this._on(this.button,this._buttonEvents),this.button.one("focusin",function(){e._rendered||e._refreshMenu()})},_drawMenu:function(){var s=this;this.menu=I("
      ",{"aria-hidden":"true","aria-labelledby":this.ids.button,id:this.ids.menu}),this.menuWrap=I("
      ").append(this.menu),this._addClass(this.menuWrap,"ui-selectmenu-menu","ui-front"),this.menuWrap.appendTo(this._appendTo()),this.menuInstance=this.menu.menu({classes:{"ui-menu":"ui-corner-bottom"},role:"listbox",select:function(t,e){t.preventDefault(),s._setSelection(),s._select(e.item.data("ui-selectmenu-item"),t)},focus:function(t,e){var i=e.item.data("ui-selectmenu-item");null!=s.focusIndex&&i.index!==s.focusIndex&&(s._trigger("focus",t,{item:i}),s.isOpen||s._select(i,t)),s.focusIndex=i.index,s.button.attr("aria-activedescendant",s.menuItems.eq(i.index).attr("id"))}}).menu("instance"),this.menuInstance._off(this.menu,"mouseleave"),this.menuInstance._closeOnDocumentClick=function(){return!1},this.menuInstance._isDivider=function(){return!1}},refresh:function(){this._refreshMenu(),this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(this._getSelectedItem().data("ui-selectmenu-item")||{})),null===this.options.width&&this._resizeButton()},_refreshMenu:function(){var t,e=this.element.find("option");this.menu.empty(),this._parseOptions(e),this._renderMenu(this.menu,this.items),this.menuInstance.refresh(),this.menuItems=this.menu.find("li").not(".ui-selectmenu-optgroup").find(".ui-menu-item-wrapper"),this._rendered=!0,e.length&&(t=this._getSelectedItem(),this.menuInstance.focus(null,t),this._setAria(t.data("ui-selectmenu-item")),this._setOption("disabled",this.element.prop("disabled")))},open:function(t){this.options.disabled||(this._rendered?(this._removeClass(this.menu.find(".ui-state-active"),null,"ui-state-active"),this.menuInstance.focus(null,this._getSelectedItem())):this._refreshMenu(),this.menuItems.length&&(this.isOpen=!0,this._toggleAttr(),this._resizeMenu(),this._position(),this._on(this.document,this._documentClick),this._trigger("open",t)))},_position:function(){this.menuWrap.position(I.extend({of:this.button},this.options.position))},close:function(t){this.isOpen&&(this.isOpen=!1,this._toggleAttr(),this.range=null,this._off(this.document),this._trigger("close",t))},widget:function(){return this.button},menuWidget:function(){return this.menu},_renderButtonItem:function(t){var e=I("");return this._setText(e,t.label),this._addClass(e,"ui-selectmenu-text"),e},_renderMenu:function(s,t){var n=this,o="";I.each(t,function(t,e){var i;e.optgroup!==o&&(i=I("
    • ",{text:e.optgroup}),n._addClass(i,"ui-selectmenu-optgroup","ui-menu-divider"+(e.element.parent("optgroup").prop("disabled")?" ui-state-disabled":"")),i.appendTo(s),o=e.optgroup),n._renderItemData(s,e)})},_renderItemData:function(t,e){return this._renderItem(t,e).data("ui-selectmenu-item",e)},_renderItem:function(t,e){var i=I("
    • "),s=I("
      ",{title:e.element.attr("title")});return e.disabled&&this._addClass(i,null,"ui-state-disabled"),this._setText(s,e.label),i.append(s).appendTo(t)},_setText:function(t,e){e?t.text(e):t.html(" ")},_move:function(t,e){var i,s,n=".ui-menu-item";this.isOpen?i=this.menuItems.eq(this.focusIndex).parent("li"):(i=this.menuItems.eq(this.element[0].selectedIndex).parent("li"),n+=":not(.ui-state-disabled)"),(s="first"===t||"last"===t?i["first"===t?"prevAll":"nextAll"](n).eq(-1):i[t+"All"](n).eq(0)).length&&this.menuInstance.focus(e,s)},_getSelectedItem:function(){return this.menuItems.eq(this.element[0].selectedIndex).parent("li")},_toggle:function(t){this[this.isOpen?"close":"open"](t)},_setSelection:function(){var t;this.range&&(window.getSelection?((t=window.getSelection()).removeAllRanges(),t.addRange(this.range)):this.range.select(),this.button.focus())},_documentClick:{mousedown:function(t){this.isOpen&&(I(t.target).closest(".ui-selectmenu-menu, #"+I.ui.escapeSelector(this.ids.button)).length||this.close(t))}},_buttonEvents:{mousedown:function(){var t;window.getSelection?(t=window.getSelection()).rangeCount&&(this.range=t.getRangeAt(0)):this.range=document.selection.createRange()},click:function(t){this._setSelection(),this._toggle(t)},keydown:function(t){var e=!0;switch(t.keyCode){case I.ui.keyCode.TAB:case I.ui.keyCode.ESCAPE:this.close(t),e=!1;break;case I.ui.keyCode.ENTER:this.isOpen&&this._selectFocusedItem(t);break;case I.ui.keyCode.UP:t.altKey?this._toggle(t):this._move("prev",t);break;case I.ui.keyCode.DOWN:t.altKey?this._toggle(t):this._move("next",t);break;case I.ui.keyCode.SPACE:this.isOpen?this._selectFocusedItem(t):this._toggle(t);break;case I.ui.keyCode.LEFT:this._move("prev",t);break;case I.ui.keyCode.RIGHT:this._move("next",t);break;case I.ui.keyCode.HOME:case I.ui.keyCode.PAGE_UP:this._move("first",t);break;case I.ui.keyCode.END:case I.ui.keyCode.PAGE_DOWN:this._move("last",t);break;default:this.menu.trigger(t),e=!1}e&&t.preventDefault()}},_selectFocusedItem:function(t){var e=this.menuItems.eq(this.focusIndex).parent("li");e.hasClass("ui-state-disabled")||this._select(e.data("ui-selectmenu-item"),t)},_select:function(t,e){var i=this.element[0].selectedIndex;this.element[0].selectedIndex=t.index,this.buttonItem.replaceWith(this.buttonItem=this._renderButtonItem(t)),this._setAria(t),this._trigger("select",e,{item:t}),t.index!==i&&this._trigger("change",e,{item:t}),this.close(e)},_setAria:function(t){var e=this.menuItems.eq(t.index).attr("id");this.button.attr({"aria-labelledby":e,"aria-activedescendant":e}),this.menu.attr("aria-activedescendant",e)},_setOption:function(t,e){if("icons"===t){var i=this.button.find("span.ui-icon");this._removeClass(i,null,this.options.icons.button)._addClass(i,null,e.button)}this._super(t,e),"appendTo"===t&&this.menuWrap.appendTo(this._appendTo()),"width"===t&&this._resizeButton()},_setOptionDisabled:function(t){this._super(t),this.menuInstance.option("disabled",t),this.button.attr("aria-disabled",t),this._toggleClass(this.button,null,"ui-state-disabled",t),this.element.prop("disabled",t),t?(this.button.attr("tabindex",-1),this.close()):this.button.attr("tabindex",0)},_appendTo:function(){var t=this.options.appendTo;return t&&(t=t.jquery||t.nodeType?I(t):this.document.find(t).eq(0)),t&&t[0]||(t=this.element.closest(".ui-front, dialog")),t.length||(t=this.document[0].body),t},_toggleAttr:function(){this.button.attr("aria-expanded",this.isOpen),this._removeClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"closed":"open"))._addClass(this.button,"ui-selectmenu-button-"+(this.isOpen?"open":"closed"))._toggleClass(this.menuWrap,"ui-selectmenu-open",null,this.isOpen),this.menu.attr("aria-hidden",!this.isOpen)},_resizeButton:function(){var t=this.options.width;!1!==t?(null===t&&(t=this.element.show().outerWidth(),this.element.hide()),this.button.outerWidth(t)):this.button.css("width","")},_resizeMenu:function(){this.menu.outerWidth(Math.max(this.button.outerWidth(),this.menu.width("").outerWidth()+1))},_getCreateOptions:function(){var t=this._super();return t.disabled=this.element.prop("disabled"),t},_parseOptions:function(t){var i=this,s=[];t.each(function(t,e){s.push(i._parseOption(I(e),t))}),this.items=s},_parseOption:function(t,e){var i=t.parent("optgroup");return{element:t,index:e,value:t.val(),label:t.text(),optgroup:i.attr("label")||"",disabled:i.prop("disabled")||t.prop("disabled")}},_destroy:function(){this._unbindFormResetHandler(),this.menuWrap.remove(),this.button.remove(),this.element.show(),this.element.removeUniqueId(),this.labels.attr("for",this.ids.element)}}]),I.widget("ui.slider",I.ui.mouse,{version:"1.12.1",widgetEventPrefix:"slide",options:{animate:!1,classes:{"ui-slider":"ui-corner-all","ui-slider-handle":"ui-corner-all","ui-slider-range":"ui-corner-all ui-widget-header"},distance:0,max:100,min:0,orientation:"horizontal",range:!1,step:1,value:0,values:null,change:null,slide:null,start:null,stop:null},numPages:5,_create:function(){this._keySliding=!1,this._mouseSliding=!1,this._animateOff=!0,this._handleIndex=null,this._detectOrientation(),this._mouseInit(),this._calculateNewMax(),this._addClass("ui-slider ui-slider-"+this.orientation,"ui-widget ui-widget-content"),this._refresh(),this._animateOff=!1},_refresh:function(){this._createRange(),this._createHandles(),this._setupEvents(),this._refreshValue()},_createHandles:function(){var t,e,i=this.options,s=this.element.find(".ui-slider-handle"),n=[];for(e=i.values&&i.values.length||1,s.length>e&&(s.slice(e).remove(),s=s.slice(0,e)),t=s.length;t");this.handles=s.add(I(n.join("")).appendTo(this.element)),this._addClass(this.handles,"ui-slider-handle","ui-state-default"),this.handle=this.handles.eq(0),this.handles.each(function(t){I(this).data("ui-slider-handle-index",t).attr("tabIndex",0)})},_createRange:function(){var t=this.options;t.range?(!0===t.range&&(t.values?t.values.length&&2!==t.values.length?t.values=[t.values[0],t.values[0]]:I.isArray(t.values)&&(t.values=t.values.slice(0)):t.values=[this._valueMin(),this._valueMin()]),this.range&&this.range.length?(this._removeClass(this.range,"ui-slider-range-min ui-slider-range-max"),this.range.css({left:"",bottom:""})):(this.range=I("
      ").appendTo(this.element),this._addClass(this.range,"ui-slider-range")),"min"!==t.range&&"max"!==t.range||this._addClass(this.range,"ui-slider-range-"+t.range)):(this.range&&this.range.remove(),this.range=null)},_setupEvents:function(){this._off(this.handles),this._on(this.handles,this._handleEvents),this._hoverable(this.handles),this._focusable(this.handles)},_destroy:function(){this.handles.remove(),this.range&&this.range.remove(),this._mouseDestroy()},_mouseCapture:function(t){var e,i,s,n,o,a,r,h=this,l=this.options;return!l.disabled&&(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),e={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(e),s=this._valueMax()-this._valueMin()+1,this.handles.each(function(t){var e=Math.abs(i-h.values(t));(e=this._valueMax())return this._valueMax();var e=0=e&&(s+=0this.options.max&&(t-=i),this.max=parseFloat(t.toFixed(this._precision()))},_precision:function(){var t=this._precisionOf(this.options.step);return null!==this.options.min&&(t=Math.max(t,this._precisionOf(this.options.min))),t},_precisionOf:function(t){var e=t.toString(),i=e.indexOf(".");return-1===i?0:e.length-i-1},_valueMin:function(){return this.options.min},_valueMax:function(){return this.max},_refreshRange:function(t){"vertical"===t&&this.range.css({width:"",left:""}),"horizontal"===t&&this.range.css({height:"",bottom:""})},_refreshValue:function(){var e,i,t,s,n,o=this.options.range,a=this.options,r=this,h=!this._animateOff&&a.animate,l={};this._hasMultipleValues()?this.handles.each(function(t){i=(r.values(t)-r._valueMin())/(r._valueMax()-r._valueMin())*100,l["horizontal"===r.orientation?"left":"bottom"]=i+"%",I(this).stop(1,1)[h?"animate":"css"](l,a.animate),!0===r.options.range&&("horizontal"===r.orientation?(0===t&&r.range.stop(1,1)[h?"animate":"css"]({left:i+"%"},a.animate),1===t&&r.range[h?"animate":"css"]({width:i-e+"%"},{queue:!1,duration:a.animate})):(0===t&&r.range.stop(1,1)[h?"animate":"css"]({bottom:i+"%"},a.animate),1===t&&r.range[h?"animate":"css"]({height:i-e+"%"},{queue:!1,duration:a.animate}))),e=i}):(t=this.value(),s=this._valueMin(),n=this._valueMax(),i=n!==s?(t-s)/(n-s)*100:0,l["horizontal"===this.orientation?"left":"bottom"]=i+"%",this.handle.stop(1,1)[h?"animate":"css"](l,a.animate),"min"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:i+"%"},a.animate),"max"===o&&"horizontal"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({width:100-i+"%"},a.animate),"min"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:i+"%"},a.animate),"max"===o&&"vertical"===this.orientation&&this.range.stop(1,1)[h?"animate":"css"]({height:100-i+"%"},a.animate))},_handleEvents:{keydown:function(t){var e,i,s,n=I(t.target).data("ui-slider-handle-index");switch(t.keyCode){case I.ui.keyCode.HOME:case I.ui.keyCode.END:case I.ui.keyCode.PAGE_UP:case I.ui.keyCode.PAGE_DOWN:case I.ui.keyCode.UP:case I.ui.keyCode.RIGHT:case I.ui.keyCode.DOWN:case I.ui.keyCode.LEFT:if(t.preventDefault(),!this._keySliding&&(this._keySliding=!0,this._addClass(I(t.target),null,"ui-state-active"),!1===this._start(t,n)))return}switch(s=this.options.step,e=i=this._hasMultipleValues()?this.values(n):this.value(),t.keyCode){case I.ui.keyCode.HOME:i=this._valueMin();break;case I.ui.keyCode.END:i=this._valueMax();break;case I.ui.keyCode.PAGE_UP:i=this._trimAlignValue(e+(this._valueMax()-this._valueMin())/this.numPages);break;case I.ui.keyCode.PAGE_DOWN:i=this._trimAlignValue(e-(this._valueMax()-this._valueMin())/this.numPages);break;case I.ui.keyCode.UP:case I.ui.keyCode.RIGHT:if(e===this._valueMax())return;i=this._trimAlignValue(e+s);break;case I.ui.keyCode.DOWN:case I.ui.keyCode.LEFT:if(e===this._valueMin())return;i=this._trimAlignValue(e-s)}this._slide(t,n,i)},keyup:function(t){var e=I(t.target).data("ui-slider-handle-index");this._keySliding&&(this._keySliding=!1,this._stop(t,e),this._change(t,e),this._removeClass(I(t.target),null,"ui-state-active"))}}}),I.widget("ui.sortable",I.ui.mouse,{version:"1.12.1",widgetEventPrefix:"sort",ready:!1,options:{appendTo:"parent",axis:!1,connectWith:!1,containment:!1,cursor:"auto",cursorAt:!1,dropOnEmpty:!0,forcePlaceholderSize:!1,forceHelperSize:!1,grid:!1,handle:!1,helper:"original",items:"> *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t*{ cursor: "+o.cursor+" !important; }").appendTo(n)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return I.ui.ddmanager&&(I.ui.ddmanager.current=this),I.ui.ddmanager&&!o.dropBehaviour&&I.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this._mouseDrag(t),!0},_mouseDrag:function(t){var e,i,s,n,o=this.options,a=!1;for(this.position=this._generatePosition(t),this.positionAbs=this._convertPositionTo("absolute"),this.lastPositionAbs||(this.lastPositionAbs=this.positionAbs),this.options.scroll&&(this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageYt[this.floating?"width":"height"]?p:o",i.document[0]);return i._addClass(e,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(e,"ui-sortable-helper"),"tbody"===t?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),I("",i.document[0]).appendTo(e)):"tr"===t?i._createTrPlaceholder(i.currentItem,e):"img"===t&&e.attr("src",i.currentItem.attr("src")),s||e.css("visibility","hidden"),e},update:function(t,e){s&&!n.forcePlaceholderSize||(e.height()||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width()||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10)))}}),i.placeholder=I(n.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),n.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){I(" ",i.document[0]).attr("colspan",I(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){var e,i,s,n,o,a,r,h,l,c,u=null,d=null;for(e=this.containers.length-1;0<=e;e--)if(!I.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(u&&I.contains(this.containers[e].element[0],u.element[0]))continue;u=this.containers[e],d=e}else this.containers[e].containerCache.over&&(this.containers[e]._trigger("out",t,this._uiHash(this)),this.containers[e].containerCache.over=0);if(u)if(1===this.containers.length)this.containers[d].containerCache.over||(this.containers[d]._trigger("over",t,this._uiHash(this)),this.containers[d].containerCache.over=1);else{for(s=1e4,n=null,o=(l=u.floating||this._isFloating(this.currentItem))?"left":"top",a=l?"width":"height",c=l?"pageX":"pageY",i=this.items.length-1;0<=i;i--)I.contains(this.containers[d].element[0],this.items[i].item[0])&&this.items[i].item[0]!==this.currentItem[0]&&(r=this.items[i].item.offset()[o],h=!1,t[c]-r>this.items[i][a]/2&&(h=!0),Math.abs(t[c]-r)this.containment[2]&&(n=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3]&&(o=this.containment[3]+this.offset.click.top)),s.grid&&(e=this.originalPageY+Math.round((o-this.originalPageY)/s.grid[1])*s.grid[1],o=this.containment?e-this.offset.click.top>=this.containment[1]&&e-this.offset.click.top<=this.containment[3]?e:e-this.offset.click.top>=this.containment[1]?e-s.grid[1]:e+s.grid[1]:e,i=this.originalPageX+Math.round((n-this.originalPageX)/s.grid[0])*s.grid[0],n=this.containment?i-this.offset.click.left>=this.containment[0]&&i-this.offset.click.left<=this.containment[2]?i:i-this.offset.click.left>=this.containment[0]?i-s.grid[0]:i+s.grid[0]:i)),{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():r?0:a.scrollTop()),left:n-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():r?0:a.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this!==this.currentContainer&&(e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer)))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this.storedCursor&&(this.document.find("body").css("cursor",this.storedCursor),this.storedStylesheet.remove()),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return I.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this.cancelBlur?delete this.cancelBlur:(this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t))},mousewheel:function(t,e){if(e){if(!this.spinning&&!this._start(t))return!1;this._spin((0").parent().append("")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0s.max?s.max:null!==s.min&&t"},_buttonHtml:function(){return""}});var w;I.ui.spinner;I.widget("ui.tabs",{version:"1.12.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(w=/#.*$/,function(t){var e,i;e=t.href.replace(w,""),i=location.href.replace(w,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1?@\[\]\^`{|}~]/g,"\\$&"):""},refresh:function(){var t=this.options,e=this.tablist.children(":has(a[href])");t.disabled=I.map(e.filter(".ui-state-disabled"),function(t){return e.index(t)}),this._processTabs(),!1!==t.active&&this.anchors.length?this.active.length&&!I.contains(this.tablist[0],this.active[0])?this.tabs.length===t.disabled.length?(t.active=!1,this.active=I()):this._activate(this._findNextTab(Math.max(0,t.active-1),!1)):t.active=this.tabs.index(this.active):(t.active=!1,this.active=I()),this._refresh()},_refresh:function(){this._setOptionDisabled(this.options.disabled),this._setupEvents(this.options.event),this._setupHeightStyle(this.options.heightStyle),this.tabs.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}),this.panels.not(this._getPanelForTab(this.active)).hide().attr({"aria-hidden":"true"}),this.active.length?(this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}),this._addClass(this.active,"ui-tabs-active","ui-state-active"),this._getPanelForTab(this.active).show().attr({"aria-hidden":"false"})):this.tabs.eq(0).attr("tabIndex",0)},_processTabs:function(){var h=this,t=this.tabs,e=this.anchors,i=this.panels;this.tablist=this._getList().attr("role","tablist"),this._addClass(this.tablist,"ui-tabs-nav","ui-helper-reset ui-helper-clearfix ui-widget-header"),this.tablist.on("mousedown"+this.eventNamespace,"> li",function(t){I(this).is(".ui-state-disabled")&&t.preventDefault()}).on("focus"+this.eventNamespace,".ui-tabs-anchor",function(){I(this).closest("li").is(".ui-state-disabled")&&this.blur()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return I("a",this)[0]}).attr({role:"presentation",tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=I(),this.anchors.each(function(t,e){var i,s,n,o=I(e).uniqueId().attr("id"),a=I(e).closest("li"),r=a.attr("aria-controls");h._isLocal(e)?(n=(i=e.hash).substring(1),s=h.element.find(h._sanitizeSelector(i))):(i="#"+(n=a.attr("aria-controls")||I({}).uniqueId()[0].id),(s=h.element.find(i)).length||(s=h._createPanel(n)).insertAfter(h.panels[t-1]||h.tablist),s.attr("aria-live","polite")),s.length&&(h.panels=h.panels.add(s)),r&&a.data("ui-tabs-aria-controls",r),a.attr({"aria-controls":n,"aria-labelledby":o}),s.attr("aria-labelledby",o)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return I("
      ").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i,s;for(I.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),s=0;i=this.tabs[s];s++)e=I(i),!0===t||-1!==I.inArray(s,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&I.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=I(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=I(this).outerHeight(!0)}),this.panels.each(function(){I(this).height(Math.max(0,i-I(this).innerHeight()+I(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,I(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=I(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?I():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):I(),h={oldTab:i,oldPanel:r,newTab:o?I():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,h)||(e.active=!o&&this.tabs.index(s),this.active=n?I():s,this.xhr&&this.xhr.abort(),r.length||a.length||I.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,h))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===I(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var e,i=this._findActive(t);i[0]!==this.active[0]&&(i.length||(i=this.active),e=i.find(".ui-tabs-anchor")[0],this._eventHandler({target:e,currentTarget:e,preventDefault:I.noop}))},_findActive:function(t){return!1===t?I():this.tabs.eq(t)},_getIndex:function(t){return"string"==typeof t&&(t=this.anchors.index(this.anchors.filter("[href$='"+I.ui.escapeSelector(t)+"']"))),t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){I.data(this,"ui-tabs-destroy")?I(this).remove():I(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=I(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(void 0===i?t=!1:(i=this._getIndex(i),t=I.isArray(t)?I.map(t,function(t){return t!==i?t:null}):I.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==I.inArray(t,e))return;e=I.isArray(e)?I.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);var n=this,i=this.tabs.eq(t),e=i.find(".ui-tabs-anchor"),o=this._getPanelForTab(i),a={tab:i,panel:o},r=function(t,e){"abort"===e&&n.panels.stop(!1,!0),n._removeClass(i,"ui-tabs-loading"),o.removeAttr("aria-busy"),t===n.xhr&&delete n.xhr};this._isLocal(e[0])||(this.xhr=I.ajax(this._ajaxSettings(e,s,a)),this.xhr&&"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),o.attr("aria-busy","true"),this.xhr.done(function(t,e,i){setTimeout(function(){o.html(t),n._trigger("load",s,a),r(i,e)},1)}).fail(function(t,e){setTimeout(function(){r(t,e)},1)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href").replace(/#.*$/,""),beforeSend:function(t,e){return n._trigger("beforeLoad",i,I.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){var e=I(t).attr("aria-controls");return this.element.find(this._sanitizeSelector("#"+e))}}),!1!==I.uiBackCompat&&I.widget("ui.tabs",I.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}});I.ui.tabs;I.widget("ui.tooltip",{version:"1.12.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=I(this).attr("title")||"";return I("").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",I.trim(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),s=I.inArray(e,i);-1!==s&&i.splice(s,1),t.removeData("ui-tooltip-id"),(i=I.trim(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=I("
      ").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=I([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&I.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;I.each(this.tooltips,function(t,e){var i=I.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=I(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=I(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=I([])},open:function(t){var i=this,e=I(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=I(this);e.data("ui-tooltip-open")&&((t=I.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t,s=this.options.content,n=this,o=i?i.type:null;if("string"==typeof s||s.nodeType||s.jquery)return this._open(i,e,s);(t=s.call(e[0],function(t){n._delay(function(){e.data("ui-tooltip-open")&&(i&&(i.type=o),this._open(i,e,t))})}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,o,a,r=I.extend({},this.options.position);function h(t){r.of=t,n.is(":hidden")||n.position(r)}i&&((s=this._find(e))?s.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),s=this._tooltip(e),n=s.tooltip,this._addDescribedBy(e,n.attr("id")),n.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(a=I("
      ").html(n.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),a.removeAttr("id").find("[id]").removeAttr("id"),a.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:h}),h(t)):n.position(I.extend({of:e},this.options.position)),n.hide(),this._show(n,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(o=this.delayedShow=setInterval(function(){n.is(":visible")&&(h(r.of),clearInterval(o))},I.fx.interval)),this._trigger("open",t,{tooltip:n})))},_registerCloseHandlers:function(t,i){var e={keyup:function(t){if(t.keyCode===I.ui.keyCode.ESCAPE){var e=I.Event(t);e.currentTarget=i[0],this.close(e,!0)}}};i[0]!==this.element[0]&&(e.remove=function(){this._removeTooltip(this._find(i).tooltip)}),t&&"mouseover"!==t.type||(e.mouseleave="close"),t&&"focusin"!==t.type||(e.focusout="close"),this._on(!0,i,e)},close:function(t){var e,i=this,s=I(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(I(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&I.each(this.parents,function(t,e){I(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding||(n.closing=!1))):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=I("
      ").attr("role","tooltip"),i=I("
      ").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){var e=t.data("ui-tooltip-id");return e?this.tooltips[e]:null},_removeTooltip:function(t){t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){var e=t.closest(".ui-front, dialog");return e.length||(e=this.document[0].body),e},_destroy:function(){var n=this;I.each(this.tooltips,function(t,e){var i=I.Event("blur"),s=e.element;i.target=i.currentTarget=s[0],n.close(i,!0),I("#"+t).remove(),s.data("ui-tooltip-title")&&(s.attr("title")||s.attr("title",s.data("ui-tooltip-title")),s.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!1!==I.uiBackCompat&&I.widget("ui.tooltip",I.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}});I.ui.tooltip}); \ No newline at end of file +/*! jQuery UI - v1.14.1 - 2024-12-10 +* https://jqueryui.com +* Includes: widget.js, position.js, data.js, disable-selection.js, focusable.js, form-reset-mixin.js, jquery-patch.js, keycode.js, labels.js, scroll-parent.js, tabbable.js, unique-id.js, widgets/draggable.js, widgets/droppable.js, widgets/resizable.js, widgets/selectable.js, widgets/sortable.js, widgets/accordion.js, widgets/autocomplete.js, widgets/button.js, widgets/checkboxradio.js, widgets/controlgroup.js, widgets/datepicker.js, widgets/dialog.js, widgets/menu.js, widgets/mouse.js, widgets/progressbar.js, widgets/selectmenu.js, widgets/slider.js, widgets/spinner.js, widgets/tabs.js, widgets/tooltip.js, effect.js, effects/effect-blind.js, effects/effect-bounce.js, effects/effect-clip.js, effects/effect-drop.js, effects/effect-explode.js, effects/effect-fade.js, effects/effect-fold.js, effects/effect-highlight.js, effects/effect-puff.js, effects/effect-pulsate.js, effects/effect-scale.js, effects/effect-shake.js, effects/effect-size.js, effects/effect-slide.js, effects/effect-transfer.js +* Copyright OpenJS Foundation and other contributors; Licensed MIT */ + +(t=>{"function"==typeof define&&define.amd?define(["jquery"],t):t(jQuery)})(function(V){V.ui=V.ui||{};V.ui.version="1.14.1";var n,s,x,k,o,a,r,l,h,i,E=0,N=Array.prototype.hasOwnProperty,c=Array.prototype.slice;V.cleanData=(n=V.cleanData,function(t){for(var e,i,s=0;null!=(i=t[s]);s++)(e=V._data(i,"events"))&&e.remove&&V(i).triggerHandler("remove");n(t)}),V.widget=function(t,i,e){var s,n,o,a,r={},l=t.split(".")[0];return"__proto__"===(t=t.split(".")[1])||"constructor"===t?V.error("Invalid widget name: "+t):(a=l+"-"+t,e||(e=i,i=V.Widget),Array.isArray(e)&&(e=V.extend.apply(null,[{}].concat(e))),V.expr.pseudos[a.toLowerCase()]=function(t){return!!V.data(t,a)},V[l]=V[l]||{},s=V[l][t],n=V[l][t]=function(t,e){if(!this||!this._createWidget)return new n(t,e);arguments.length&&this._createWidget(t,e)},V.extend(n,s,{version:e.version,_proto:V.extend({},e),_childConstructors:[]}),(o=new i).options=V.widget.extend({},o.options),V.each(e,function(e,s){function n(){return i.prototype[e].apply(this,arguments)}function o(t){return i.prototype[e].apply(this,t)}r[e]="function"!=typeof s?s:function(){var t,e=this._super,i=this._superApply;return this._super=n,this._superApply=o,t=s.apply(this,arguments),this._super=e,this._superApply=i,t}}),n.prototype=V.widget.extend(o,{widgetEventPrefix:s&&o.widgetEventPrefix||t},r,{constructor:n,namespace:l,widgetName:t,widgetFullName:a}),s?(V.each(s._childConstructors,function(t,e){var i=e.prototype;V.widget(i.namespace+"."+i.widgetName,n,e._proto)}),delete s._childConstructors):i._childConstructors.push(n),V.widget.bridge(t,n),n)},V.widget.extend=function(t){for(var e,i,s=c.call(arguments,1),n=0,o=s.length;n",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=V(e||this.defaultElement||this)[0],this.element=V(e),this.uuid=E++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=V(),this.hoverable=V(),this.focusable=V(),this.classesElementLookup={},e!==this&&(V.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t){t.target===e&&this.destroy()}}),this.document=V(e.style?e.ownerDocument:e.document||e),this.window=V(this.document[0].defaultView||this.document[0].parentWindow)),this.options=V.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:V.noop,_create:V.noop,_init:V.noop,destroy:function(){var i=this;this._destroy(),V.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:V.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return V.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t]=V.widget.extend({},this.options[t]),n=0;n{var i=[];n.element.each(function(t,e){V.map(a.classesElementLookup,function(t){return t}).some(function(t){return t.is(e)})||i.push(e)}),a._on(V(i),{remove:"_untrackClassesElement"})})(),V(V.uniqueSort(i.get().concat(n.element.get())))):V(i.not(n.element).get()),a.classesElementLookup[t[s]]=i,o.push(t[s]),e&&n.classes[t[s]]&&o.push(n.classes[t[s]])}return(n=V.extend({element:this.element,classes:this.options.classes||{}},n)).keys&&t(n.keys.match(/\S+/g)||[],!0),n.extra&&t(n.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var s=this;V.each(s.classesElementLookup,function(t,e){-1!==V.inArray(i.target,e)&&(s.classesElementLookup[t]=V(e.not(i.target).get()))}),this._off(V(i.target))},_removeClass:function(t,e,i){return this._toggleClass(t,e,i,!1)},_addClass:function(t,e,i){return this._toggleClass(t,e,i,!0)},_toggleClass:function(t,e,i,s){var n="string"==typeof t||null===t,e={extra:n?e:i,keys:n?t:e,element:n?this.element:t,add:s="boolean"==typeof s?s:i};return e.element.toggleClass(this._classes(e),s),this},_on:function(n,o,t){var a,r=this;"boolean"!=typeof n&&(t=o,o=n,n=!1),t?(o=a=V(o),this.bindings=this.bindings.add(o)):(t=o,o=this.element,a=this.widget()),V.each(t,function(t,e){function i(){if(n||!0!==r.options.disabled&&!V(this).hasClass("ui-state-disabled"))return("string"==typeof e?r[e]:e).apply(r,arguments)}"string"!=typeof e&&(i.guid=e.guid=e.guid||i.guid||V.guid++);var t=t.match(/^([\w:-]*)\s*(.*)$/),s=t[1]+r.eventNamespace,t=t[2];t?a.on(s,t,i):o.on(s,i)})},_off:function(t,e){e=(e||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,t.off(e),this.bindings=V(this.bindings.not(t).get()),this.focusable=V(this.focusable.not(t).get()),this.hoverable=V(this.hoverable.not(t).get())},_delay:function(t,e){var i=this;return setTimeout(function(){return("string"==typeof t?i[t]:t).apply(i,arguments)},e||0)},_hoverable:function(t){this.hoverable=this.hoverable.add(t),this._on(t,{mouseenter:function(t){this._addClass(V(t.currentTarget),null,"ui-state-hover")},mouseleave:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-hover")}})},_focusable:function(t){this.focusable=this.focusable.add(t),this._on(t,{focusin:function(t){this._addClass(V(t.currentTarget),null,"ui-state-focus")},focusout:function(t){this._removeClass(V(t.currentTarget),null,"ui-state-focus")}})},_trigger:function(t,e,i){var s,n,o=this.options[t];if(i=i||{},(e=V.Event(e)).type=(t===this.widgetEventPrefix?t:this.widgetEventPrefix+t).toLowerCase(),e.target=this.element[0],n=e.originalEvent)for(s in n)s in e||(e[s]=n[s]);return this.element.trigger(e,i),!("function"==typeof o&&!1===o.apply(this.element[0],[e].concat(i))||e.isDefaultPrevented())}},V.each({show:"fadeIn",hide:"fadeOut"},function(o,a){V.Widget.prototype["_"+o]=function(e,t,i){var s,n=(t="string"==typeof t?{effect:t}:t)?!0!==t&&"number"!=typeof t&&t.effect||a:o;"number"==typeof(t=t||{})?t={duration:t}:!0===t&&(t={}),s=!V.isEmptyObject(t),t.complete=i,t.delay&&e.delay(t.delay),s&&V.effects&&V.effects.effect[n]?e[o](t):n!==o&&e[n]?e[n](t.duration,t.easing,i):e.queue(function(t){V(this)[o](),i&&i.call(e[0]),t()})}}),V.widget;function C(t,e,i){return[parseFloat(t[0])*(h.test(t[0])?e/100:1),parseFloat(t[1])*(h.test(t[1])?i/100:1)]}function D(t,e){return parseInt(V.css(t,e),10)||0}function I(t){return null!=t&&t===t.window}x=Math.max,k=Math.abs,o=/left|center|right/,a=/top|center|bottom/,r=/[\+\-]\d+(\.[\d]+)?%?/,l=/^\w+/,h=/%$/,i=V.fn.position,V.position={scrollbarWidth:function(){var t,e,i;return void 0!==s?s:(i=(e=V("
      ")).children()[0],V("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i)},getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(k(s),k(n))?o.important="horizontal":o.important="vertical",u.using.call(this,t,o)}),a.offset(V.extend(h,{using:t}))})):i.apply(this,arguments)},V.ui.position={fit:{left:function(t,e){var i,s=e.within,n=s.isWindow?s.scrollLeft:s.offset.left,s=s.width,o=t.left-e.collisionPosition.marginLeft,a=n-o,r=o+e.collisionWidth-s-n;s=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),V.ui.plugin={add:function(t,e,i){var s,n=V.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css("position","absolute").appendTo(t.parent()).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_blurActiveElement:function(t){var e=this.document[0].activeElement;V(t.target).closest(e).length||V(e).trigger("blur")},_mouseStart:function(t){var e=this.options;return this.helper=this._createHelper(t),this._addClass(this.helper,"ui-draggable-dragging"),this._cacheHelperProportions(),V.ui.ddmanager&&(V.ui.ddmanager.current=this),this._cacheMargins(),this.cssPosition=this.helper.css("position"),this.scrollParent=this.helper.scrollParent(!0),this.offsetParent=this.helper.offsetParent(),this.hasFixedAncestor=0i[2]&&(o=i[2]+this.offset.click.left),t.pageY-this.offset.click.top>i[3])&&(a=i[3]+this.offset.click.top),s.grid&&(e=s.grid[1]?this.originalPageY+Math.round((a-this.originalPageY)/s.grid[1])*s.grid[1]:this.originalPageY,a=!i||e-this.offset.click.top>=i[1]||e-this.offset.click.top>i[3]?e:e-this.offset.click.top>=i[1]?e-s.grid[1]:e+s.grid[1],t=s.grid[0]?this.originalPageX+Math.round((o-this.originalPageX)/s.grid[0])*s.grid[0]:this.originalPageX,o=!i||t-this.offset.click.left>=i[0]||t-this.offset.click.left>i[2]?t:t-this.offset.click.left>=i[0]?t-s.grid[0]:t+s.grid[0]),"y"===s.axis&&(o=this.originalPageX),"x"===s.axis)?this.originalPageY:a)-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.offset.scroll.top:n?0:this.offset.scroll.top),left:o-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.offset.scroll.left:n?0:this.offset.scroll.left)}},_clear:function(){this._removeClass(this.helper,"ui-draggable-dragging"),this.helper[0]===this.element[0]||this.cancelHelperRemoval||this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1,this.destroyOnClear&&this.destroy()},_trigger:function(t,e,i){return i=i||this._uiHash(),V.ui.plugin.call(this,t,[e,i,this],!0),/^(drag|start|stop)/.test(t)&&(this.positionAbs=this._convertPositionTo("absolute"),i.offset=this.positionAbs),V.Widget.prototype._trigger.call(this,t,e,i)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),V.ui.plugin.add("draggable","connectToSortable",{start:function(e,t,i){var s=V.extend({},t,{item:i.element});i.sortables=[],V(i.options.connectToSortable).each(function(){var t=V(this).sortable("instance");t&&!t.options.disabled&&(i.sortables.push(t),t.refreshPositions(),t._trigger("activate",e,s))})},stop:function(e,t,i){var s=V.extend({},t,{item:i.element});i.cancelHelperRemoval=!1,V.each(i.sortables,function(){var t=this;t.isOver?(t.isOver=0,i.cancelHelperRemoval=!0,t.cancelHelperRemoval=!1,t._storedCSS={position:t.placeholder.css("position"),top:t.placeholder.css("top"),left:t.placeholder.css("left")},t._mouseStop(e),t.options.helper=t.options._helper):(t.cancelHelperRemoval=!0,t._trigger("deactivate",e,s))})},drag:function(i,s,n){V.each(n.sortables,function(){var t=!1,e=this;e.positionAbs=n.positionAbs,e.helperProportions=n.helperProportions,e.offset.click=n.offset.click,e._intersectsWith(e.containerCache)&&(t=!0,V.each(n.sortables,function(){return this.positionAbs=n.positionAbs,this.helperProportions=n.helperProportions,this.offset.click=n.offset.click,t=this!==e&&this._intersectsWith(this.containerCache)&&V.contains(e.element[0],this.element[0])?!1:t})),t?(e.isOver||(e.isOver=1,n._parent=s.helper.parent(),e.currentItem=s.helper.appendTo(e.element).data("ui-sortable-item",!0),e.options._helper=e.options.helper,e.options.helper=function(){return s.helper[0]},i.target=e.currentItem[0],e._mouseCapture(i,!0),e._mouseStart(i,!0,!0),e.offset.click.top=n.offset.click.top,e.offset.click.left=n.offset.click.left,e.offset.parent.left-=n.offset.parent.left-e.offset.parent.left,e.offset.parent.top-=n.offset.parent.top-e.offset.parent.top,n._trigger("toSortable",i),n.dropped=e.element,V.each(n.sortables,function(){this.refreshPositions()}),n.currentItem=n.element,e.fromOutside=n),e.currentItem&&(e._mouseDrag(i),s.position=e.position)):e.isOver&&(e.isOver=0,e.cancelHelperRemoval=!0,e.options._revert=e.options.revert,e.options.revert=!1,e._trigger("out",i,e._uiHash(e)),e._mouseStop(i,!0),e.options.revert=e.options._revert,e.options.helper=e.options._helper,e.placeholder&&e.placeholder.remove(),s.helper.appendTo(n._parent),n._refreshOffsets(i),s.position=n._generatePosition(i,!0),n._trigger("fromSortable",i),n.dropped=!1,V.each(n.sortables,function(){this.refreshPositions()}))})}}),V.ui.plugin.add("draggable","cursor",{start:function(t,e,i){var s=V("body"),i=i.options;s.css("cursor")&&(i._cursor=s.css("cursor")),s.css("cursor",i.cursor)},stop:function(t,e,i){i=i.options;i._cursor&&V("body").css("cursor",i._cursor)}}),V.ui.plugin.add("draggable","opacity",{start:function(t,e,i){e=V(e.helper),i=i.options;e.css("opacity")&&(i._opacity=e.css("opacity")),e.css("opacity",i.opacity)},stop:function(t,e,i){i=i.options;i._opacity&&V(e.helper).css("opacity",i._opacity)}}),V.ui.plugin.add("draggable","scroll",{start:function(t,e,i){i.scrollParentNotHidden||(i.scrollParentNotHidden=i.helper.scrollParent(!1)),i.scrollParentNotHidden[0]!==i.document[0]&&"HTML"!==i.scrollParentNotHidden[0].tagName&&(i.overflowOffset=i.scrollParentNotHidden.offset())},drag:function(t,e,i){var s=i.options,n=!1,o=i.scrollParentNotHidden[0],a=i.document[0];o!==a&&"HTML"!==o.tagName?(s.axis&&"x"===s.axis||(i.overflowOffset.top+o.offsetHeight-t.pageY
      ").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})),this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this._proportionallyResize()),this._setupHandles(),e.autoHide&&V(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){V(t).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,a=this;if(this.handles=o.handles||(V(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=V(),this._addedHandles=V(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split(","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=V(this.handles[e]),this._on(this.handles[e],{mousedown:a._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(s=V(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?s.outerHeight():s.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add(this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){a.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),a.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=V(this.handles[e])[0])!==t.target&&!V.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s,n=this.options,o=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),n.containment&&(e+=V(n.containment).scrollLeft()||0,i+=V(n.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this._helper||(s=this._calculateAdjustedElementDimensions(o)),this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{width:s.width,height:s.height},this.originalSize=this._helper?{width:o.outerWidth(),height:o.outerHeight()}:{width:s.width,height:s.height},this.sizeDiff={width:o.outerWidth()-o.width(),height:o.outerHeight()-o.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof n.aspectRatio?n.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=V(".ui-resizable-"+this.axis).css("cursor"),V("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(i=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(i=this._updateRatio(i,t)),i=this._respectSize(i,t),this._updateCache(i),this._propagate("resize",t),s=this._applyChanges(),!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),V.isEmptyObject(s)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(i=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,e=e?0:o.sizeDiff.width,e={width:o.helper.width()-e,height:o.helper.height()-i},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(V.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper)&&!n.animate&&this._proportionallyResize(),V("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.helper.css(t),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px",this.helper.width(t.width)),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px",this.helper.height(t.height)),t},_updateVirtualBoundaries:function(t){var e,i,s,n=this.options,n={minWidth:this._isNumber(n.minWidth)?n.minWidth:0,maxWidth:this._isNumber(n.maxWidth)?n.maxWidth:1/0,minHeight:this._isNumber(n.minHeight)?n.minHeight:0,maxHeight:this._isNumber(n.maxHeight)?n.maxHeight:1/0};(this._aspectRatio||t)&&(t=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,e=n.maxHeight*this.aspectRatio,s=n.maxWidth/this.aspectRatio,n.minWidtht.width,a=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,r=this.originalPosition.left+this.originalSize.width,l=this.originalPosition.top+this.originalSize.height,h=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),a&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&h&&(t.left=r-e.minWidth),s&&h&&(t.left=r-e.maxWidth),a&&i&&(t.top=l-e.minHeight),n&&i&&(t.top=l-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_calculateAdjustedElementDimensions:function(t){var e,i,s=t.get(0);return"content-box"!==t.css("box-sizing")||!this._hasScroll(s)&&!this._hasScroll(s,"left")?{height:parseFloat(t.css("height")),width:parseFloat(t.css("width"))}:(e=parseFloat(s.style.width),s=parseFloat(s.style.height),i=this._getPaddingPlusBorderDimensions(t),e=isNaN(e)?this._getElementTheoreticalSize(t,i,"width"):e,{height:isNaN(s)?this._getElementTheoreticalSize(t,i,"height"):s,width:e})},_getElementTheoreticalSize:function(t,e,i){return Math.max(0,Math.ceil(t.get(0)["offset"+i[0].toUpperCase()+i.slice(1)]-e[i]-.5))||0},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e
      ").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e,i){return V.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return V.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){V.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),V.ui.plugin.add("resizable","animate",{stop:function(e){var i=V(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,n=n?0:i.sizeDiff.width,n={width:i.size.width-n,height:i.size.height-o},o=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left)||null,a=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(V.extend(n,a&&o?{top:a,left:o}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&V(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),V.ui.plugin.add("resizable","containment",{start:function(){var i,s,t,e,n=V(this).resizable("instance"),o=n.options,a=n.element,o=o.containment,a=o instanceof V?o.get(0):/parent/.test(o)?a.parent().get(0):o;a&&(n.containerElement=V(a),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:V(document),left:0,top:0,width:V(document).width(),height:V(document).height()||document.body.parentNode.scrollHeight}):(i=V(a),s=[],V(["Top","Right","Left","Bottom"]).each(function(t,e){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},o=n.containerOffset,e=n.containerSize.height,t=n.containerSize.width,t=n._hasScroll(a,"left")?a.scrollWidth:t,e=n._hasScroll(a)?a.scrollHeight:e,n.parentData={element:a,left:o.left,top:o.top,width:t,height:e}))},resize:function(t){var e=V(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,t=e._aspectRatio||t.shiftKey,o={top:0,left:0},a=e.containerElement,r=!0;a[0]!==document&&/static/.test(a.css("position"))&&(o=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-o.left),t&&(e.size.height=e.size.width/e.aspectRatio,r=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),t&&(e.size.width=e.size.height*e.aspectRatio,r=!1),e.position.top=e._helper?s.top:0),a=e.containerElement.get(0)===e.element.parent().get(0),i=/relative|absolute/.test(e.containerElement.css("position")),a&&i?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-o.left:e.offset.left-s.left)),a=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-o.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,t)&&(e.size.height=e.size.width/e.aspectRatio,r=!1),a+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-a,t)&&(e.size.width=e.size.height*e.aspectRatio,r=!1),r||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=V(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=V(t.helper),a=o.offset(),r=o.outerWidth()-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&V(this).css({left:a.left-s.left-i.left,width:r,height:o})}}),V.ui.plugin.add("resizable","alsoResize",{start:function(){var i=V(this).resizable("instance"),t=i.options;V(t.alsoResize).each(function(){var t=V(this),e=i._calculateAdjustedElementDimensions(t);t.data("ui-resizable-alsoresize",{width:e.width,height:e.height,left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=V(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,a={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};V(s.alsoResize).each(function(){var t=V(this),s=V(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];V.each(e,function(t,e){var i=(s[e]||0)+(a[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){V(this).removeData("ui-resizable-alsoresize")}}),V.ui.plugin.add("resizable","ghost",{start:function(){var t=V(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!0===V.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=V(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=V(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),V.ui.plugin.add("resizable","grid",{resize:function(){var t,e=V(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,a=e.axis,r="number"==typeof i.grid?[i.grid,i.grid]:i.grid,l=r[0]||1,h=r[1]||1,c=Math.round((s.width-n.width)/l)*l,s=Math.round((s.height-n.height)/h)*h,u=n.width+c,d=n.height+s,p=i.maxWidth&&i.maxWidthu,m=i.minHeight&&i.minHeight>d;i.grid=r,g&&(u+=l),m&&(d+=h),p&&(u-=l),f&&(d-=h),/^(se|s|e)$/.test(a)?(e.size.width=u,e.size.height=d):/^(ne)$/.test(a)?(e.size.width=u,e.size.height=d,e.position.top=o.top-s):/^(sw)$/.test(a)?(e.size.width=u,e.size.height=d,e.position.left=o.left-c):((d-h<=0||u-l<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0"),this._addClass(this.helper,"ui-selectable-helper")},_destroy:function(){this.selectees.removeData("selectable-item"),this._mouseDestroy()},_mouseStart:function(i){var s=this,t=this.options;this.opos=[i.pageX,i.pageY],this.elementPos=V(this.element[0]).offset(),this.options.disabled||(this.selectees=V(t.filter,this.element[0]),this._trigger("start",i),V(t.appendTo).append(this.helper),this.helper.css({left:i.pageX,top:i.pageY,width:0,height:0}),t.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var t=V.data(this,"selectable-item");t.startselected=!0,i.metaKey||i.ctrlKey||(s._removeClass(t.$element,"ui-selected"),t.selected=!1,s._addClass(t.$element,"ui-unselecting"),t.unselecting=!0,s._trigger("unselecting",i,{unselecting:t.element}))}),V(i.target).parents().addBack().each(function(){var t,e=V.data(this,"selectable-item");if(e)return t=!i.metaKey&&!i.ctrlKey||!e.$element.hasClass("ui-selected"),s._removeClass(e.$element,t?"ui-unselecting":"ui-selected")._addClass(e.$element,t?"ui-selecting":"ui-unselecting"),e.unselecting=!t,e.selecting=t,(e.selected=t)?s._trigger("selecting",i,{selecting:e.element}):s._trigger("unselecting",i,{unselecting:e.element}),!1}))},_mouseDrag:function(s){var t,n,o,a,r,l,h;if(this.dragged=!0,!this.options.disabled)return o=(n=this).options,a=this.opos[0],r=this.opos[1],(l=s.pageX) *",opacity:!1,placeholder:!1,revert:!1,scroll:!0,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1e3,activate:null,beforeStop:null,change:null,deactivate:null,out:null,over:null,receive:null,remove:null,sort:null,start:null,stop:null,update:null},_isOverAxis:function(t,e,i){return e<=t&&t*{ cursor: "+o.cursor+" !important; }").appendTo(n)),o.zIndex&&(this.helper.css("zIndex")&&(this._storedZIndex=this.helper.css("zIndex")),this.helper.css("zIndex",o.zIndex)),o.opacity&&(this.helper.css("opacity")&&(this._storedOpacity=this.helper.css("opacity")),this.helper.css("opacity",o.opacity)),this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName&&(this.overflowOffset=this.scrollParent.offset()),this._trigger("start",t,this._uiHash()),this._preserveHelperProportions||this._cacheHelperProportions(),!i)for(s=this.containers.length-1;0<=s;s--)this.containers[s]._trigger("activate",t,this._uiHash(this));return V.ui.ddmanager&&(V.ui.ddmanager.current=this),V.ui.ddmanager&&!o.dropBehaviour&&V.ui.ddmanager.prepareOffsets(this,t),this.dragging=!0,this._addClass(this.helper,"ui-sortable-helper"),this.helper.parent().is(this.appendTo)||(this.helper.detach().appendTo(this.appendTo),this.offset.parent=this._getParentOffset()),this.position=this.originalPosition=this._generatePosition(t),this.originalPageX=t.pageX,this.originalPageY=t.pageY,this.lastPositionAbs=this.positionAbs=this._convertPositionTo("absolute"),this._mouseDrag(t),!0},_scroll:function(t){var e=this.options,i=!1;return this.scrollParent[0]!==this.document[0]&&"HTML"!==this.scrollParent[0].tagName?(this.overflowOffset.top+this.scrollParent[0].offsetHeight-t.pageYt[this.floating?"width":"height"]?h&&c:o",i.document[0]);return i._addClass(t,"ui-sortable-placeholder",s||i.currentItem[0].className)._removeClass(t,"ui-sortable-helper"),"tbody"===n?i._createTrPlaceholder(i.currentItem.find("tr").eq(0),V("",i.document[0]).appendTo(t)):"tr"===n?i._createTrPlaceholder(i.currentItem,t):"img"===n&&t.attr("src",i.currentItem.attr("src")),s||t.css("visibility","hidden"),t},update:function(t,e){s&&!o.forcePlaceholderSize||(e.height()&&(!o.forcePlaceholderSize||"tbody"!==n&&"tr"!==n)||e.height(i.currentItem.innerHeight()-parseInt(i.currentItem.css("paddingTop")||0,10)-parseInt(i.currentItem.css("paddingBottom")||0,10)),e.width())||e.width(i.currentItem.innerWidth()-parseInt(i.currentItem.css("paddingLeft")||0,10)-parseInt(i.currentItem.css("paddingRight")||0,10))}}),i.placeholder=V(o.placeholder.element.call(i.element,i.currentItem)),i.currentItem.after(i.placeholder),o.placeholder.update(i,i.placeholder)},_createTrPlaceholder:function(t,e){var i=this;t.children().each(function(){V(" ",i.document[0]).attr("colspan",V(this).attr("colspan")||1).appendTo(e)})},_contactContainers:function(t){for(var e,i,s,n,o,a,r,l,h,c=null,u=null,d=this.containers.length-1;0<=d;d--)V.contains(this.currentItem[0],this.containers[d].element[0])||(this._intersectsWith(this.containers[d].containerCache)?c&&V.contains(this.containers[d].element[0],c.element[0])||(c=this.containers[d],u=d):this.containers[d].containerCache.over&&(this.containers[d]._trigger("out",t,this._uiHash(this)),this.containers[d].containerCache.over=0));if(c)if(1===this.containers.length)this.containers[u].containerCache.over||(this.containers[u]._trigger("over",t,this._uiHash(this)),this.containers[u].containerCache.over=1);else{for(i=1e4,s=null,n=(l=c.floating||this._isFloating(this.currentItem))?"left":"top",o=l?"width":"height",h=l?"pageX":"pageY",e=this.items.length-1;0<=e;e--)V.contains(this.containers[u].element[0],this.items[e].item[0])&&this.items[e].item[0]!==this.currentItem[0]&&(a=this.items[e].item.offset()[n],r=!1,t[h]-a>this.items[e][o]/2&&(r=!0),Math.abs(t[h]-a)this.containment[2]&&(i=this.containment[2]+this.offset.click.left),t.pageY-this.offset.click.top>this.containment[3])&&(s=this.containment[3]+this.offset.click.top),e.grid)&&(t=this.originalPageY+Math.round((s-this.originalPageY)/e.grid[1])*e.grid[1],s=!this.containment||t-this.offset.click.top>=this.containment[1]&&t-this.offset.click.top<=this.containment[3]?t:t-this.offset.click.top>=this.containment[1]?t-e.grid[1]:t+e.grid[1],t=this.originalPageX+Math.round((i-this.originalPageX)/e.grid[0])*e.grid[0],i=!this.containment||t-this.offset.click.left>=this.containment[0]&&t-this.offset.click.left<=this.containment[2]?t:t-this.offset.click.left>=this.containment[0]?t-e.grid[0]:t+e.grid[0]),{top:s-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+("fixed"===this.cssPosition?-this.scrollParent.scrollTop():o?0:n.scrollTop()),left:i-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+("fixed"===this.cssPosition?-this.scrollParent.scrollLeft():o?0:n.scrollLeft())}},_rearrange:function(t,e,i,s){i?i[0].appendChild(this.placeholder[0]):e.item[0].parentNode.insertBefore(this.placeholder[0],"down"===this.direction?e.item[0]:e.item[0].nextSibling),this.counter=this.counter?++this.counter:1;var n=this.counter;this._delay(function(){n===this.counter&&this.refreshPositions(!s)})},_clear:function(t,e){this.reverting=!1;var i,s=[];if(!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem),this._noFinalSort=null,this.helper[0]===this.currentItem[0]){for(i in this._storedCSS)"auto"!==this._storedCSS[i]&&"static"!==this._storedCSS[i]||(this._storedCSS[i]="");this.currentItem.css(this._storedCSS),this._removeClass(this.currentItem,"ui-sortable-helper")}else this.currentItem.show();function n(e,i,s){return function(t){s._trigger(e,t,i._uiHash(i))}}for(this.fromOutside&&!e&&s.push(function(t){this._trigger("receive",t,this._uiHash(this.fromOutside))}),!this.fromOutside&&this.domPosition.prev===this.currentItem.prev().not(".ui-sortable-helper")[0]&&this.domPosition.parent===this.currentItem.parent()[0]||e||s.push(function(t){this._trigger("update",t,this._uiHash())}),this===this.currentContainer||e||(s.push(function(t){this._trigger("remove",t,this._uiHash())}),s.push(function(e){return function(t){e._trigger("receive",t,this._uiHash(this))}}.call(this,this.currentContainer)),s.push(function(e){return function(t){e._trigger("update",t,this._uiHash(this))}}.call(this,this.currentContainer))),i=this.containers.length-1;0<=i;i--)e||s.push(n("deactivate",this,this.containers[i])),this.containers[i].containerCache.over&&(s.push(n("out",this,this.containers[i])),this.containers[i].containerCache.over=0);if(this._storedStylesheet&&(this._storedStylesheet.remove(),this._storedStylesheet=null),this._storedOpacity&&this.helper.css("opacity",this._storedOpacity),this._storedZIndex&&this.helper.css("zIndex","auto"===this._storedZIndex?"":this._storedZIndex),this.dragging=!1,e||this._trigger("beforeStop",t,this._uiHash()),this.placeholder[0].parentNode.removeChild(this.placeholder[0]),this.cancelHelperRemoval||(this.helper[0]!==this.currentItem[0]&&this.helper.remove(),this.helper=null),!e){for(i=0;i li > :first-child").add(t.find("> :not(li)").filter(function(t){return t%2==0}))},heightStyle:"auto",icons:{activeHeader:"ui-icon-triangle-1-s",header:"ui-icon-triangle-1-e"},activate:null,beforeActivate:null},hideProps:{borderTopWidth:"hide",borderBottomWidth:"hide",paddingTop:"hide",paddingBottom:"hide",height:"hide"},showProps:{borderTopWidth:"show",borderBottomWidth:"show",paddingTop:"show",paddingBottom:"show",height:"show"},_create:function(){var t=this.options;this.prevShow=this.prevHide=V(),this._addClass("ui-accordion","ui-widget ui-helper-reset"),this.element.attr("role","tablist"),t.collapsible||!1!==t.active&&null!=t.active||(t.active=0),this._processPanels(),t.active<0&&(t.active+=this.headers.length),this._refresh()},_getCreateEventData:function(){return{header:this.active,panel:this.active.length?this.active.next():V()}},_createIcons:function(){var t,e=this.options.icons;e&&(t=V(""),this._addClass(t,"ui-accordion-header-icon","ui-icon "+e.header),t.prependTo(this.headers),t=this.active.children(".ui-accordion-header-icon"),this._removeClass(t,e.header)._addClass(t,null,e.activeHeader)._addClass(this.headers,"ui-accordion-icons"))},_destroyIcons:function(){this._removeClass(this.headers,"ui-accordion-icons"),this.headers.children(".ui-accordion-header-icon").remove()},_destroy:function(){var t;this.element.removeAttr("role"),this.headers.removeAttr("role aria-expanded aria-selected aria-controls tabIndex").removeUniqueId(),this._destroyIcons(),t=this.headers.next().css("display","").removeAttr("role aria-hidden aria-labelledby").removeUniqueId(),"content"!==this.options.heightStyle&&t.css("height","")},_setOption:function(t,e){"active"===t?this._activate(e):("event"===t&&(this.options.event&&this._off(this.headers,this.options.event),this._setupEvents(e)),this._super(t,e),"collapsible"!==t||e||!1!==this.options.active||this._activate(0),"icons"===t&&(this._destroyIcons(),e)&&this._createIcons())},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_keydown:function(t){if(!t.altKey&&!t.ctrlKey){var e=V.ui.keyCode,i=this.headers.length,s=this.headers.index(t.target),n=!1;switch(t.keyCode){case e.RIGHT:case e.DOWN:n=this.headers[(s+1)%i];break;case e.LEFT:case e.UP:n=this.headers[(s-1+i)%i];break;case e.SPACE:case e.ENTER:this._eventHandler(t);break;case e.HOME:n=this.headers[0];break;case e.END:n=this.headers[i-1]}n&&(V(t.target).attr("tabIndex",-1),V(n).attr("tabIndex",0),V(n).trigger("focus"),t.preventDefault())}},_panelKeyDown:function(t){t.keyCode===V.ui.keyCode.UP&&t.ctrlKey&&V(t.currentTarget).prev().trigger("focus")},refresh:function(){var t=this.options;this._processPanels(),!1===t.active&&!0===t.collapsible||!this.headers.length?(t.active=!1,this.active=V()):!1===t.active?this._activate(0):this.active.length&&!V.contains(this.element[0],this.active[0])?this.headers.length===this.headers.find(".ui-state-disabled").length?(t.active=!1,this.active=V()):this._activate(Math.max(0,t.active-1)):t.active=this.headers.index(this.active),this._destroyIcons(),this._refresh()},_processPanels:function(){var t=this.headers,e=this.panels;"function"==typeof this.options.header?this.headers=this.options.header(this.element):this.headers=this.element.find(this.options.header),this._addClass(this.headers,"ui-accordion-header ui-accordion-header-collapsed","ui-state-default"),this.panels=this.headers.next().filter(":not(.ui-accordion-content-active)").hide(),this._addClass(this.panels,"ui-accordion-content","ui-helper-reset ui-widget-content"),e&&(this._off(t.not(this.headers)),this._off(e.not(this.panels)))},_refresh:function(){var i,t=this.options,e=t.heightStyle,s=this.element.parent();this.active=this._findActive(t.active),this._addClass(this.active,"ui-accordion-header-active","ui-state-active")._removeClass(this.active,"ui-accordion-header-collapsed"),this._addClass(this.active.next(),"ui-accordion-content-active"),this.active.next().show(),this.headers.attr("role","tab").each(function(){var t=V(this),e=t.uniqueId().attr("id"),i=t.next(),s=i.uniqueId().attr("id");t.attr("aria-controls",s),i.attr("aria-labelledby",e)}).next().attr("role","tabpanel"),this.headers.not(this.active).attr({"aria-selected":"false","aria-expanded":"false",tabIndex:-1}).next().attr({"aria-hidden":"true"}).hide(),this.active.length?this.active.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0}).next().attr({"aria-hidden":"false"}):this.headers.eq(0).attr("tabIndex",0),this._createIcons(),this._setupEvents(t.event),"fill"===e?(i=s.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.headers.each(function(){i-=V(this).outerHeight(!0)}),this.headers.next().each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===e&&(i=0,this.headers.next().each(function(){var t=V(this).is(":visible");t||V(this).show(),i=Math.max(i,V(this).css("height","").height()),t||V(this).hide()}).height(i))},_activate:function(t){t=this._findActive(t)[0];t!==this.active[0]&&(t=t||this.active[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return"number"==typeof t?this.headers.eq(t):V()},_setupEvents:function(t){var i={keydown:"_keydown"};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.headers.add(this.headers.next())),this._on(this.headers,i),this._on(this.headers.next(),{keydown:"_panelKeyDown"}),this._hoverable(this.headers),this._focusable(this.headers)},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():s.next(),r=i.next(),r={oldHeader:i,oldPanel:r,newHeader:o?V():s,newPanel:a};t.preventDefault(),n&&!e.collapsible||!1===this._trigger("beforeActivate",t,r)||(e.active=!o&&this.headers.index(s),this.active=n?V():s,this._toggle(r),this._removeClass(i,"ui-accordion-header-active","ui-state-active"),e.icons&&(a=i.children(".ui-accordion-header-icon"),this._removeClass(a,null,e.icons.activeHeader)._addClass(a,null,e.icons.header)),n)||(this._removeClass(s,"ui-accordion-header-collapsed")._addClass(s,"ui-accordion-header-active","ui-state-active"),e.icons&&(t=s.children(".ui-accordion-header-icon"),this._removeClass(t,null,e.icons.header)._addClass(t,null,e.icons.activeHeader)),this._addClass(s.next(),"ui-accordion-content-active"))},_toggle:function(t){var e=t.newPanel,i=this.prevShow.length?this.prevShow:t.oldPanel;this.prevShow.add(this.prevHide).stop(!0,!0),this.prevShow=e,this.prevHide=i,this.options.animate?this._animate(e,i,t):(i.hide(),e.show(),this._toggleComplete(t)),i.attr({"aria-hidden":"true"}),i.prev().attr({"aria-selected":"false","aria-expanded":"false"}),e.length&&i.length?i.prev().attr({tabIndex:-1,"aria-expanded":"false"}):e.length&&this.headers.filter(function(){return 0===parseInt(V(this).attr("tabIndex"),10)}).attr("tabIndex",-1),e.attr("aria-hidden","false").prev().attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_animate:function(t,i,e){function s(){o._toggleComplete(e)}var n,o=this,a=0,r=t.css("box-sizing"),l=t.length&&(!i.length||t.index()",delay:300,options:{icons:{submenu:"ui-icon-caret-1-e"},items:"> *",menus:"ul",position:{my:"left top",at:"right top"},role:"menu",blur:null,focus:null,select:null},_create:function(){this.activeMenu=this.element,this.mouseHandled=!1,this.lastMousePosition={x:null,y:null},this.element.uniqueId().attr({role:this.options.role,tabIndex:0}),this._addClass("ui-menu","ui-widget ui-widget-content"),this._on({"mousedown .ui-menu-item":function(t){t.preventDefault(),this._activateItem(t)},"click .ui-menu-item":function(t){var e=V(t.target),i=V(this.document[0].activeElement);!this.mouseHandled&&e.not(".ui-state-disabled").length&&(this.select(t),t.isPropagationStopped()||(this.mouseHandled=!0),e.has(".ui-menu").length?this.expand(t):!this.element.is(":focus")&&i.closest(".ui-menu").length&&(this.element.trigger("focus",[!0]),this.active)&&1===this.active.parents(".ui-menu").length&&clearTimeout(this.timer))},"mouseenter .ui-menu-item":"_activateItem","mousemove .ui-menu-item":"_activateItem",mouseleave:"collapseAll","mouseleave .ui-menu":"collapseAll",focus:function(t,e){var i=this.active||this._menuItems().first();e||this.focus(t,i)},blur:function(t){this._delay(function(){V.contains(this.element[0],this.document[0].activeElement)||this.collapseAll(t)})},keydown:"_keydown"}),this.refresh(),this._on(this.document,{click:function(t){this._closeOnDocumentClick(t)&&this.collapseAll(t,!0),this.mouseHandled=!1}})},_activateItem:function(t){var e,i;this.previousFilter||t.clientX===this.lastMousePosition.x&&t.clientY===this.lastMousePosition.y||(this.lastMousePosition={x:t.clientX,y:t.clientY},e=V(t.target).closest(".ui-menu-item"),i=V(t.currentTarget),e[0]!==i[0])||i.is(".ui-state-active")||(this._removeClass(i.siblings().children(".ui-state-active"),null,"ui-state-active"),this.focus(t,i))},_destroy:function(){var t=this.element.find(".ui-menu-item").removeAttr("role aria-disabled").children(".ui-menu-item-wrapper").removeUniqueId().removeAttr("tabIndex role aria-haspopup");this.element.removeAttr("aria-activedescendant").find(".ui-menu").addBack().removeAttr("role aria-labelledby aria-expanded aria-hidden aria-disabled tabIndex").removeUniqueId().show(),t.children().each(function(){var t=V(this);t.data("ui-menu-submenu-caret")&&t.remove()})},_keydown:function(t){var e,i,s,n=!0;switch(t.keyCode){case V.ui.keyCode.PAGE_UP:this.previousPage(t);break;case V.ui.keyCode.PAGE_DOWN:this.nextPage(t);break;case V.ui.keyCode.HOME:this._move("first","first",t);break;case V.ui.keyCode.END:this._move("last","last",t);break;case V.ui.keyCode.UP:this.previous(t);break;case V.ui.keyCode.DOWN:this.next(t);break;case V.ui.keyCode.LEFT:this.collapse(t);break;case V.ui.keyCode.RIGHT:this.active&&!this.active.is(".ui-state-disabled")&&this.expand(t);break;case V.ui.keyCode.ENTER:case V.ui.keyCode.SPACE:this._activate(t);break;case V.ui.keyCode.ESCAPE:this.collapse(t);break;default:e=this.previousFilter||"",s=n=!1,i=96<=t.keyCode&&t.keyCode<=105?(t.keyCode-96).toString():String.fromCharCode(t.keyCode),clearTimeout(this.filterTimer),i===e?s=!0:i=e+i,e=this._filterMenuItems(i),(e=s&&-1!==e.index(this.active.next())?this.active.nextAll(".ui-menu-item"):e).length||(i=String.fromCharCode(t.keyCode),e=this._filterMenuItems(i)),e.length?(this.focus(t,e),this.previousFilter=i,this.filterTimer=this._delay(function(){delete this.previousFilter},1e3)):delete this.previousFilter}n&&t.preventDefault()},_activate:function(t){this.active&&!this.active.is(".ui-state-disabled")&&(this.active.children("[aria-haspopup='true']").length?this.expand(t):this.select(t))},refresh:function(){var t,e,s=this,n=this.options.icons.submenu,i=this.element.find(this.options.menus);this._toggleClass("ui-menu-icons",null,!!this.element.find(".ui-icon").length),t=i.filter(":not(.ui-menu)").hide().attr({role:this.options.role,"aria-hidden":"true","aria-expanded":"false"}).each(function(){var t=V(this),e=t.prev(),i=V("").data("ui-menu-submenu-caret",!0);s._addClass(i,"ui-menu-icon","ui-icon "+n),e.attr("aria-haspopup","true").prepend(i),t.attr("aria-labelledby",e.attr("id"))}),this._addClass(t,"ui-menu","ui-widget ui-widget-content ui-front"),(t=i.add(this.element).find(this.options.items)).not(".ui-menu-item").each(function(){var t=V(this);s._isDivider(t)&&s._addClass(t,"ui-menu-divider","ui-widget-content")}),e=(i=t.not(".ui-menu-item, .ui-menu-divider")).children().not(".ui-menu").uniqueId().attr({tabIndex:-1,role:this._itemRole()}),this._addClass(i,"ui-menu-item")._addClass(e,"ui-menu-item-wrapper"),t.filter(".ui-state-disabled").attr("aria-disabled","true"),this.active&&!V.contains(this.element[0],this.active[0])&&this.blur()},_itemRole:function(){return{menu:"menuitem",listbox:"option"}[this.options.role]},_setOption:function(t,e){var i;"icons"===t&&(i=this.element.find(".ui-menu-icon"),this._removeClass(i,null,this.options.icons.submenu)._addClass(i,null,e.submenu)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",String(t)),this._toggleClass(null,"ui-state-disabled",!!t)},focus:function(t,e){var i;this.blur(t,t&&"focus"===t.type),this._scrollIntoView(e),this.active=e.first(),i=this.active.children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),this.options.role&&this.element.attr("aria-activedescendant",i.attr("id")),i=this.active.parent().closest(".ui-menu-item").children(".ui-menu-item-wrapper"),this._addClass(i,null,"ui-state-active"),t&&"keydown"===t.type?this._close():this.timer=this._delay(function(){this._close()},this.delay),(i=e.children(".ui-menu")).length&&t&&/^mouse/.test(t.type)&&this._startOpening(i),this.activeMenu=e.parent(),this._trigger("focus",t,{item:e})},_scrollIntoView:function(t){var e,i,s;this._hasScroll()&&(e=parseFloat(V.css(this.activeMenu[0],"borderTopWidth"))||0,i=parseFloat(V.css(this.activeMenu[0],"paddingTop"))||0,e=t.offset().top-this.activeMenu.offset().top-e-i,i=this.activeMenu.scrollTop(),s=this.activeMenu.height(),t=t.outerHeight(),e<0?this.activeMenu.scrollTop(i+e):s",options:{appendTo:null,autoFocus:!1,delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null,change:null,close:null,focus:null,open:null,response:null,search:null,select:null},requestIndex:0,pending:0,liveRegionTimer:null,_create:function(){var i,s,n,t=this.element[0].nodeName.toLowerCase(),e="textarea"===t,t="input"===t;this.isMultiLine=e||!t&&"true"===this.element.prop("contentEditable"),this.valueMethod=this.element[e||t?"val":"text"],this.isNewMenu=!0,this._addClass("ui-autocomplete-input"),this.element.attr("autocomplete","off"),this._on(this.element,{keydown:function(t){if(this.element.prop("readOnly"))s=n=i=!0;else{s=n=i=!1;var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:i=!0,this._move("previousPage",t);break;case e.PAGE_DOWN:i=!0,this._move("nextPage",t);break;case e.UP:i=!0,this._keyEvent("previous",t);break;case e.DOWN:i=!0,this._keyEvent("next",t);break;case e.ENTER:this.menu.active&&(i=!0,t.preventDefault(),this.menu.select(t));break;case e.TAB:this.menu.active&&this.menu.select(t);break;case e.ESCAPE:this.menu.element.is(":visible")&&(this.isMultiLine||this._value(this.term),this.close(t),t.preventDefault());break;default:s=!0,this._searchTimeout(t)}}},keypress:function(t){if(i)i=!1,this.isMultiLine&&!this.menu.element.is(":visible")||t.preventDefault();else if(!s){var e=V.ui.keyCode;switch(t.keyCode){case e.PAGE_UP:this._move("previousPage",t);break;case e.PAGE_DOWN:this._move("nextPage",t);break;case e.UP:this._keyEvent("previous",t);break;case e.DOWN:this._keyEvent("next",t)}}},input:function(t){n?(n=!1,t.preventDefault()):this._searchTimeout(t)},focus:function(){this.selectedItem=null,this.previous=this._value()},blur:function(t){clearTimeout(this.searching),this.close(t),this._change(t)}}),this._initSource(),this.menu=V("
        ").appendTo(this._appendTo()).menu({role:null}).hide().menu("instance"),this._addClass(this.menu.element,"ui-autocomplete","ui-front"),this._on(this.menu.element,{mousedown:function(t){t.preventDefault()},menufocus:function(t,e){var i,s;this.isNewMenu&&(this.isNewMenu=!1,t.originalEvent)&&/^mouse/.test(t.originalEvent.type)?(this.menu.blur(),this.document.one("mousemove",function(){V(t.target).trigger(t.originalEvent)})):(s=e.item.data("ui-autocomplete-item"),!1!==this._trigger("focus",t,{item:s})&&t.originalEvent&&/^key/.test(t.originalEvent.type)&&this._value(s.value),(i=e.item.attr("aria-label")||s.value)&&String.prototype.trim.call(i).length&&(clearTimeout(this.liveRegionTimer),this.liveRegionTimer=this._delay(function(){this.liveRegion.html(V("
        ").text(i))},100)))},menuselect:function(t,e){var e=e.item.data("ui-autocomplete-item"),i=this.previous;this.element[0]!==this.document[0].activeElement&&(this.element.trigger("focus"),this.previous=i),!1!==this._trigger("select",t,{item:e})&&this._value(e.value),this.term=this._value(),this.close(t),this.selectedItem=e}}),this.liveRegion=V("
        ",{role:"status","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_destroy:function(){clearTimeout(this.searching),this.element.removeAttr("autocomplete"),this.menu.element.remove(),this.liveRegion.remove()},_setOption:function(t,e){this._super(t,e),"source"===t&&this._initSource(),"appendTo"===t&&this.menu.element.appendTo(this._appendTo()),"disabled"===t&&e&&this.xhr&&this.xhr.abort()},_isEventTargetInWidget:function(t){var e=this.menu.element[0];return t.target===this.element[0]||t.target===e||V.contains(e,t.target)},_closeOnClickOutside:function(t){this._isEventTargetInWidget(t)||this.close()},_appendTo:function(){var t=this.options.appendTo;return t=(t=(t=t&&(t.jquery||t.nodeType?V(t):this.document.find(t).eq(0)))&&t[0]?t:this.element.closest(".ui-front, dialog")).length?t:this.document[0].body},_initSource:function(){var i,s,n=this;Array.isArray(this.options.source)?(i=this.options.source,this.source=function(t,e){e(V.ui.autocomplete.filter(i,t.term))}):"string"==typeof this.options.source?(s=this.options.source,this.source=function(t,e){n.xhr&&n.xhr.abort(),n.xhr=V.ajax({url:s,data:t,dataType:"json",success:function(t){e(t)},error:function(){e([])}})}):this.source=this.options.source},_searchTimeout:function(s){clearTimeout(this.searching),this.searching=this._delay(function(){var t=this.term===this._value(),e=this.menu.element.is(":visible"),i=s.altKey||s.ctrlKey||s.metaKey||s.shiftKey;t&&(e||i)||(this.selectedItem=null,this.search(null,s))},this.options.delay)},search:function(t,e){return t=null!=t?t:this._value(),this.term=this._value(),t.length").append(V("
        ").text(e.label)).appendTo(t)},_move:function(t,e){this.menu.element.is(":visible")?this.menu.isFirstItem()&&/^previous/.test(t)||this.menu.isLastItem()&&/^next/.test(t)?(this.isMultiLine||this._value(this.term),this.menu.blur()):this.menu[t](e):this.search(null,e)},widget:function(){return this.menu.element},_value:function(){return this.valueMethod.apply(this.element,arguments)},_keyEvent:function(t,e){this.isMultiLine&&!this.menu.element.is(":visible")||(this._move(t,e),e.preventDefault())}}),V.extend(V.ui.autocomplete,{escapeRegex:function(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")},filter:function(t,e){var i=new RegExp(V.ui.autocomplete.escapeRegex(e),"i");return V.grep(t,function(t){return i.test(t.label||t.value||t)})}}),V.widget("ui.autocomplete",V.ui.autocomplete,{options:{messages:{noResults:"No search results.",results:function(t){return t+(1").text(e))},100))}}),V.ui.autocomplete;var L,d,R=/ui-corner-([a-z]){2,6}/g;V.widget("ui.controlgroup",{version:"1.14.1",defaultElement:"
        ",options:{direction:"horizontal",disabled:null,onlyVisible:!0,items:{button:"input[type=button], input[type=submit], input[type=reset], button, a",controlgroupLabel:".ui-controlgroup-label",checkboxradio:"input[type='checkbox'], input[type='radio']",selectmenu:"select",spinner:".ui-spinner-input"}},_create:function(){this._enhance()},_enhance:function(){this.element.attr("role","toolbar"),this.refresh()},_destroy:function(){this._callChildMethod("destroy"),this.childWidgets.removeData("ui-controlgroup-data"),this.element.removeAttr("role"),this.options.items.controlgroupLabel&&this.element.find(this.options.items.controlgroupLabel).find(".ui-controlgroup-label-contents").contents().unwrap()},_initWidgets:function(){var o=this,a=[];V.each(this.options.items,function(s,t){var e,n={};t&&("controlgroupLabel"===s?((e=o.element.find(t)).each(function(){var t=V(this);t.children(".ui-controlgroup-label-contents").length||t.contents().wrapAll("")}),o._addClass(e,null,"ui-widget ui-widget-content ui-state-default"),a=a.concat(e.get())):V.fn[s]&&(n=o["_"+s+"Options"]?o["_"+s+"Options"]("middle"):{classes:{}},o.element.find(t).each(function(){var t=V(this),e=t[s]("instance"),i=V.widget.extend({},n);"button"===s&&t.parent(".ui-spinner").length||((e=e||t[s]()[s]("instance"))&&(i.classes=o._resolveClassesValues(i.classes,e)),t[s](i),i=t[s]("widget"),V.data(i[0],"ui-controlgroup-data",e||t[s]("instance")),a.push(i[0]))})))}),this.childWidgets=V(V.uniqueSort(a)),this._addClass(this.childWidgets,"ui-controlgroup-item")},_callChildMethod:function(e){this.childWidgets.each(function(){var t=V(this).data("ui-controlgroup-data");t&&t[e]&&t[e]()})},_updateCornerClass:function(t,e){e=this._buildSimpleOptions(e,"label").classes.label;this._removeClass(t,null,"ui-corner-top ui-corner-bottom ui-corner-left ui-corner-right ui-corner-all"),this._addClass(t,null,e)},_buildSimpleOptions:function(t,e){var i="vertical"===this.options.direction,s={classes:{}};return s.classes[e]={middle:"",first:"ui-corner-"+(i?"top":"left"),last:"ui-corner-"+(i?"bottom":"right"),only:"ui-corner-all"}[t],s},_spinnerOptions:function(t){t=this._buildSimpleOptions(t,"ui-spinner");return t.classes["ui-spinner-up"]="",t.classes["ui-spinner-down"]="",t},_buttonOptions:function(t){return this._buildSimpleOptions(t,"ui-button")},_checkboxradioOptions:function(t){return this._buildSimpleOptions(t,"ui-checkboxradio-label")},_selectmenuOptions:function(t){var e="vertical"===this.options.direction;return{width:e&&"auto",classes:{middle:{"ui-selectmenu-button-open":"","ui-selectmenu-button-closed":""},first:{"ui-selectmenu-button-open":"ui-corner-"+(e?"top":"tl"),"ui-selectmenu-button-closed":"ui-corner-"+(e?"top":"left")},last:{"ui-selectmenu-button-open":e?"":"ui-corner-tr","ui-selectmenu-button-closed":"ui-corner-"+(e?"bottom":"right")},only:{"ui-selectmenu-button-open":"ui-corner-top","ui-selectmenu-button-closed":"ui-corner-all"}}[t]}},_resolveClassesValues:function(i,s){var n={};return V.each(i,function(t){var e=s.options.classes[t]||"",e=String.prototype.trim.call(e.replace(R,""));n[t]=(e+" "+i[t]).replace(/\s+/g," ")}),n},_setOption:function(t,e){"direction"===t&&this._removeClass("ui-controlgroup-"+this.options.direction),this._super(t,e),"disabled"===t?this._callChildMethod(e?"disable":"enable"):this.refresh()},refresh:function(){var n,o=this;this._addClass("ui-controlgroup ui-controlgroup-"+this.options.direction),"horizontal"===this.options.direction&&this._addClass(null,"ui-helper-clearfix"),this._initWidgets(),n=this.childWidgets,(n=this.options.onlyVisible?n.filter(":visible"):n).length&&(V.each(["first","last"],function(t,e){var i,s=n[e]().data("ui-controlgroup-data");s&&o["_"+s.widgetName+"Options"]?((i=o["_"+s.widgetName+"Options"](1===n.length?"only":e)).classes=o._resolveClassesValues(i.classes,s),s.element[s.widgetName](i)):o._updateCornerClass(n[e](),e)}),this._callChildMethod("refresh"))}}),V.widget("ui.checkboxradio",[V.ui.formResetMixin,{version:"1.14.1",options:{disabled:null,label:null,icon:!0,classes:{"ui-checkboxradio-label":"ui-corner-all","ui-checkboxradio-icon":"ui-corner-all"}},_getCreateOptions:function(){var t,e=this._super()||{};return this._readType(),t=this.element.labels(),this.label=V(t[t.length-1]),this.label.length||V.error("No label found for checkboxradio widget"),this.originalLabel="",(t=this.label.contents().not(this.element[0])).length&&(this.originalLabel+=t.clone().wrapAll("
        ").parent().html()),this.originalLabel&&(e.label=this.originalLabel),null!=(t=this.element[0].disabled)&&(e.disabled=t),e},_create:function(){var t=this.element[0].checked;this._bindFormResetHandler(),null==this.options.disabled&&(this.options.disabled=this.element[0].disabled),this._setOption("disabled",this.options.disabled),this._addClass("ui-checkboxradio","ui-helper-hidden-accessible"),this._addClass(this.label,"ui-checkboxradio-label","ui-button ui-widget"),"radio"===this.type&&this._addClass(this.label,"ui-checkboxradio-radio-label"),this.options.label&&this.options.label!==this.originalLabel?this._updateLabel():this.originalLabel&&(this.options.label=this.originalLabel),this._enhance(),t&&this._addClass(this.label,"ui-checkboxradio-checked","ui-state-active"),this._on({change:"_toggleClasses",focus:function(){this._addClass(this.label,null,"ui-state-focus ui-visual-focus")},blur:function(){this._removeClass(this.label,null,"ui-state-focus ui-visual-focus")}})},_readType:function(){var t=this.element[0].nodeName.toLowerCase();this.type=this.element[0].type,"input"===t&&/radio|checkbox/.test(this.type)||V.error("Can't create checkboxradio on element.nodeName="+t+" and element.type="+this.type)},_enhance:function(){this._updateIcon(this.element[0].checked)},widget:function(){return this.label},_getRadioGroup:function(){var t=this.element[0].name,e="input[name='"+CSS.escape(t)+"']";return t?(this.form.length?V(this.form[0].elements).filter(e):V(e).filter(function(){return 0===V(V(this).prop("form")).length})).not(this.element):V([])},_toggleClasses:function(){var t=this.element[0].checked;this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),this.options.icon&&"checkbox"===this.type&&this._toggleClass(this.icon,null,"ui-icon-check ui-state-checked",t)._toggleClass(this.icon,null,"ui-icon-blank",!t),"radio"===this.type&&this._getRadioGroup().each(function(){var t=V(this).checkboxradio("instance");t&&t._removeClass(t.label,"ui-checkboxradio-checked","ui-state-active")})},_destroy:function(){this._unbindFormResetHandler(),this.icon&&(this.icon.remove(),this.iconSpace.remove())},_setOption:function(t,e){"label"===t&&!e||(this._super(t,e),"disabled"===t?(this._toggleClass(this.label,null,"ui-state-disabled",e),this.element[0].disabled=e):this.refresh())},_updateIcon:function(t){var e="ui-icon ui-icon-background ";this.options.icon?(this.icon||(this.icon=V(""),this.iconSpace=V(" "),this._addClass(this.iconSpace,"ui-checkboxradio-icon-space")),"checkbox"===this.type?(e+=t?"ui-icon-check ui-state-checked":"ui-icon-blank",this._removeClass(this.icon,null,t?"ui-icon-blank":"ui-icon-check")):e+="ui-icon-blank",this._addClass(this.icon,"ui-checkboxradio-icon",e),t||this._removeClass(this.icon,null,"ui-icon-check ui-state-checked"),this.icon.prependTo(this.label).after(this.iconSpace)):void 0!==this.icon&&(this.icon.remove(),this.iconSpace.remove(),delete this.icon)},_updateLabel:function(){var t=this.label.contents().not(this.element[0]);this.icon&&(t=t.not(this.icon[0])),(t=this.iconSpace?t.not(this.iconSpace[0]):t).remove(),this.label.append(this.options.label)},refresh:function(){var t=this.element[0].checked,e=this.element[0].disabled;this._updateIcon(t),this._toggleClass(this.label,"ui-checkboxradio-checked","ui-state-active",t),null!==this.options.label&&this._updateLabel(),e!==this.options.disabled&&this._setOptions({disabled:e})}}]),V.ui.checkboxradio,V.widget("ui.button",{version:"1.14.1",defaultElement:"
        "+(0
        ":""):"")}h+=d}return h+=T,t._keyEvent=!1,h},_generateMonthYearHeader:function(t,e,i,s,n,o,a,r){var l,h,c,u,d,p,f=this._get(t,"changeMonth"),g=this._get(t,"changeYear"),m=this._get(t,"showMonthAfterYear"),_=this._get(t,"selectMonthLabel"),v=this._get(t,"selectYearLabel"),b="
        ",y="";if(o||!f)y+=""+a[e]+"";else{for(l=s&&s.getFullYear()===i,h=n&&n.getFullYear()===i,y+=""}if(m||(b+=y+(!o&&f&&g?"":" ")),!t.yearshtml)if(t.yearshtml="",o||!g)b+=""+i+"";else{for(a=this._get(t,"yearRange").split(":"),u=(new Date).getFullYear(),d=(_=function(t){t=t.match(/c[+\-].*/)?i+parseInt(t.substring(1),10):t.match(/[+\-].*/)?u+parseInt(t,10):parseInt(t,10);return isNaN(t)?u:t})(a[0]),p=Math.max(d,_(a[1]||"")),d=s?Math.max(d,s.getFullYear()):d,p=n?Math.min(p,n.getFullYear()):p,t.yearshtml+="",b+=t.yearshtml,t.yearshtml=null}return b+=this._get(t,"yearSuffix"),m&&(b+=(!o&&f&&g?"":" ")+y),b+="
        "},_adjustInstDate:function(t,e,i){var s=t.selectedYear+("Y"===i?e:0),n=t.selectedMonth+("M"===i?e:0),e=Math.min(t.selectedDay,this._getDaysInMonth(s,n))+("D"===i?e:0),s=this._restrictMinMax(t,this._daylightSavingAdjust(new Date(s,n,e)));t.selectedDay=s.getDate(),t.drawMonth=t.selectedMonth=s.getMonth(),t.drawYear=t.selectedYear=s.getFullYear(),"M"!==i&&"Y"!==i||this._notifyChange(t)},_restrictMinMax:function(t,e){var i=this._getMinMaxDate(t,"min"),t=this._getMinMaxDate(t,"max"),i=i&&e=s.getTime())&&(!n||e.getTime()<=n.getTime())&&(!o||e.getFullYear()>=o)&&(!a||e.getFullYear()<=a)},_getFormatConfig:function(t){var e=this._get(t,"shortYearCutoff");return{shortYearCutoff:"string"!=typeof e?e:(new Date).getFullYear()%100+parseInt(e,10),dayNamesShort:this._get(t,"dayNamesShort"),dayNames:this._get(t,"dayNames"),monthNamesShort:this._get(t,"monthNamesShort"),monthNames:this._get(t,"monthNames")}},_formatDate:function(t,e,i,s){e||(t.currentDay=t.selectedDay,t.currentMonth=t.selectedMonth,t.currentYear=t.selectedYear);s=e?"object"==typeof e?e:this._daylightSavingAdjust(new Date(s,i,e)):this._daylightSavingAdjust(new Date(t.currentYear,t.currentMonth,t.currentDay));return this.formatDate(this._get(t,"dateFormat"),s,this._getFormatConfig(t))}}),V.fn.datepicker=function(t){if(!this.length)return this;V.datepicker.initialized||(V(document).on("mousedown",V.datepicker._checkExternalClick),V.datepicker.initialized=!0),0===V("#"+V.datepicker._mainDivId).length&&V("body").append(V.datepicker.dpDiv);var e=Array.prototype.slice.call(arguments,1);return"string"==typeof t&&("isDisabled"===t||"getDate"===t||"widget"===t)||"option"===t&&2===arguments.length&&"string"==typeof arguments[1]?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this[0]].concat(e)):this.each(function(){"string"==typeof t?V.datepicker["_"+t+"Datepicker"].apply(V.datepicker,[this].concat(e)):V.datepicker._attachDatepicker(this,t)})},V.datepicker=new Y,V.datepicker.initialized=!1,V.datepicker.uuid=(new Date).getTime(),V.datepicker.version="1.14.1";V.widget("ui.dialog",{version:"1.14.1",options:{appendTo:"body",autoOpen:!0,buttons:[],classes:{"ui-dialog":"ui-corner-all","ui-dialog-titlebar":"ui-corner-all"},closeOnEscape:!0,closeText:"Close",draggable:!0,hide:null,height:"auto",maxHeight:null,maxWidth:null,minHeight:150,minWidth:150,modal:!1,position:{my:"center",at:"center",of:window,collision:"fit",using:function(t){var e=V(this).css(t).offset().top;e<0&&V(this).css("top",t.top-e)}},resizable:!0,show:null,title:null,uiDialogTitleHeadingLevel:0,width:300,beforeClose:null,close:null,drag:null,dragStart:null,dragStop:null,focus:null,open:null,resize:null,resizeStart:null,resizeStop:null},sizeRelatedOptions:{buttons:!0,height:!0,maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0,width:!0},resizableRelatedOptions:{maxHeight:!0,maxWidth:!0,minHeight:!0,minWidth:!0},_create:function(){this.originalCss={display:this.element[0].style.display,width:this.element[0].style.width,minHeight:this.element[0].style.minHeight,maxHeight:this.element[0].style.maxHeight,height:this.element[0].style.height},this.originalPosition={parent:this.element.parent(),index:this.element.parent().children().index(this.element)},this.originalTitle=this.element.attr("title"),null==this.options.title&&null!=this.originalTitle&&(this.options.title=this.originalTitle),this.options.disabled&&(this.options.disabled=!1),this._createWrapper(),this.element.show().removeAttr("title").appendTo(this.uiDialog),this._addClass("ui-dialog-content","ui-widget-content"),this._createTitlebar(),this._createButtonPane(),this.options.draggable&&V.fn.draggable&&this._makeDraggable(),this.options.resizable&&V.fn.resizable&&this._makeResizable(),this._isOpen=!1,this._trackFocus()},_init:function(){this.options.autoOpen&&this.open()},_appendTo:function(){var t=this.options.appendTo;return t&&(t.jquery||t.nodeType)?V(t):this.document.find(t||"body").eq(0)},_destroy:function(){var t,e=this.originalPosition;this._untrackInstance(),this._destroyOverlay(),this.element.removeUniqueId().css(this.originalCss).detach(),this.uiDialog.remove(),this.originalTitle&&this.element.attr("title",this.originalTitle),(t=e.parent.children().eq(e.index)).length&&t[0]!==this.element[0]?t.before(this.element):e.parent.append(this.element)},widget:function(){return this.uiDialog},disable:V.noop,enable:V.noop,close:function(t){var e=this;this._isOpen&&!1!==this._trigger("beforeClose",t)&&(this._isOpen=!1,this._focusedElement=null,this._destroyOverlay(),this._untrackInstance(),this.opener.filter(":focusable").trigger("focus").length||V(this.document[0].activeElement).trigger("blur"),this._hide(this.uiDialog,this.options.hide,function(){e._trigger("close",t)}))},isOpen:function(){return this._isOpen},moveToTop:function(){this._moveToTop()},_moveToTop:function(t,e){var i=!1,s=this.uiDialog.siblings(".ui-front:visible").map(function(){return+V(this).css("z-index")}).get(),s=Math.max.apply(null,s);return s>=+this.uiDialog.css("z-index")&&(this.uiDialog.css("z-index",s+1),i=!0),i&&!e&&this._trigger("focus",t),i},open:function(){var t=this;this._isOpen?this._moveToTop()&&this._focusTabbable():(this._isOpen=!0,this.opener=V(this.document[0].activeElement),this._size(),this._position(),this._createOverlay(),this._moveToTop(null,!0),this.overlay&&this.overlay.css("z-index",this.uiDialog.css("z-index")-1),this._show(this.uiDialog,this.options.show,function(){t._focusTabbable(),t._trigger("focus")}),this._makeFocusTarget(),this._trigger("open"))},_focusTabbable:function(){var t=this._focusedElement;(t=(t=(t=(t=(t=t||this.element.find("[autofocus]")).length?t:this.element.find(":tabbable")).length?t:this.uiDialogButtonPane.find(":tabbable")).length?t:this.uiDialogTitlebarClose.filter(":tabbable")).length?t:this.uiDialog).eq(0).trigger("focus")},_restoreTabbableFocus:function(){var t=this.document[0].activeElement;this.uiDialog[0]===t||V.contains(this.uiDialog[0],t)||this._focusTabbable()},_keepFocus:function(t){t.preventDefault(),this._restoreTabbableFocus()},_createWrapper:function(){this.uiDialog=V("
        ").hide().attr({tabIndex:-1,role:"dialog","aria-modal":this.options.modal?"true":null}).appendTo(this._appendTo()),this._addClass(this.uiDialog,"ui-dialog","ui-widget ui-widget-content ui-front"),this._on(this.uiDialog,{keydown:function(t){var e,i,s;this.options.closeOnEscape&&!t.isDefaultPrevented()&&t.keyCode&&t.keyCode===V.ui.keyCode.ESCAPE?(t.preventDefault(),this.close(t)):t.keyCode!==V.ui.keyCode.TAB||t.isDefaultPrevented()||(e=this.uiDialog.find(":tabbable"),i=e.first(),s=e.last(),t.target!==s[0]&&t.target!==this.uiDialog[0]||t.shiftKey?t.target!==i[0]&&t.target!==this.uiDialog[0]||!t.shiftKey||(this._delay(function(){s.trigger("focus")}),t.preventDefault()):(this._delay(function(){i.trigger("focus")}),t.preventDefault()))},mousedown:function(t){this._moveToTop(t)&&this._focusTabbable()}}),this.element.find("[aria-describedby]").length||this.uiDialog.attr({"aria-describedby":this.element.uniqueId().attr("id")})},_createTitlebar:function(){this.uiDialogTitlebar=V("
        "),this._addClass(this.uiDialogTitlebar,"ui-dialog-titlebar","ui-widget-header ui-helper-clearfix"),this._on(this.uiDialogTitlebar,{mousedown:function(t){V(t.target).closest(".ui-dialog-titlebar-close")||this.uiDialog.trigger("focus")}}),this.uiDialogTitlebarClose=V("").button({label:V("").text(this.options.closeText).html(),icon:"ui-icon-closethick",showLabel:!1}).appendTo(this.uiDialogTitlebar),this._addClass(this.uiDialogTitlebarClose,"ui-dialog-titlebar-close"),this._on(this.uiDialogTitlebarClose,{click:function(t){t.preventDefault(),this.close(t)}});var t=Number.isInteger(this.options.uiDialogTitleHeadingLevel)&&0").uniqueId().prependTo(this.uiDialogTitlebar);this._addClass(t,"ui-dialog-title"),this._title(t),this.uiDialogTitlebar.prependTo(this.uiDialog),this.uiDialog.attr({"aria-labelledby":t.attr("id")})},_title:function(t){this.options.title?t.text(this.options.title):t.html(" ")},_createButtonPane:function(){this.uiDialogButtonPane=V("
        "),this._addClass(this.uiDialogButtonPane,"ui-dialog-buttonpane","ui-widget-content ui-helper-clearfix"),this.uiButtonSet=V("
        ").appendTo(this.uiDialogButtonPane),this._addClass(this.uiButtonSet,"ui-dialog-buttonset"),this._createButtons()},_createButtons:function(){var s=this,t=this.options.buttons;this.uiDialogButtonPane.remove(),this.uiButtonSet.empty(),V.isEmptyObject(t)||Array.isArray(t)&&!t.length?this._removeClass(this.uiDialog,"ui-dialog-buttons"):(V.each(t,function(t,e){var i;e=V.extend({type:"button"},e="function"==typeof e?{click:e,text:t}:e),i=e.click,t={icon:e.icon,iconPosition:e.iconPosition,showLabel:e.showLabel,icons:e.icons,text:e.text},delete e.click,delete e.icon,delete e.iconPosition,delete e.showLabel,delete e.icons,"boolean"==typeof e.text&&delete e.text,V("",e).button(t).appendTo(s.uiButtonSet).on("click",function(){i.apply(s.element[0],arguments)})}),this._addClass(this.uiDialog,"ui-dialog-buttons"),this.uiDialogButtonPane.appendTo(this.uiDialog))},_makeDraggable:function(){var n=this,o=this.options;function a(t){return{position:t.position,offset:t.offset}}this.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(t,e){n._addClass(V(this),"ui-dialog-dragging"),n._blockFrames(),n._trigger("dragStart",t,a(e))},drag:function(t,e){n._trigger("drag",t,a(e))},stop:function(t,e){var i=e.offset.left-n.document.scrollLeft(),s=e.offset.top-n.document.scrollTop();o.position={my:"left top",at:"left"+(0<=i?"+":"")+i+" top"+(0<=s?"+":"")+s,of:n.window},n._removeClass(V(this),"ui-dialog-dragging"),n._unblockFrames(),n._trigger("dragStop",t,a(e))}})},_makeResizable:function(){var n=this,o=this.options,t=o.resizable,e=this.uiDialog.css("position"),t="string"==typeof t?t:"n,e,s,w,se,sw,ne,nw";function a(t){return{originalPosition:t.originalPosition,originalSize:t.originalSize,position:t.position,size:t.size}}this.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:this.element,maxWidth:o.maxWidth,maxHeight:o.maxHeight,minWidth:o.minWidth,minHeight:this._minHeight(),handles:t,start:function(t,e){n._addClass(V(this),"ui-dialog-resizing"),n._blockFrames(),n._trigger("resizeStart",t,a(e))},resize:function(t,e){n._trigger("resize",t,a(e))},stop:function(t,e){var i=n.uiDialog.offset(),s=i.left-n.document.scrollLeft(),i=i.top-n.document.scrollTop();o.height=n.uiDialog.height(),o.width=n.uiDialog.width(),o.position={my:"left top",at:"left"+(0<=s?"+":"")+s+" top"+(0<=i?"+":"")+i,of:n.window},n._removeClass(V(this),"ui-dialog-resizing"),n._unblockFrames(),n._trigger("resizeStop",t,a(e))}}).css("position",e)},_trackFocus:function(){this._on(this.widget(),{focusin:function(t){this._makeFocusTarget(),this._focusedElement=V(t.target)}})},_makeFocusTarget:function(){this._untrackInstance(),this._trackingInstances().unshift(this)},_untrackInstance:function(){var t=this._trackingInstances(),e=V.inArray(this,t);-1!==e&&t.splice(e,1)},_trackingInstances:function(){var t=this.document.data("ui-dialog-instances");return t||this.document.data("ui-dialog-instances",t=[]),t},_minHeight:function(){var t=this.options;return"auto"===t.height?t.minHeight:Math.min(t.minHeight,t.height)},_position:function(){var t=this.uiDialog.is(":visible");t||this.uiDialog.show(),this.uiDialog.position(this.options.position),t||this.uiDialog.hide()},_setOptions:function(t){var i=this,s=!1,n={};V.each(t,function(t,e){i._setOption(t,e),t in i.sizeRelatedOptions&&(s=!0),t in i.resizableRelatedOptions&&(n[t]=e)}),s&&(this._size(),this._position()),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option",n)},_setOption:function(t,e){var i,s=this.uiDialog;"disabled"!==t&&(this._super(t,e),"appendTo"===t&&this.uiDialog.appendTo(this._appendTo()),"buttons"===t&&this._createButtons(),"closeText"===t&&this.uiDialogTitlebarClose.button({label:V("").text(""+this.options.closeText).html()}),"draggable"===t&&((i=s.is(":data(ui-draggable)"))&&!e&&s.draggable("destroy"),!i)&&e&&this._makeDraggable(),"position"===t&&this._position(),"resizable"===t&&((i=s.is(":data(ui-resizable)"))&&!e&&s.resizable("destroy"),i&&"string"==typeof e&&s.resizable("option","handles",e),i||!1===e||this._makeResizable()),"title"===t&&this._title(this.uiDialogTitlebar.find(".ui-dialog-title")),"modal"===t)&&s.attr("aria-modal",e?"true":null)},_size:function(){var t,e,i,s=this.options;this.element.show().css({width:"auto",minHeight:0,maxHeight:"none",height:0}),s.minWidth>s.width&&(s.width=s.minWidth),t=this.uiDialog.css({height:"auto",width:s.width}).outerHeight(),e=Math.max(0,s.minHeight-t),i="number"==typeof s.maxHeight?Math.max(0,s.maxHeight-t):"none","auto"===s.height?this.element.css({minHeight:e,maxHeight:i,height:"auto"}):this.element.height(Math.max(0,s.height-t)),this.uiDialog.is(":data(ui-resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())},_blockFrames:function(){this.iframeBlocks=this.document.find("iframe").map(function(){var t=V(this);return V("
        ").css({position:"absolute",width:t.outerWidth(),height:t.outerHeight()}).appendTo(t.parent()).offset(t.offset())[0]})},_unblockFrames:function(){this.iframeBlocks&&(this.iframeBlocks.remove(),delete this.iframeBlocks)},_allowInteraction:function(t){return!!V(t.target).closest(".ui-dialog").length||!!V(t.target).closest(".ui-datepicker").length},_createOverlay:function(){var i;this.options.modal&&(i=!0,this._delay(function(){i=!1}),this.document.data("ui-dialog-overlays")||this.document.on("focusin.ui-dialog",function(t){var e;i||(e=this._trackingInstances()[0])._allowInteraction(t)||(t.preventDefault(),e._focusTabbable())}.bind(this)),this.overlay=V("
        ").appendTo(this._appendTo()),this._addClass(this.overlay,null,"ui-widget-overlay ui-front"),this._on(this.overlay,{mousedown:"_keepFocus"}),this.document.data("ui-dialog-overlays",(this.document.data("ui-dialog-overlays")||0)+1))},_destroyOverlay:function(){var t;this.options.modal&&this.overlay&&((t=this.document.data("ui-dialog-overlays")-1)?this.document.data("ui-dialog-overlays",t):(this.document.off("focusin.ui-dialog"),this.document.removeData("ui-dialog-overlays")),this.overlay.remove(),this.overlay=null)}}),!0===V.uiBackCompat&&V.widget("ui.dialog",V.ui.dialog,{options:{dialogClass:""},_createWrapper:function(){this._super(),this.uiDialog.addClass(this.options.dialogClass)},_setOption:function(t,e){"dialogClass"===t&&this.uiDialog.removeClass(this.options.dialogClass).addClass(e),this._superApply(arguments)}}),V.ui.dialog,V.widget("ui.progressbar",{version:"1.14.1",options:{classes:{"ui-progressbar":"ui-corner-all","ui-progressbar-value":"ui-corner-left","ui-progressbar-complete":"ui-corner-right"},max:100,value:0,change:null,complete:null},min:0,_create:function(){this.oldValue=this.options.value=this._constrainedValue(),this.element.attr({role:"progressbar","aria-valuemin":this.min}),this._addClass("ui-progressbar","ui-widget ui-widget-content"),this.valueDiv=V("
        ").appendTo(this.element),this._addClass(this.valueDiv,"ui-progressbar-value","ui-widget-header"),this._refreshValue()},_destroy:function(){this.element.removeAttr("role aria-valuemin aria-valuemax aria-valuenow"),this.valueDiv.remove()},value:function(t){if(void 0===t)return this.options.value;this.options.value=this._constrainedValue(t),this._refreshValue()},_constrainedValue:function(t){return void 0===t&&(t=this.options.value),this.indeterminate=!1===t,"number"!=typeof t&&(t=0),!this.indeterminate&&Math.min(this.options.max,Math.max(this.min,t))},_setOptions:function(t){var e=t.value;delete t.value,this._super(t),this.options.value=this._constrainedValue(e),this._refreshValue()},_setOption:function(t,e){"max"===t&&(e=Math.max(this.min,e)),this._super(t,e)},_setOptionDisabled:function(t){this._super(t),this.element.attr("aria-disabled",t),this._toggleClass(null,"ui-state-disabled",!!t)},_percentage:function(){return this.indeterminate?100:100*(this.options.value-this.min)/(this.options.max-this.min)},_refreshValue:function(){var t=this.options.value,e=this._percentage();this.valueDiv.toggle(this.indeterminate||t>this.min).width(e.toFixed(0)+"%"),this._toggleClass(this.valueDiv,"ui-progressbar-complete",null,t===this.options.max)._toggleClass("ui-progressbar-indeterminate",null,this.indeterminate),this.indeterminate?(this.element.removeAttr("aria-valuenow"),this.overlayDiv||(this.overlayDiv=V("
        ").appendTo(this.valueDiv),this._addClass(this.overlayDiv,"ui-progressbar-overlay"))):(this.element.attr({"aria-valuemax":this.options.max,"aria-valuenow":t}),this.overlayDiv&&(this.overlayDiv.remove(),this.overlayDiv=null)),this.oldValue!==t&&(this.oldValue=t,this._trigger("change")),t===this.options.max&&this._trigger("complete")}}),V.widget("ui.selectmenu",[V.ui.formResetMixin,{version:"1.14.1",defaultElement:"",widgetEventPrefix:"spin",options:{classes:{"ui-spinner":"ui-corner-all","ui-spinner-down":"ui-corner-br","ui-spinner-up":"ui-corner-tr"},culture:null,icons:{down:"ui-icon-triangle-1-s",up:"ui-icon-triangle-1-n"},incremental:!0,max:null,min:null,numberFormat:null,page:10,step:1,change:null,spin:null,start:null,stop:null},_create:function(){this._setOption("max",this.options.max),this._setOption("min",this.options.min),this._setOption("step",this.options.step),""!==this.value()&&this._value(this.element.val(),!0),this._draw(),this._on(this._events),this._refresh(),this._on(this.window,{beforeunload:function(){this.element.removeAttr("autocomplete")}})},_getCreateOptions:function(){var s=this._super(),n=this.element;return V.each(["min","max","step"],function(t,e){var i=n.attr(e);null!=i&&i.length&&(s[e]=i)}),s},_events:{keydown:function(t){this._start(t)&&this._keydown(t)&&t.preventDefault()},keyup:"_stop",focus:function(){this.previous=this.element.val()},blur:function(t){this._stop(),this._refresh(),this.previous!==this.element.val()&&this._trigger("change",t)},mousewheel:function(t,e){var i=this.document[0].activeElement;if(this.element[0]===i&&e){if(!this.spinning&&!this._start(t))return!1;this._spin((0").parent().append("")},_draw:function(){this._enhance(),this._addClass(this.uiSpinner,"ui-spinner","ui-widget ui-widget-content"),this._addClass("ui-spinner-input"),this.element.attr("role","spinbutton"),this.buttons=this.uiSpinner.children("a").attr("tabIndex",-1).attr("aria-hidden",!0).button({classes:{"ui-button":""}}),this._removeClass(this.buttons,"ui-corner-all"),this._addClass(this.buttons.first(),"ui-spinner-button ui-spinner-up"),this._addClass(this.buttons.last(),"ui-spinner-button ui-spinner-down"),this.buttons.first().button({icon:this.options.icons.up,showLabel:!1}),this.buttons.last().button({icon:this.options.icons.down,showLabel:!1}),this.buttons.height()>Math.ceil(.5*this.uiSpinner.height())&&0e.max?e.max:null!==e.min&&t"},_buttonHtml:function(){return""}});V.ui.spinner,V.widget("ui.tabs",{version:"1.14.1",delay:300,options:{active:null,classes:{"ui-tabs":"ui-corner-all","ui-tabs-nav":"ui-corner-all","ui-tabs-panel":"ui-corner-bottom","ui-tabs-tab":"ui-corner-top"},collapsible:!1,event:"click",heightStyle:"content",hide:null,show:null,activate:null,beforeActivate:null,beforeLoad:null,load:null},_isLocal:(f=/#.*$/,function(t){var e=t.href.replace(f,""),i=location.href.replace(f,"");try{e=decodeURIComponent(e)}catch(t){}try{i=decodeURIComponent(i)}catch(t){}return 1 li",function(t){V(this).is(".ui-state-disabled")&&t.preventDefault()}),this.tabs=this.tablist.find("> li:has(a[href])").attr({role:"tab",tabIndex:-1}),this._addClass(this.tabs,"ui-tabs-tab","ui-state-default"),this.anchors=this.tabs.map(function(){return V("a",this)[0]}).attr({tabIndex:-1}),this._addClass(this.anchors,"ui-tabs-anchor"),this.panels=V(),this.anchors.each(function(t,e){var i,s,n=V(e).uniqueId().attr("id"),o=V(e).closest("li"),a=o.attr("aria-controls");r._isLocal(e)?(s=decodeURIComponent(e.hash).substring(1),i=r.element.find("#"+CSS.escape(s))):(s=o.attr("aria-controls")||V({}).uniqueId()[0].id,(i=r.element.find("#"+s)).length||(i=r._createPanel(s)).insertAfter(r.panels[t-1]||r.tablist),i.attr("aria-live","polite")),i.length&&(r.panels=r.panels.add(i)),a&&o.data("ui-tabs-aria-controls",a),o.attr({"aria-controls":s,"aria-labelledby":n}),i.attr("aria-labelledby",n)}),this.panels.attr("role","tabpanel"),this._addClass(this.panels,"ui-tabs-panel","ui-widget-content"),t&&(this._off(t.not(this.tabs)),this._off(e.not(this.anchors)),this._off(i.not(this.panels)))},_getList:function(){return this.tablist||this.element.find("ol, ul").eq(0)},_createPanel:function(t){return V("
        ").attr("id",t).data("ui-tabs-destroy",!0)},_setOptionDisabled:function(t){var e,i;for(Array.isArray(t)&&(t.length?t.length===this.anchors.length&&(t=!0):t=!1),i=0;e=this.tabs[i];i++)e=V(e),!0===t||-1!==V.inArray(i,t)?(e.attr("aria-disabled","true"),this._addClass(e,null,"ui-state-disabled")):(e.removeAttr("aria-disabled"),this._removeClass(e,null,"ui-state-disabled"));this.options.disabled=t,this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!0===t)},_setupEvents:function(t){var i={};t&&V.each(t.split(" "),function(t,e){i[e]="_eventHandler"}),this._off(this.anchors.add(this.tabs).add(this.panels)),this._on(!0,this.anchors,{click:function(t){t.preventDefault()}}),this._on(this.anchors,i),this._on(this.tabs,{keydown:"_tabKeydown"}),this._on(this.panels,{keydown:"_panelKeydown"}),this._focusable(this.tabs),this._hoverable(this.tabs)},_setupHeightStyle:function(t){var i,e=this.element.parent();"fill"===t?(i=e.height(),i-=this.element.outerHeight()-this.element.height(),this.element.siblings(":visible").each(function(){var t=V(this),e=t.css("position");"absolute"!==e&&"fixed"!==e&&(i-=t.outerHeight(!0))}),this.element.children().not(this.panels).each(function(){i-=V(this).outerHeight(!0)}),this.panels.each(function(){V(this).height(Math.max(0,i-V(this).innerHeight()+V(this).height()))}).css("overflow","auto")):"auto"===t&&(i=0,this.panels.each(function(){i=Math.max(i,V(this).height("").height())}).height(i))},_eventHandler:function(t){var e=this.options,i=this.active,s=V(t.currentTarget).closest("li"),n=s[0]===i[0],o=n&&e.collapsible,a=o?V():this._getPanelForTab(s),r=i.length?this._getPanelForTab(i):V(),i={oldTab:i,oldPanel:r,newTab:o?V():s,newPanel:a};t.preventDefault(),s.hasClass("ui-state-disabled")||s.hasClass("ui-tabs-loading")||this.running||n&&!e.collapsible||!1===this._trigger("beforeActivate",t,i)||(e.active=!o&&this.tabs.index(s),this.active=n?V():s,this.xhr&&this.xhr.abort(),r.length||a.length||V.error("jQuery UI Tabs: Mismatching fragment identifier."),a.length&&this.load(this.tabs.index(s),t),this._toggle(t,i))},_toggle:function(t,e){var i=this,s=e.newPanel,n=e.oldPanel;function o(){i.running=!1,i._trigger("activate",t,e)}function a(){i._addClass(e.newTab.closest("li"),"ui-tabs-active","ui-state-active"),s.length&&i.options.show?i._show(s,i.options.show,o):(s.show(),o())}this.running=!0,n.length&&this.options.hide?this._hide(n,this.options.hide,function(){i._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),a()}):(this._removeClass(e.oldTab.closest("li"),"ui-tabs-active","ui-state-active"),n.hide(),a()),n.attr("aria-hidden","true"),e.oldTab.attr({"aria-selected":"false","aria-expanded":"false"}),s.length&&n.length?e.oldTab.attr("tabIndex",-1):s.length&&this.tabs.filter(function(){return 0===V(this).attr("tabIndex")}).attr("tabIndex",-1),s.attr("aria-hidden","false"),e.newTab.attr({"aria-selected":"true","aria-expanded":"true",tabIndex:0})},_activate:function(t){var t=this._findActive(t);t[0]!==this.active[0]&&(t=(t=t.length?t:this.active).find(".ui-tabs-anchor")[0],this._eventHandler({target:t,currentTarget:t,preventDefault:V.noop}))},_findActive:function(t){return!1===t?V():this.tabs.eq(t)},_getIndex:function(t){return t="string"==typeof t?this.anchors.index(this.anchors.filter("[href$='"+CSS.escape(t)+"']")):t},_destroy:function(){this.xhr&&this.xhr.abort(),this.tablist.removeAttr("role").off(this.eventNamespace),this.anchors.removeAttr("role tabIndex").removeUniqueId(),this.tabs.add(this.panels).each(function(){V.data(this,"ui-tabs-destroy")?V(this).remove():V(this).removeAttr("role tabIndex aria-live aria-busy aria-selected aria-labelledby aria-hidden aria-expanded")}),this.tabs.each(function(){var t=V(this),e=t.data("ui-tabs-aria-controls");e?t.attr("aria-controls",e).removeData("ui-tabs-aria-controls"):t.removeAttr("aria-controls")}),this.panels.show(),"content"!==this.options.heightStyle&&this.panels.css("height","")},enable:function(i){var t=this.options.disabled;!1!==t&&(t=void 0!==i&&(i=this._getIndex(i),Array.isArray(t)?V.map(t,function(t){return t!==i?t:null}):V.map(this.tabs,function(t,e){return e!==i?e:null})),this._setOptionDisabled(t))},disable:function(t){var e=this.options.disabled;if(!0!==e){if(void 0===t)e=!0;else{if(t=this._getIndex(t),-1!==V.inArray(t,e))return;e=Array.isArray(e)?V.merge([t],e).sort():[t]}this._setOptionDisabled(e)}},load:function(t,s){t=this._getIndex(t);function n(t,e){"abort"===e&&o.panels.stop(!1,!0),o._removeClass(i,"ui-tabs-loading"),a.removeAttr("aria-busy"),t===o.xhr&&delete o.xhr}var o=this,i=this.tabs.eq(t),t=i.find(".ui-tabs-anchor"),a=this._getPanelForTab(i),r={tab:i,panel:a};this._isLocal(t[0])||(this.xhr=V.ajax(this._ajaxSettings(t,s,r)),"canceled"!==this.xhr.statusText&&(this._addClass(i,"ui-tabs-loading"),a.attr("aria-busy","true"),this.xhr.done(function(t,e,i){a.html(t),o._trigger("load",s,r),n(i,e)}).fail(function(t,e){n(t,e)})))},_ajaxSettings:function(t,i,s){var n=this;return{url:t.attr("href"),beforeSend:function(t,e){return n._trigger("beforeLoad",i,V.extend({jqXHR:t,ajaxSettings:e},s))}}},_getPanelForTab:function(t){t=V(t).attr("aria-controls");return this.element.find("#"+CSS.escape(t))}}),!0===V.uiBackCompat&&V.widget("ui.tabs",V.ui.tabs,{_processTabs:function(){this._superApply(arguments),this._addClass(this.tabs,"ui-tab")}}),V.ui.tabs,V.widget("ui.tooltip",{version:"1.14.1",options:{classes:{"ui-tooltip":"ui-corner-all ui-widget-shadow"},content:function(){var t=V(this).attr("title");return V("").text(t).html()},hide:!0,items:"[title]:not([disabled])",position:{my:"left top+15",at:"left bottom",collision:"flipfit flip"},show:!0,track:!1,close:null,open:null},_addDescribedBy:function(t,e){var i=(t.attr("aria-describedby")||"").split(/\s+/);i.push(e),t.data("ui-tooltip-id",e).attr("aria-describedby",String.prototype.trim.call(i.join(" ")))},_removeDescribedBy:function(t){var e=t.data("ui-tooltip-id"),i=(t.attr("aria-describedby")||"").split(/\s+/),e=V.inArray(e,i);-1!==e&&i.splice(e,1),t.removeData("ui-tooltip-id"),(i=String.prototype.trim.call(i.join(" ")))?t.attr("aria-describedby",i):t.removeAttr("aria-describedby")},_create:function(){this._on({mouseover:"open",focusin:"open"}),this.tooltips={},this.parents={},this.liveRegion=V("
        ").attr({role:"log","aria-live":"assertive","aria-relevant":"additions"}).appendTo(this.document[0].body),this._addClass(this.liveRegion,null,"ui-helper-hidden-accessible"),this.disabledTitles=V([])},_setOption:function(t,e){var i=this;this._super(t,e),"content"===t&&V.each(this.tooltips,function(t,e){i._updateContent(e.element)})},_setOptionDisabled:function(t){this[t?"_disable":"_enable"]()},_disable:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur");i.target=i.currentTarget=e.element[0],s.close(i,!0)}),this.disabledTitles=this.disabledTitles.add(this.element.find(this.options.items).addBack().filter(function(){var t=V(this);if(t.is("[title]"))return t.data("ui-tooltip-title",t.attr("title")).removeAttr("title")}))},_enable:function(){this.disabledTitles.each(function(){var t=V(this);t.data("ui-tooltip-title")&&t.attr("title",t.data("ui-tooltip-title"))}),this.disabledTitles=V([])},open:function(t){var i=this,e=V(t?t.target:this.element).closest(this.options.items);e.length&&!e.data("ui-tooltip-id")&&(e.attr("title")&&e.data("ui-tooltip-title",e.attr("title")),e.data("ui-tooltip-open",!0),t&&"mouseover"===t.type&&e.parents().each(function(){var t,e=V(this);e.data("ui-tooltip-open")&&((t=V.Event("blur")).target=t.currentTarget=this,i.close(t,!0)),e.attr("title")&&(e.uniqueId(),i.parents[this.id]={element:this,title:e.attr("title")},e.attr("title",""))}),this._registerCloseHandlers(t,e),this._updateContent(e,t))},_updateContent:function(e,i){var t=this.options.content,s=this,n=i?i.type:null;if("string"==typeof t||t.nodeType||t.jquery)return this._open(i,e,t);(t=t.call(e[0],function(t){e.data("ui-tooltip-open")&&(i&&(i.type=n),s._open(i,e,t))}))&&this._open(i,e,t)},_open:function(t,e,i){var s,n,o,a=V.extend({},this.options.position);function r(t){a.of=t,s.is(":hidden")||s.position(a)}i&&((o=this._find(e))?o.tooltip.find(".ui-tooltip-content").html(i):(e.is("[title]")&&(t&&"mouseover"===t.type?e.attr("title",""):e.removeAttr("title")),o=this._tooltip(e),s=o.tooltip,this._addDescribedBy(e,s.attr("id")),s.find(".ui-tooltip-content").html(i),this.liveRegion.children().hide(),(o=V("
        ").html(s.find(".ui-tooltip-content").html())).removeAttr("name").find("[name]").removeAttr("name"),o.removeAttr("id").find("[id]").removeAttr("id"),o.appendTo(this.liveRegion),this.options.track&&t&&/^mouse/.test(t.type)?(this._on(this.document,{mousemove:r}),r(t)):s.position(V.extend({of:e},this.options.position)),s.hide(),this._show(s,this.options.show),this.options.track&&this.options.show&&this.options.show.delay&&(n=this.delayedShow=setInterval(function(){s.is(":visible")&&(r(a.of),clearInterval(n))},13)),this._trigger("open",t,{tooltip:s})))},_registerCloseHandlers:function(t,e){var i={keyup:function(t){t.keyCode===V.ui.keyCode.ESCAPE&&((t=V.Event(t)).currentTarget=e[0],this.close(t,!0))}};e[0]!==this.element[0]&&(i.remove=function(){var t=this._find(e);t&&this._removeTooltip(t.tooltip)}),t&&"mouseover"!==t.type||(i.mouseleave="close"),t&&"focusin"!==t.type||(i.focusout="close"),this._on(!0,e,i)},close:function(t){var e,i=this,s=V(t?t.currentTarget:this.element),n=this._find(s);n?(e=n.tooltip,n.closing||(clearInterval(this.delayedShow),s.data("ui-tooltip-title")&&!s.attr("title")&&s.attr("title",s.data("ui-tooltip-title")),this._removeDescribedBy(s),n.hiding=!0,e.stop(!0),this._hide(e,this.options.hide,function(){i._removeTooltip(V(this))}),s.removeData("ui-tooltip-open"),this._off(s,"mouseleave focusout keyup"),s[0]!==this.element[0]&&this._off(s,"remove"),this._off(this.document,"mousemove"),t&&"mouseleave"===t.type&&V.each(this.parents,function(t,e){V(e.element).attr("title",e.title),delete i.parents[t]}),n.closing=!0,this._trigger("close",t,{tooltip:e}),n.hiding)||(n.closing=!1)):s.removeData("ui-tooltip-open")},_tooltip:function(t){var e=V("
        ").attr("role","tooltip"),i=V("
        ").appendTo(e),s=e.uniqueId().attr("id");return this._addClass(i,"ui-tooltip-content"),this._addClass(e,"ui-tooltip","ui-widget ui-widget-content"),e.appendTo(this._appendTo(t)),this.tooltips[s]={element:t,tooltip:e}},_find:function(t){t=t.data("ui-tooltip-id");return t?this.tooltips[t]:null},_removeTooltip:function(t){clearInterval(this.delayedShow),t.remove(),delete this.tooltips[t.attr("id")]},_appendTo:function(t){t=t.closest(".ui-front, dialog");return t=t.length?t:this.document[0].body},_destroy:function(){var s=this;V.each(this.tooltips,function(t,e){var i=V.Event("blur"),e=e.element;i.target=i.currentTarget=e[0],s.close(i,!0),V("#"+t).remove(),e.data("ui-tooltip-title")&&(e.attr("title")||e.attr("title",e.data("ui-tooltip-title")),e.removeData("ui-tooltip-title"))}),this.liveRegion.remove()}}),!0===V.uiBackCompat&&V.widget("ui.tooltip",V.ui.tooltip,{options:{tooltipClass:null},_tooltip:function(){var t=this._superApply(arguments);return this.options.tooltipClass&&t.tooltip.addClass(this.options.tooltipClass),t}}),V.ui.tooltip;var f,g=V,m={},q=m.toString,K=/^([\-+])=\s*(\d+\.?\d*)/,U=[{re:/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[t[1],t[2],t[3],t[4]]}},{re:/rgba?\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,parse:function(t){return[2.55*t[1],2.55*t[2],2.55*t[3],t[4]]}},{re:/#([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?/,parse:function(t){return[parseInt(t[1],16),parseInt(t[2],16),parseInt(t[3],16),t[4]?(parseInt(t[4],16)/255).toFixed(2):1]}},{re:/#([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?/,parse:function(t){return[parseInt(t[1]+t[1],16),parseInt(t[2]+t[2],16),parseInt(t[3]+t[3],16),t[4]?(parseInt(t[4]+t[4],16)/255).toFixed(2):1]}},{re:/hsla?\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d?(?:\.\d+)?)\s*)?\)/,space:"hsla",parse:function(t){return[t[1],t[2]/100,t[3]/100,t[4]]}}],_=g.Color=function(t,e,i,s){return new g.Color.fn.parse(t,e,i,s)},v={rgba:{props:{red:{idx:0,type:"byte"},green:{idx:1,type:"byte"},blue:{idx:2,type:"byte"}}},hsla:{props:{hue:{idx:0,type:"degrees"},saturation:{idx:1,type:"percent"},lightness:{idx:2,type:"percent"}}}},X={byte:{floor:!0,max:255},percent:{max:1},degrees:{mod:360,floor:!0}},b=g.each;function y(t){return null==t?t+"":"object"==typeof t?m[q.call(t)]||"object":typeof t}function w(t,e,i){var s=X[e.type]||{};return null==t?i||!e.def?null:e.def:(t=s.floor?~~t:parseFloat(t),s.mod?(t+s.mod)%s.mod:Math.min(s.max,Math.max(0,t)))}function $(s){var n=_(),o=n._rgba=[];return s=s.toLowerCase(),b(U,function(t,e){var i=e.re.exec(s),i=i&&e.parse(i),e=e.space||"rgba";if(i)return i=n[e](i),n[v[e].cache]=i[v[e].cache],o=n._rgba=i._rgba,!1}),o.length?("0,0,0,0"===o.join()&&g.extend(o,M.transparent),n):M[s]}function T(t,e,i){return 6*(i=(i+1)%1)<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}b(v,function(t,e){e.cache="_"+t,e.props.alpha={idx:3,type:"percent",def:1}}),g.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){m["[object "+e+"]"]=e.toLowerCase()}),_.fn=g.extend(_.prototype,{parse:function(n,t,e,i){if(void 0===n)return this._rgba=[null,null,null,null],this;(n.jquery||n.nodeType)&&(n=g(n).css(t),t=void 0);var o=this,s=y(n),a=this._rgba=[];return void 0!==t&&(n=[n,t,e,i],s="array"),"string"===s?this.parse($(n)||M._default):"array"===s?(b(v.rgba.props,function(t,e){a[e.idx]=w(n[e.idx],e)}),this):"object"===s?(n instanceof _?b(v,function(t,e){n[e.cache]&&(o[e.cache]=n[e.cache].slice())}):b(v,function(t,i){var s=i.cache;b(i.props,function(t,e){if(!o[s]&&i.to){if("alpha"===t||null==n[t])return;o[s]=i.to(o._rgba)}o[s][e.idx]=w(n[t],e,!0)}),o[s]&&g.inArray(null,o[s].slice(0,3))<0&&(null==o[s][3]&&(o[s][3]=1),i.from)&&(o._rgba=i.from(o[s]))}),this):void 0},is:function(t){var n=_(t),o=!0,a=this;return b(v,function(t,e){var i,s=n[e.cache];return s&&(i=a[e.cache]||e.to&&e.to(a._rgba)||[],b(e.props,function(t,e){if(null!=s[e.idx])return o=s[e.idx]===i[e.idx]})),o}),o},_space:function(){var i=[],s=this;return b(v,function(t,e){s[e.cache]&&i.push(t)}),i.pop()},transition:function(t,a){var t=(h=_(t))._space(),e=v[t],i=0===this.alpha()?_("transparent"):this,r=i[e.cache]||e.to(i._rgba),l=r.slice(),h=h[e.cache];return b(e.props,function(t,e){var i=e.idx,s=r[i],n=h[i],o=X[e.type]||{};null!==n&&(null===s?l[i]=n:(o.mod&&(n-s>o.mod/2?s+=o.mod:s-n>o.mod/2&&(s-=o.mod)),l[i]=w((n-s)*a+s,e)))}),this[t](l)},blend:function(t){var e,i,s;return 1===this._rgba[3]?this:(e=this._rgba.slice(),i=e.pop(),s=_(t)._rgba,_(g.map(e,function(t,e){return(1-i)*s[e]+i*t})))},toRgbaString:function(){var t="rgba(",e=g.map(this._rgba,function(t,e){return null!=t?t:2{var i,s,n={};for(i in e)s=e[i],t[i]===s||tt[i]||!V.fx.step[i]&&isNaN(parseFloat(s))||(n[i]=s);return n})(this.start,this.end),this}),i.attr("class",t),e=e.map(function(){var t=this,e=V.Deferred(),i=V.extend({},o,{queue:!1,complete:function(){e.resolve(t)}});return this.el.animate(this.diff,i),e.promise()}),V.when.apply(V,e.get()).done(function(){s(),V.each(arguments,function(){var e=this.el;V.each(this.diff,function(t){e.css(t,"")})}),o.complete.call(i[0])})})},V.fn.extend({addClass:(J=V.fn.addClass,function(t,e,i,s){return e?V.effects.animateClass.call(this,{add:t},e,i,s):J.apply(this,arguments)}),removeClass:(Q=V.fn.removeClass,function(t,e,i,s){return 1
        ").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),e={width:i.width(),height:i.height()},n=document.activeElement;try{n.id}catch(t){n=document.body}return i.wrap(t),i[0]!==n&&!V.contains(i[0],n)||V(n).trigger("focus"),t=i.parent(),"static"===i.css("position")?(t.css({position:"relative"}),i.css({position:"relative"})):(V.extend(s,{position:i.css("position"),zIndex:i.css("z-index")}),V.each(["top","left","bottom","right"],function(t,e){s[e]=i.css(e),isNaN(parseInt(s[e],10))&&(s[e]="auto")}),i.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),i.css(e),t.css(s).show()},removeWrapper:function(t){var e=document.activeElement;return t.parent().is(".ui-effects-wrapper")&&(t.parent().replaceWith(t),t[0]!==e&&!V.contains(t[0],e)||V(e).trigger("focus")),t}}),V.extend(V.effects,{version:"1.14.1",define:function(t,e,i){return i||(i=e,e="effect"),V.effects.effect[t]=i,V.effects.effect[t].mode=e,i},scaledDimensions:function(t,e,i){var s;return 0===e?{height:0,width:0,outerHeight:0,outerWidth:0}:(s="horizontal"!==i?(e||100)/100:1,i="vertical"!==i?(e||100)/100:1,{height:t.height()*i,width:t.width()*s,outerHeight:t.outerHeight()*i,outerWidth:t.outerWidth()*s})},clipToBox:function(t){return{width:t.clip.right-t.clip.left,height:t.clip.bottom-t.clip.top,left:t.clip.left,top:t.clip.top}},unshift:function(t,e,i){var s=t.queue();1").insertAfter(t).css({display:/^(inline|ruby)/.test(t.css("display"))?"inline-block":"block",visibility:"hidden",marginTop:t.css("marginTop"),marginBottom:t.css("marginBottom"),marginLeft:t.css("marginLeft"),marginRight:t.css("marginRight"),float:t.css("float")}).outerWidth(t.outerWidth()).outerHeight(t.outerHeight()).addClass("ui-effects-placeholder"),t.data(S+"placeholder",e)),t.css({position:i,left:s.left,top:s.top}),e},removePlaceholder:function(t){var e=S+"placeholder",i=t.data(e);i&&(i.remove(),t.removeData(e))},cleanUp:function(t){V.effects.restoreStyle(t),V.effects.removePlaceholder(t)},setTransition:function(s,t,n,o){return o=o||{},V.each(t,function(t,e){var i=s.cssUnit(e);0
        ");l.appendTo("body").addClass(t.className).css({top:s.top-a,left:s.left-o,height:i.innerHeight(),width:i.innerWidth(),position:n?"fixed":"absolute"}).animate(r,t.duration,t.easing,function(){l.remove(),"function"==typeof e&&e()})}}),V.fx.step.clip=function(t){t.clipInit||(t.start=V(t.elem).cssClip(),"string"==typeof t.end&&(t.end=at(t.end,t.elem)),t.clipInit=!0),V(t.elem).cssClip({top:t.pos*(t.end.top-t.start.top)+t.start.top,right:t.pos*(t.end.right-t.start.right)+t.start.right,bottom:t.pos*(t.end.bottom-t.start.bottom)+t.start.bottom,left:t.pos*(t.end.left-t.start.left)+t.start.left})},P={},V.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){P[t]=function(t){return Math.pow(t,e+2)}}),V.extend(P,{Sine:function(t){return 1-Math.cos(t*Math.PI/2)},Circ:function(t){return 1-Math.sqrt(1-t*t)},Elastic:function(t){return 0===t||1===t?t:-Math.pow(2,8*(t-1))*Math.sin((80*(t-1)-7.5)*Math.PI/15)},Back:function(t){return t*t*(3*t-2)},Bounce:function(t){for(var e,i=4;t<((e=Math.pow(2,--i))-1)/11;);return 1/Math.pow(4,3-i)-7.5625*Math.pow((3*e-2)/22-t,2)}}),V.each(P,function(t,e){V.easing["easeIn"+t]=e,V.easing["easeOut"+t]=function(t){return 1-e(1-t)},V.easing["easeInOut"+t]=function(t){return t<.5?e(2*t)/2:1-e(-2*t+2)/2}});var rt=V.effects;V.effects.define("blind","hide",function(t,e){var i={up:["bottom","top"],vertical:["bottom","top"],down:["top","bottom"],left:["right","left"],horizontal:["right","left"],right:["left","right"]},s=V(this),n=t.direction||"up",o=s.cssClip(),a={clip:V.extend({},o)},r=V.effects.createPlaceholder(s);a.clip[i[n][0]]=a.clip[i[n][1]],"show"===t.mode&&(s.cssClip(a.clip),r&&r.css(V.effects.clipToBox(a)),a.clip=o),r&&r.animate(V.effects.clipToBox(a),t.duration,t.easing),s.animate(a,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("bounce",function(t,e){var i,s,n=V(this),o=t.mode,a="hide"===o,o="show"===o,r=t.direction||"up",l=t.distance,h=t.times||5,c=2*h+(o||a?1:0),u=t.duration/c,d=t.easing,p="up"===r||"down"===r?"top":"left",f="up"===r||"left"===r,g=0,t=n.queue().length;for(V.effects.createPlaceholder(n),r=n.css(p),l=l||n["top"==p?"outerHeight":"outerWidth"]()/3,o&&((s={opacity:1})[p]=r,n.css("opacity",0).css(p,f?2*-l:2*l).animate(s,u,d)),a&&(l/=Math.pow(2,h-1)),(s={})[p]=r;g
        ").css({position:"absolute",visibility:"visible",left:-s*p,top:-i*f}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:p,height:f,left:n+(u?a*p:0),top:o+(u?r*f:0),opacity:u?0:1}).animate({left:n+(u?0:a*p),top:o+(u?0:r*f),opacity:u?1:0},t.duration||500,t.easing,m)}),V.effects.define("fade","toggle",function(t,e){var i="show"===t.mode;V(this).css("opacity",i?0:1).animate({opacity:i?1:0},{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("fold","hide",function(e,t){var i=V(this),s=e.mode,n="show"===s,s="hide"===s,o=e.size||15,a=/([0-9]+)%/.exec(o),r=!!e.horizFirst?["right","bottom"]:["bottom","right"],l=e.duration/2,h=V.effects.createPlaceholder(i),c=i.cssClip(),u={clip:V.extend({},c)},d={clip:V.extend({},c)},p=[c[r[0]],c[r[1]]],f=i.queue().length;a&&(o=parseInt(a[1],10)/100*p[s?0:1]),u.clip[r[0]]=o,d.clip[r[0]]=o,d.clip[r[1]]=0,n&&(i.cssClip(d.clip),h&&h.css(V.effects.clipToBox(d)),d.clip=c),i.queue(function(t){h&&h.animate(V.effects.clipToBox(u),l,e.easing).animate(V.effects.clipToBox(d),l,e.easing),t()}).animate(u,l,e.easing).animate(d,l,e.easing).queue(t),V.effects.unshift(i,f,4)}),V.effects.define("highlight","show",function(t,e){var i=V(this),s={backgroundColor:i.css("backgroundColor")};"hide"===t.mode&&(s.opacity=0),V.effects.saveStyle(i),i.css({backgroundImage:"none",backgroundColor:t.color||"#ffff99"}).animate(s,{queue:!1,duration:t.duration,easing:t.easing,complete:e})}),V.effects.define("size",function(s,e){var n,i=V(this),t=["fontSize"],o=["borderTopWidth","borderBottomWidth","paddingTop","paddingBottom"],a=["borderLeftWidth","borderRightWidth","paddingLeft","paddingRight"],r=s.mode,l="effect"!==r,h=s.scale||"both",c=s.origin||["middle","center"],u=i.css("position"),d=i.position(),p=V.effects.scaledDimensions(i),f=s.from||p,g=s.to||V.effects.scaledDimensions(i,0);V.effects.createPlaceholder(i),"show"===r&&(r=f,f=g,g=r),n={from:{y:f.height/p.height,x:f.width/p.width},to:{y:g.height/p.height,x:g.width/p.width}},"box"!==h&&"both"!==h||(n.from.y!==n.to.y&&(f=V.effects.setTransition(i,o,n.from.y,f),g=V.effects.setTransition(i,o,n.to.y,g)),n.from.x!==n.to.x&&(f=V.effects.setTransition(i,a,n.from.x,f),g=V.effects.setTransition(i,a,n.to.x,g))),"content"!==h&&"both"!==h||n.from.y!==n.to.y&&(f=V.effects.setTransition(i,t,n.from.y,f),g=V.effects.setTransition(i,t,n.to.y,g)),c&&(r=V.effects.getBaseline(c,p),f.top=(p.outerHeight-f.outerHeight)*r.y+d.top,f.left=(p.outerWidth-f.outerWidth)*r.x+d.left,g.top=(p.outerHeight-g.outerHeight)*r.y+d.top,g.left=(p.outerWidth-g.outerWidth)*r.x+d.left),delete f.outerHeight,delete f.outerWidth,i.css(f),"content"!==h&&"both"!==h||(o=o.concat(["marginTop","marginBottom"]).concat(t),a=a.concat(["marginLeft","marginRight"]),i.find("*[width]").each(function(){var t=V(this),e=V.effects.scaledDimensions(t),i={height:e.height*n.from.y,width:e.width*n.from.x,outerHeight:e.outerHeight*n.from.y,outerWidth:e.outerWidth*n.from.x},e={height:e.height*n.to.y,width:e.width*n.to.x,outerHeight:e.height*n.to.y,outerWidth:e.width*n.to.x};n.from.y!==n.to.y&&(i=V.effects.setTransition(t,o,n.from.y,i),e=V.effects.setTransition(t,o,n.to.y,e)),n.from.x!==n.to.x&&(i=V.effects.setTransition(t,a,n.from.x,i),e=V.effects.setTransition(t,a,n.to.x,e)),l&&V.effects.saveStyle(t),t.css(i),t.animate(e,s.duration,s.easing,function(){l&&V.effects.restoreStyle(t)})})),i.animate(g,{queue:!1,duration:s.duration,easing:s.easing,complete:function(){var t=i.offset();0===g.opacity&&i.css("opacity",f.opacity),l||(i.css("position","static"===u?"relative":u).offset(t),V.effects.saveStyle(i)),e()}})}),V.effects.define("scale",function(t,e){var i=V(this),s=t.mode,s=parseInt(t.percent,10)||(0===parseInt(t.percent,10)||"effect"!==s?0:100),i=V.extend(!0,{from:V.effects.scaledDimensions(i),to:V.effects.scaledDimensions(i,s,t.direction||"both"),origin:t.origin||["middle","center"]},t);t.fade&&(i.from.opacity=1,i.to.opacity=0),V.effects.effect.size.call(this,i,e)}),V.effects.define("puff","hide",function(t,e){t=V.extend(!0,{},t,{fade:!0,percent:parseInt(t.percent,10)||150});V.effects.effect.scale.call(this,t,e)}),V.effects.define("pulsate","show",function(t,e){var i=V(this),s=t.mode,n="show"===s,o=2*(t.times||5)+(n||"hide"===s?1:0),a=t.duration/o,r=0,l=1,s=i.queue().length;for(!n&&i.is(":visible")||(i.css("opacity",0).show(),r=1);l elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + // Support: QtWeb <=3.8.5, WebKit <=534.34, wkhtmltopdf tool <=0.12.5 + // Plus for old WebKit, typeof returns "function" for HTML collections + // (e.g., `typeof document.getElementsByTagName("div") === "function"`). (gh-4756) + return typeof obj === "function" && typeof obj.nodeType !== "number" && + typeof obj.item !== "function"; + }; -var - // Use the correct document accordingly with window argument (sandbox) - document = window.document, +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; - version = "2.1.4", + +var document = window.document; + + + + var preservedScriptAttributes = { + type: true, + src: true, + nonce: true, + noModule: true + }; + + function DOMEval( code, node, doc ) { + doc = doc || document; + + var i, val, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + + // Support: Firefox 64+, Edge 18+ + // Some browsers don't support the "nonce" property on scripts. + // On the other hand, just using `getAttribute` is not enough as + // the `nonce` attribute is reset to an empty string whenever it + // becomes browsing-context connected. + // See https://github.com/whatwg/html/issues/2369 + // See https://html.spec.whatwg.org/#nonce-attributes + // The `node.getAttribute` check was added for the sake of + // `jQuery.globalEval` so that it can fake a nonce-containing node + // via an object. + val = node[ i ] || node.getAttribute && node.getAttribute( i ); + if ( val ) { + script.setAttribute( i, val ); + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var version = "3.7.1", + + rhtmlSuffix = /HTML$/i, // Define a local copy of jQuery jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' // Need init if jQuery is called (just allow error to be thrown if not included) return new jQuery.fn.init( selector, context ); - }, - - // Support: Android<4.1 - // Make sure we trim BOM and NBSP - rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, - - // Matches dashed string for camelizing - rmsPrefix = /^-ms-/, - rdashAlpha = /-([\da-z])/gi, - - // Used by jQuery.camelCase as callback to replace() - fcamelCase = function( all, letter ) { - return letter.toUpperCase(); }; jQuery.fn = jQuery.prototype = { + // The current version of jQuery being used jquery: version, constructor: jQuery, - // Start with an empty selector - selector: "", - // The default length of a jQuery object is 0 length: 0, @@ -108,13 +176,14 @@ jQuery.fn = jQuery.prototype = { // Get the Nth element in the matched element set OR // Get the whole matched element set as a clean array get: function( num ) { - return num != null ? - // Return just the one element from the set - ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } - // Return all the elements in a clean array - slice.call( this ); + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; }, // Take an array of elements and push it onto the stack @@ -126,23 +195,20 @@ jQuery.fn = jQuery.prototype = { // Add the old object onto the stack (as a reference) ret.prevObject = this; - ret.context = this.context; // Return the newly-formed element set return ret; }, // Execute a callback for every element in the matched set. - // (You can seed the arguments with an array of args, but this is - // only used internally.) - each: function( callback, args ) { - return jQuery.each( this, callback, args ); + each: function( callback ) { + return jQuery.each( this, callback ); }, map: function( callback ) { - return this.pushStack( jQuery.map(this, function( elem, i ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { return callback.call( elem, i, elem ); - })); + } ) ); }, slice: function() { @@ -157,14 +223,26 @@ jQuery.fn = jQuery.prototype = { return this.eq( -1 ); }, + even: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return ( i + 1 ) % 2; + } ) ); + }, + + odd: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return i % 2; + } ) ); + }, + eq: function( i ) { var len = this.length, j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); }, end: function() { - return this.prevObject || this.constructor(null); + return this.prevObject || this.constructor(); }, // For internal use only. @@ -176,7 +254,7 @@ jQuery.fn = jQuery.prototype = { jQuery.extend = jQuery.fn.extend = function() { var options, name, src, copy, copyIsArray, clone, - target = arguments[0] || {}, + target = arguments[ 0 ] || {}, i = 1, length = arguments.length, deep = false; @@ -191,7 +269,7 @@ jQuery.extend = jQuery.fn.extend = function() { } // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + if ( typeof target !== "object" && !isFunction( target ) ) { target = {}; } @@ -202,27 +280,34 @@ jQuery.extend = jQuery.fn.extend = function() { } for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values - if ( (options = arguments[ i ]) != null ) { + if ( ( options = arguments[ i ] ) != null ) { + // Extend the base object for ( name in options ) { - src = target[ name ]; copy = options[ name ]; + // Prevent Object.prototype pollution // Prevent never-ending loop - if ( target === copy ) { + if ( name === "__proto__" || target === copy ) { continue; } // Recurse if we're merging plain objects or arrays - if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { - if ( copyIsArray ) { - copyIsArray = false; - clone = src && jQuery.isArray(src) ? src : []; + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + src = target[ name ]; + // Ensure proper type for the source value + if ( copyIsArray && !Array.isArray( src ) ) { + clone = []; + } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { + clone = {}; } else { - clone = src && jQuery.isPlainObject(src) ? src : {}; + clone = src; } + copyIsArray = false; // Never move original objects, clone them target[ name ] = jQuery.extend( deep, clone, copy ); @@ -239,7 +324,8 @@ jQuery.extend = jQuery.fn.extend = function() { return target; }; -jQuery.extend({ +jQuery.extend( { + // Unique for each copy of jQuery on the page expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), @@ -252,138 +338,56 @@ jQuery.extend({ noop: function() {}, - isFunction: function( obj ) { - return jQuery.type(obj) === "function"; - }, - - isArray: Array.isArray, - - isWindow: function( obj ) { - return obj != null && obj === obj.window; - }, - - isNumeric: function( obj ) { - // parseFloat NaNs numeric-cast false positives (null|true|false|"") - // ...but misinterprets leading-number strings, particularly hex literals ("0x...") - // subtraction forces infinities to NaN - // adding 1 corrects loss of precision from parseFloat (#15100) - return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; - }, - isPlainObject: function( obj ) { - // Not plain objects: - // - Any object or value whose internal [[Class]] property is not "[object Object]" - // - DOM nodes - // - window - if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { return false; } - if ( obj.constructor && - !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { - return false; + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; } - // If the function hasn't returned already, we're confident that - // |obj| is a plain object, created by {} or constructed with new Object - return true; + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; }, isEmptyObject: function( obj ) { var name; + for ( name in obj ) { return false; } return true; }, - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - // Support: Android<4.0, iOS<6 (functionish RegExp) - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call(obj) ] || "object" : - typeof obj; + // Evaluates a script in a provided context; falls back to the global one + // if not specified. + globalEval: function( code, options, doc ) { + DOMEval( code, { nonce: options && options.nonce }, doc ); }, - // Evaluates a script in a global context - globalEval: function( code ) { - var script, - indirect = eval; + each: function( obj, callback ) { + var length, i = 0; - code = jQuery.trim( code ); - - if ( code ) { - // If the code includes a valid, prologue position - // strict mode pragma, execute code by injecting a - // script tag into the document. - if ( code.indexOf("use strict") === 1 ) { - script = document.createElement("script"); - script.text = code; - document.head.appendChild( script ).parentNode.removeChild( script ); - } else { - // Otherwise, avoid the DOM node creation, insertion - // and removal by using an indirect global eval - indirect( code ); - } - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // Support: IE9-11+ - // Microsoft forgot to hump their vendor prefix (#9572) - camelCase: function( string ) { - return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); - }, - - nodeName: function( elem, name ) { - return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); - }, - - // args is for internal usage only - each: function( obj, callback, args ) { - var value, - i = 0, - length = obj.length, - isArray = isArraylike( obj ); - - if ( args ) { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.apply( obj[ i ], args ); - - if ( value === false ) { - break; - } + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; } } - - // A special, fast, case for the most common use of each } else { - if ( isArray ) { - for ( ; i < length; i++ ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } - } - } else { - for ( i in obj ) { - value = callback.call( obj[ i ], i, obj[ i ] ); - - if ( value === false ) { - break; - } + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; } } } @@ -391,11 +395,36 @@ jQuery.extend({ return obj; }, - // Support: Android<4.1 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); + + // Retrieve the text value of an array of DOM nodes + text: function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + + // If no nodeType, this is expected to be an array + while ( ( node = elem[ i++ ] ) ) { + + // Do not traverse comment nodes + ret += jQuery.text( node ); + } + } + if ( nodeType === 1 || nodeType === 11 ) { + return elem.textContent; + } + if ( nodeType === 9 ) { + return elem.documentElement.textContent; + } + if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + + // Do not include comment or processing instruction nodes + + return ret; }, // results is for internal usage only @@ -403,10 +432,10 @@ jQuery.extend({ var ret = results || []; if ( arr != null ) { - if ( isArraylike( Object(arr) ) ) { + if ( isArrayLike( Object( arr ) ) ) { jQuery.merge( ret, typeof arr === "string" ? - [ arr ] : arr + [ arr ] : arr ); } else { push.call( ret, arr ); @@ -420,6 +449,17 @@ jQuery.extend({ return arr == null ? -1 : indexOf.call( arr, elem, i ); }, + isXMLDoc: function( elem ) { + var namespace = elem && elem.namespaceURI, + docElem = elem && ( elem.ownerDocument || elem ).documentElement; + + // Assume HTML when documentElement doesn't yet exist, such as inside + // document fragments. + return !rhtmlSuffix.test( namespace || docElem && docElem.nodeName || "HTML" ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit merge: function( first, second ) { var len = +second.length, j = 0, @@ -455,14 +495,13 @@ jQuery.extend({ // arg is for internal usage only map: function( elems, callback, arg ) { - var value, + var length, value, i = 0, - length = elems.length, - isArray = isArraylike( elems ), ret = []; // Go through the array, translating each of the items to their new values - if ( isArray ) { + if ( isArrayLike( elems ) ) { + length = elems.length; for ( ; i < length; i++ ) { value = callback( elems[ i ], i, arg ); @@ -483,116 +522,141 @@ jQuery.extend({ } // Flatten any nested arrays - return concat.apply( [], ret ); + return flat( ret ); }, // A global GUID counter for objects guid: 1, - // Bind a function to a context, optionally partially applying any - // arguments. - proxy: function( fn, context ) { - var tmp, args, proxy; - - if ( typeof context === "string" ) { - tmp = fn[ context ]; - context = fn; - fn = tmp; - } - - // Quick check to determine if target is callable, in the spec - // this throws a TypeError, but we will just return undefined. - if ( !jQuery.isFunction( fn ) ) { - return undefined; - } - - // Simulated bind - args = slice.call( arguments, 2 ); - proxy = function() { - return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); - }; - - // Set the guid of unique handler to the same of original handler, so it can be removed - proxy.guid = fn.guid = fn.guid || jQuery.guid++; - - return proxy; - }, - - now: Date.now, - // jQuery.support is not used in Core but other projects attach their // properties to it so it needs to exist. support: support -}); +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} // Populate the class2type map -jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { - class2type[ "[object " + name + "]" ] = name.toLowerCase(); -}); +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), + function( _i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); + } ); -function isArraylike( obj ) { +function isArrayLike( obj ) { - // Support: iOS 8.2 (not reproducible in simulator) + // Support: real iOS 8.2 only (not reproducible in simulator) // `in` check used to prevent JIT error (gh-2145) // hasOwn isn't used here due to false negatives // regarding Nodelist length in IE - var length = "length" in obj && obj.length, - type = jQuery.type( obj ); + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); - if ( type === "function" || jQuery.isWindow( obj ) ) { + if ( isFunction( obj ) || isWindow( obj ) ) { return false; } - if ( obj.nodeType === 1 && length ) { - return true; - } - return type === "array" || length === 0 || typeof length === "number" && length > 0 && ( length - 1 ) in obj; } -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.2.0-pre - * http://sizzlejs.com/ - * - * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2014-12-16 - */ -(function( window ) { + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +} +var pop = arr.pop; + + +var sort = arr.sort; + + +var splice = arr.splice; + + +var whitespace = "[\\x20\\t\\r\\n\\f]"; + + +var rtrimCSS = new RegExp( + "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", + "g" +); + + + + +// Note: an element does not contain itself +jQuery.contains = function( a, b ) { + var bup = b && b.parentNode; + + return a === bup || !!( bup && bup.nodeType === 1 && ( + + // Support: IE 9 - 11+ + // IE doesn't have `contains` on SVG. + a.contains ? + a.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + ) ); +}; + + + + +// CSS string/identifier serialization +// https://drafts.csswg.org/cssom/#common-serializing-idioms +var rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\x80-\uFFFF\w-]/g; + +function fcssescape( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; +} + +jQuery.escapeSelector = function( sel ) { + return ( sel + "" ).replace( rcssescape, fcssescape ); +}; + + + + +var preferredDoc = document, + pushNative = push; + +( function() { var i, - support, Expr, - getText, - isXML, - tokenize, - compile, - select, outermostContext, sortInput, hasDuplicate, + push = pushNative, // Local document vars - setDocument, document, - docElem, + documentElement, documentIsHTML, rbuggyQSA, - rbuggyMatches, matches, - contains, // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, + expando = jQuery.expando, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), + nonnativeSelectorCache = createCache(), sortOrder = function( a, b ) { if ( a === b ) { hasDuplicate = true; @@ -600,251 +664,271 @@ var i, return 0; }, - // General-purpose constants - MAX_NEGATIVE = 1 << 31, - - // Instance methods - hasOwn = ({}).hasOwnProperty, - arr = [], - pop = arr.pop, - push_native = arr.push, - push = arr.push, - slice = arr.slice, - // Use a stripped-down indexOf as it's faster than native - // http://jsperf.com/thor-indexof-vs-for/5 - indexOf = function( list, elem ) { - var i = 0, - len = list.length; - for ( ; i < len; i++ ) { - if ( list[i] === elem ) { - return i; - } - } - return -1; - }, - - booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|" + + "loop|multiple|open|readonly|required|scoped", // Regular expressions - // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - // http://www.w3.org/TR/css3-syntax/#characters - characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram + identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", - // Loosely modeled on CSS identifier characters - // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors - // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = characterEncoding.replace( "w", "w#" ), + // Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + // Operator (capture 2) "*([*^$|!~]?=)" + whitespace + - // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" - "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + - "*\\]", - pseudos = ":(" + characterEncoding + ")(?:\\((" + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + + whitespace + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: // 1. quoted (capture 3; capture 4 or capture 5) "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) ".*" + ")\\)|)", // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter rwhitespace = new RegExp( whitespace + "+", "g" ), - rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), - rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), - - rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + rleadingCombinator = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + + whitespace + "*" ), + rdescend = new RegExp( whitespace + "|>" ), rpseudo = new RegExp( pseudos ), ridentifier = new RegExp( "^" + identifier + "$" ), matchExpr = { - "ID": new RegExp( "^#(" + characterEncoding + ")" ), - "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), - "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), - "ATTR": new RegExp( "^" + attributes ), - "PSEUDO": new RegExp( "^" + pseudos ), - "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + - "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + - "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), - "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + ID: new RegExp( "^#(" + identifier + ")" ), + CLASS: new RegExp( "^\\.(" + identifier + ")" ), + TAG: new RegExp( "^(" + identifier + "|[*])" ), + ATTR: new RegExp( "^" + attributes ), + PSEUDO: new RegExp( "^" + pseudos ), + CHILD: new RegExp( + "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + bool: new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() // We use this for POS matching in `select` - "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + - whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + needsContext: new RegExp( "^" + whitespace + + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) }, rinputs = /^(?:input|select|textarea|button)$/i, rheader = /^h\d$/i, - rnative = /^[^{]+\{\s*\[native \w/, - // Easily-parseable/retrievable ID or TAG or CLASS selectors rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, rsibling = /[+~]/, - rescape = /'|\\/g, - // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters - runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), - funescape = function( _, escaped, escapedWhitespace ) { - var high = "0x" + escaped - 0x10000; - // NaN means non-codepoint - // Support: Firefox<24 - // Workaround erroneous numeric interpretation of +"0x" - return high !== high || escapedWhitespace ? - escaped : - high < 0 ? - // BMP codepoint - String.fromCharCode( high + 0x10000 ) : - // Supplemental Plane codepoint (surrogate pair) - String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + // CSS escapes + // https://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + + "?|\\\\([^\\r\\n\\f])", "g" ), + funescape = function( escape, nonHex ) { + var high = "0x" + escape.slice( 1 ) - 0x10000; + + if ( nonHex ) { + + // Strip the backslash prefix from a non-hex escape sequence + return nonHex; + } + + // Replace a hexadecimal escape sequence with the encoded Unicode code point + // Support: IE <=11+ + // For values outside the Basic Multilingual Plane (BMP), manually construct a + // surrogate pair + return high < 0 ? + String.fromCharCode( high + 0x10000 ) : + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); }, - // Used for iframes - // See setDocument() + // Used for iframes; see `setDocument`. + // Support: IE 9 - 11+, Edge 12 - 18+ // Removing the function wrapper causes a "Permission Denied" - // error in IE + // error in IE/Edge. unloadHandler = function() { setDocument(); - }; + }, + + inDisabledFieldset = addCombinator( + function( elem ) { + return elem.disabled === true && nodeName( elem, "fieldset" ); + }, + { dir: "parentNode", next: "legend" } + ); + +// Support: IE <=9 only +// Accessing document.activeElement can throw unexpectedly +// https://bugs.jquery.com/ticket/13393 +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} // Optimize for push.apply( _, NodeList ) try { push.apply( - (arr = slice.call( preferredDoc.childNodes )), + ( arr = slice.call( preferredDoc.childNodes ) ), preferredDoc.childNodes ); - // Support: Android<4.0 + + // Support: Android <=4.0 // Detect silently failing push.apply + // eslint-disable-next-line no-unused-expressions arr[ preferredDoc.childNodes.length ].nodeType; } catch ( e ) { - push = { apply: arr.length ? - - // Leverage slice if possible - function( target, els ) { - push_native.apply( target, slice.call(els) ); - } : - - // Support: IE<9 - // Otherwise append directly - function( target, els ) { - var j = target.length, - i = 0; - // Can't trust NodeList.length - while ( (target[j++] = els[i++]) ) {} - target.length = j - 1; + push = { + apply: function( target, els ) { + pushNative.apply( target, slice.call( els ) ); + }, + call: function( target ) { + pushNative.apply( target, slice.call( arguments, 1 ) ); } }; } -function Sizzle( selector, context, results, seed ) { - var match, elem, m, nodeType, - // QSA vars - i, groups, old, nid, newContext, newSelector; +function find( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; - context = context || document; results = results || []; - nodeType = context.nodeType; + // Return early from calls with invalid selector or context if ( typeof selector !== "string" || !selector || nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { return results; } - if ( !seed && documentIsHTML ) { + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + setDocument( context ); + context = context || document; - // Try to shortcut find operations when possible (e.g., not under DocumentFragment) - if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { - // Speed-up: Sizzle("#ID") - if ( (m = match[1]) ) { - if ( nodeType === 9 ) { - elem = context.getElementById( m ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document (jQuery #6963) - if ( elem && elem.parentNode ) { - // Handle the case where IE, Opera, and Webkit return items - // by name instead of ID - if ( elem.id === m ) { - results.push( elem ); + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { + + // ID selector + if ( ( m = match[ 1 ] ) ) { + + // Document context + if ( nodeType === 9 ) { + if ( ( elem = context.getElementById( m ) ) ) { + + // Support: IE 9 only + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + push.call( results, elem ); + return results; + } + } else { return results; } + + // Element context } else { - return results; - } - } else { - // Context is not a document - if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && - contains( context, elem ) && elem.id === m ) { - results.push( elem ); - return results; + + // Support: IE 9 only + // getElementById can match elements by name instead of ID + if ( newContext && ( elem = newContext.getElementById( m ) ) && + find.contains( context, elem ) && + elem.id === m ) { + + push.call( results, elem ); + return results; + } } + + // Type selector + } else if ( match[ 2 ] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( ( m = match[ 3 ] ) && context.getElementsByClassName ) { + push.apply( results, context.getElementsByClassName( m ) ); + return results; } - - // Speed-up: Sizzle("TAG") - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Speed-up: Sizzle(".CLASS") - } else if ( (m = match[3]) && support.getElementsByClassName ) { - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // QSA path - if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - nid = old = expando; - newContext = context; - newSelector = nodeType !== 1 && selector; - - // qSA works strangely on Element-rooted queries - // We can work around this by specifying an extra ID on the root - // and working up from there (Thanks to Andrew Dupont for the technique) - // IE 8 doesn't work on object elements - if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { - groups = tokenize( selector ); - - if ( (old = context.getAttribute("id")) ) { - nid = old.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", nid ); - } - nid = "[id='" + nid + "'] "; - - i = groups.length; - while ( i-- ) { - groups[i] = nid + toSelector( groups[i] ); - } - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; - newSelector = groups.join(","); } - if ( newSelector ) { + // Take advantage of querySelectorAll + if ( !nonnativeSelectorCache[ selector + " " ] && + ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) ) { + + newSelector = selector; + newContext = context; + + // qSA considers elements outside a scoping root when evaluating child or + // descendant combinators, which is not what we want. + // In such cases, we work around the behavior by prefixing every selector in the + // list with an ID selector referencing the scope context. + // The technique has to be used as well when a leading combinator is used + // as such selectors are not recognized by querySelectorAll. + // Thanks to Andrew Dupont for this technique. + if ( nodeType === 1 && + ( rdescend.test( selector ) || rleadingCombinator.test( selector ) ) ) { + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + + // We can use :scope instead of the ID hack if the browser + // supports it & if we're not changing the context. + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when + // strict-comparing two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( newContext != context || !support.scope ) { + + // Capture the context ID, setting it first if necessary + if ( ( nid = context.getAttribute( "id" ) ) ) { + nid = jQuery.escapeSelector( nid ); + } else { + context.setAttribute( "id", ( nid = expando ) ); + } + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + + toSelector( groups[ i ] ); + } + newSelector = groups.join( "," ); + } + try { push.apply( results, newContext.querySelectorAll( newSelector ) ); return results; - } catch(qsaError) { + } catch ( qsaError ) { + nonnativeSelectorCache( selector, true ); } finally { - if ( !old ) { - context.removeAttribute("id"); + if ( nid === expando ) { + context.removeAttribute( "id" ); } } } @@ -852,12 +936,12 @@ function Sizzle( selector, context, results, seed ) { } // All others - return select( selector.replace( rtrim, "$1" ), context, results, seed ); + return select( selector.replace( rtrimCSS, "$1" ), context, results, seed ); } /** * Create key-value caches of limited size - * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * @returns {function(string, object)} Returns the Object data after storing it on itself with * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) * deleting the oldest entry */ @@ -865,18 +949,21 @@ function createCache() { var keys = []; function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + + // Use (key + " ") to avoid collision with native prototype properties + // (see https://github.com/jquery/sizzle/issues/157) if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries delete cache[ keys.shift() ]; } - return (cache[ key + " " ] = value); + return ( cache[ key + " " ] = value ); } return cache; } /** - * Mark a function for special use by Sizzle + * Mark a function for special use by jQuery selector module * @param {Function} fn The function to mark */ function markFunction( fn ) { @@ -886,76 +973,34 @@ function markFunction( fn ) { /** * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result + * @param {Function} fn Passed the created element and returns a boolean result */ function assert( fn ) { - var div = document.createElement("div"); + var el = document.createElement( "fieldset" ); try { - return !!fn( div ); - } catch (e) { + return !!fn( el ); + } catch ( e ) { return false; } finally { + // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); + if ( el.parentNode ) { + el.parentNode.removeChild( el ); } + // release memory in IE - div = null; + el = null; } } -/** - * Adds the same handler for all of the specified attrs - * @param {String} attrs Pipe-separated list of attributes - * @param {Function} handler The method that will be applied - */ -function addHandle( attrs, handler ) { - var arr = attrs.split("|"), - i = attrs.length; - - while ( i-- ) { - Expr.attrHandle[ arr[i] ] = handler; - } -} - -/** - * Checks document order of two siblings - * @param {Element} a - * @param {Element} b - * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b - */ -function siblingCheck( a, b ) { - var cur = b && a, - diff = cur && a.nodeType === 1 && b.nodeType === 1 && - ( ~b.sourceIndex || MAX_NEGATIVE ) - - ( ~a.sourceIndex || MAX_NEGATIVE ); - - // Use IE sourceIndex if available on both nodes - if ( diff ) { - return diff; - } - - // Check if b follows a - if ( cur ) { - while ( (cur = cur.nextSibling) ) { - if ( cur === b ) { - return -1; - } - } - } - - return a ? 1 : -1; -} - /** * Returns a function to use in pseudos for input types * @param {String} type */ function createInputPseudo( type ) { return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === type; + return nodeName( elem, "input" ) && elem.type === type; }; } @@ -965,8 +1010,63 @@ function createInputPseudo( type ) { */ function createButtonPseudo( type ) { return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; + return ( nodeName( elem, "input" ) || nodeName( elem, "button" ) ) && + elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11+ + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + elem.isDisabled !== !disabled && + inDisabledFieldset( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; }; } @@ -975,25 +1075,25 @@ function createButtonPseudo( type ) { * @param {Function} fn */ function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { + return markFunction( function( argument ) { argument = +argument; - return markFunction(function( seed, matches ) { + return markFunction( function( seed, matches ) { var j, matchIndexes = fn( [], seed.length, argument ), i = matchIndexes.length; // Match elements found at the specified indexes while ( i-- ) { - if ( seed[ (j = matchIndexes[i]) ] ) { - seed[j] = !(matches[j] = seed[j]); + if ( seed[ ( j = matchIndexes[ i ] ) ] ) { + seed[ j ] = !( matches[ j ] = seed[ j ] ); } } - }); - }); + } ); + } ); } /** - * Checks a node for validity as a Sizzle context + * Checks a node for validity as a jQuery selector context * @param {Element|Object=} context * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value */ @@ -1001,154 +1101,163 @@ function testContext( context ) { return context && typeof context.getElementsByTagName !== "undefined" && context; } -// Expose support vars for convenience -support = Sizzle.support = {}; - -/** - * Detects XML nodes - * @param {Element|Object} elem An element or a document - * @returns {Boolean} True iff elem is a non-HTML XML node - */ -isXML = Sizzle.isXML = function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = elem && (elem.ownerDocument || elem).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; -}; - /** * Sets document-related variables once based on the current document - * @param {Element|Object} [doc] An element or document object to use to set the document + * @param {Element|Object} [node] An element or document object to use to set the document * @returns {Object} Returns the current document */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, parent, +function setDocument( node ) { + var subWindow, doc = node ? node.ownerDocument || node : preferredDoc; - // If no document and documentElement is available, return - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + // Return early if doc is invalid or already selected + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { return document; } - // Set our document + // Update global variables document = doc; - docElem = doc.documentElement; - parent = doc.defaultView; + documentElement = document.documentElement; + documentIsHTML = !jQuery.isXMLDoc( document ); - // Support: IE>8 - // If iframe document is assigned to "document" variable and if iframe has been reloaded, - // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 - // IE6-8 do not support the defaultView property so parent will be undefined - if ( parent && parent !== parent.top ) { - // IE11 does not have attachEvent, so all must suffer - if ( parent.addEventListener ) { - parent.addEventListener( "unload", unloadHandler, false ); - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", unloadHandler ); - } + // Support: iOS 7 only, IE 9 - 11+ + // Older browsers didn't support unprefixed `matches`. + matches = documentElement.matches || + documentElement.webkitMatchesSelector || + documentElement.msMatchesSelector; + + // Support: IE 9 - 11+, Edge 12 - 18+ + // Accessing iframe documents after unload throws "permission denied" errors + // (see trac-13936). + // Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`, + // all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well. + if ( documentElement.msMatchesSelector && + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + preferredDoc != document && + ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { + + // Support: IE 9 - 11+, Edge 12 - 18+ + subWindow.addEventListener( "unload", unloadHandler ); } - /* Support tests - ---------------------------------------------------------------------- */ - documentIsHTML = !isXML( doc ); - - /* Attributes - ---------------------------------------------------------------------- */ - - // Support: IE<8 - // Verify that getAttribute really returns attributes and not properties - // (excepting IE8 booleans) - support.attributes = assert(function( div ) { - div.className = "i"; - return !div.getAttribute("className"); - }); - - /* getElement(s)By* - ---------------------------------------------------------------------- */ - - // Check if getElementsByTagName("*") returns only elements - support.getElementsByTagName = assert(function( div ) { - div.appendChild( doc.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); - - // Support: IE<10 + // Support: IE <10 // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, + // The broken getElementById methods don't pick up programmatically-set names, // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !doc.getElementsByName || !doc.getElementsByName( expando ).length; - }); + support.getById = assert( function( el ) { + documentElement.appendChild( el ).id = jQuery.expando; + return !document.getElementsByName || + !document.getElementsByName( jQuery.expando ).length; + } ); - // ID find and filter + // Support: IE 9 only + // Check to see if it's possible to do matchesSelector + // on a disconnected node. + support.disconnectedMatch = assert( function( el ) { + return matches.call( el, "*" ); + } ); + + // Support: IE 9 - 11+, Edge 12 - 18+ + // IE/Edge don't support the :scope pseudo-class. + support.scope = assert( function() { + return document.querySelectorAll( ":scope" ); + } ); + + // Support: Chrome 105 - 111 only, Safari 15.4 - 16.3 only + // Make sure the `:has()` argument is parsed unforgivingly. + // We include `*` in the test to detect buggy implementations that are + // _selectively_ forgiving (specifically when the list includes at least + // one valid selector). + // Note that we treat complete lack of support for `:has()` as if it were + // spec-compliant support, which is fine because use of `:has()` in such + // environments will fail in the qSA path and fall back to jQuery traversal + // anyway. + support.cssHas = assert( function() { + try { + document.querySelector( ":has(*,:jqfake)" ); + return false; + } catch ( e ) { + return true; + } + } ); + + // ID filter and find if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { + Expr.filter.ID = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute( "id" ) === attrId; + }; + }; + Expr.find.ID = function( id, context ) { if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var m = context.getElementById( id ); - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - return m && m.parentNode ? [ m ] : []; + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; } }; - Expr.filter["ID"] = function( id ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - return elem.getAttribute("id") === attrId; - }; - }; } else { - // Support: IE6/7 - // getElementById is not reliable as a find shortcut - delete Expr.find["ID"]; - - Expr.filter["ID"] = function( id ) { + Expr.filter.ID = function( id ) { var attrId = id.replace( runescape, funescape ); return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode( "id" ); return node && node.value === attrId; }; }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find.ID = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( ( elem = elems[ i++ ] ) ) { + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; } // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - function( tag, context ) { - if ( typeof context.getElementsByTagName !== "undefined" ) { - return context.getElementsByTagName( tag ); + Expr.find.TAG = function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); - // DocumentFragment nodes don't have gEBTN - } else if ( support.qsa ) { - return context.querySelectorAll( tag ); - } - } : - - function( tag, context ) { - var elem, - tmp = [], - i = 0, - // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too - results = context.getElementsByTagName( tag ); - - // Filter out possible comments - if ( tag === "*" ) { - while ( (elem = results[i++]) ) { - if ( elem.nodeType === 1 ) { - tmp.push( elem ); - } - } - - return tmp; - } - return results; - }; + // DocumentFragment nodes don't have gEBTN + } else { + return context.querySelectorAll( tag ); + } + }; // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( documentIsHTML ) { + Expr.find.CLASS = function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { return context.getElementsByClassName( className ); } }; @@ -1158,143 +1267,94 @@ setDocument = Sizzle.setDocument = function( node ) { // QSA and matchesSelector support - // matchesSelector(:active) reports false when true (IE9/Opera 11.5) - rbuggyMatches = []; - - // qSa(:focus) reports false when true (Chrome 21) - // We allow this because of a bug in IE8/9 that throws an error - // whenever `document.activeElement` is accessed on an iframe - // So, we allow :focus to pass through QSA all the time to avoid the IE error - // See http://bugs.jquery.com/ticket/13378 rbuggyQSA = []; - if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { - // Build QSA regex - // Regex strategy adopted from Diego Perini - assert(function( div ) { - // Select is set to empty string on purpose - // This is to test IE's treatment of not explicitly - // setting a boolean content attribute, - // since its presence should be enough - // http://bugs.jquery.com/ticket/12359 - docElem.appendChild( div ).innerHTML = "
        " + - ""; + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert( function( el ) { - // Support: IE8, Opera 11-12.16 - // Nothing should be selected when empty strings follow ^= or $= or *= - // The test attribute must be unknown in Opera but "safe" for WinRT - // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section - if ( div.querySelectorAll("[msallowcapture^='']").length ) { - rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); - } + var input; - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } + documentElement.appendChild( el ).innerHTML = + "" + + ""; - // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ - if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push("~="); - } + // Support: iOS <=7 - 8 only + // Boolean attributes and "value" are not treated correctly in some XML documents + if ( !el.querySelectorAll( "[selected]" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } - // Webkit/Opera - :checked should return selected option elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":checked").length ) { - rbuggyQSA.push(":checked"); - } + // Support: iOS <=7 - 8 only + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push( "~=" ); + } - // Support: Safari 8+, iOS 8+ - // https://bugs.webkit.org/show_bug.cgi?id=136851 - // In-page `selector#id sibing-combinator selector` fails - if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { - rbuggyQSA.push(".#.+[+~]"); - } - }); + // Support: iOS 8 only + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push( ".#.+[+~]" ); + } - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = doc.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); + // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ + // In some of the document kinds, these selectors wouldn't work natively. + // This is probably OK but for backwards compatibility we want to maintain + // handling them through jQuery traversal in jQuery 3.x. + if ( !el.querySelectorAll( ":checked" ).length ) { + rbuggyQSA.push( ":checked" ); + } - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + input = document.createElement( "input" ); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); - // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) - // IE8 throws error here and will not see later tests - if ( !div.querySelectorAll(":enabled").length ) { - rbuggyQSA.push( ":enabled", ":disabled" ); - } + // Support: IE 9 - 11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + // Support: Chrome <=105+, Firefox <=104+, Safari <=15.4+ + // In some of the document kinds, these selectors wouldn't work natively. + // This is probably OK but for backwards compatibility we want to maintain + // handling them through jQuery traversal in jQuery 3.x. + documentElement.appendChild( el ).disabled = true; + if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); + // Support: IE 11+, Edge 15 - 18+ + // IE 11/Edge don't find elements on a `[name='']` query in some cases. + // Adding a temporary attribute to the document before the selection works + // around the issue. + // Interestingly, IE 10 & older don't seem to have the issue. + input = document.createElement( "input" ); + input.setAttribute( "name", "" ); + el.appendChild( input ); + if ( !el.querySelectorAll( "[name='']" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + + whitespace + "*(?:''|\"\")" ); + } + } ); + + if ( !support.cssHas ) { + + // Support: Chrome 105 - 110+, Safari 15.4 - 16.3+ + // Our regular `try-catch` mechanism fails to detect natively-unsupported + // pseudo-classes inside `:has()` (such as `:has(:contains("Foo"))`) + // in browsers that parse the `:has()` argument as a forgiving selector list. + // https://drafts.csswg.org/selectors/#relational now requires the argument + // to be parsed unforgivingly, but browsers have not yet fully adjusted. + rbuggyQSA.push( ":has" ); } - if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || - docElem.webkitMatchesSelector || - docElem.mozMatchesSelector || - docElem.oMatchesSelector || - docElem.msMatchesSelector) )) ) { - - assert(function( div ) { - // Check to see if it's possible to do matchesSelector - // on a disconnected node (IE 9) - support.disconnectedMatch = matches.call( div, "div" ); - - // This should fail with an exception - // Gecko does not error, returns false instead - matches.call( div, "[s!='']:x" ); - rbuggyMatches.push( "!=", pseudos ); - }); - } - - rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); - rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); - - /* Contains - ---------------------------------------------------------------------- */ - hasCompare = rnative.test( docElem.compareDocumentPosition ); - - // Element contains another - // Purposefully does not implement inclusive descendent - // As in, an element does not contain itself - contains = hasCompare || rnative.test( docElem.contains ) ? - function( a, b ) { - var adown = a.nodeType === 9 ? a.documentElement : a, - bup = b && b.parentNode; - return a === bup || !!( bup && bup.nodeType === 1 && ( - adown.contains ? - adown.contains( bup ) : - a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 - )); - } : - function( a, b ) { - if ( b ) { - while ( (b = b.parentNode) ) { - if ( b === a ) { - return true; - } - } - } - return false; - }; + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); /* Sorting ---------------------------------------------------------------------- */ // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { + sortOrder = function( a, b ) { // Flag for duplicate removal if ( a === b ) { @@ -1309,7 +1369,11 @@ setDocument = Sizzle.setDocument = function( node ) { } // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? a.compareDocumentPosition( b ) : // Otherwise we know they are disconnected @@ -1317,144 +1381,109 @@ setDocument = Sizzle.setDocument = function( node ) { // Disconnected nodes if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { // Choose the first element that is related to our preferred document - if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( a === document || a.ownerDocument == preferredDoc && + find.contains( preferredDoc, a ) ) { return -1; } - if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( b === document || b.ownerDocument == preferredDoc && + find.contains( preferredDoc, b ) ) { return 1; } // Maintain original order return sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : 0; } return compare & 4 ? -1 : 1; - } : - function( a, b ) { - // Exit early if the nodes are identical - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - var cur, - i = 0, - aup = a.parentNode, - bup = b.parentNode, - ap = [ a ], - bp = [ b ]; - - // Parentless nodes are either documents or disconnected - if ( !aup || !bup ) { - return a === doc ? -1 : - b === doc ? 1 : - aup ? -1 : - bup ? 1 : - sortInput ? - ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : - 0; - - // If the nodes are siblings, we can do a quick check - } else if ( aup === bup ) { - return siblingCheck( a, b ); - } - - // Otherwise we need full lists of their ancestors for comparison - cur = a; - while ( (cur = cur.parentNode) ) { - ap.unshift( cur ); - } - cur = b; - while ( (cur = cur.parentNode) ) { - bp.unshift( cur ); - } - - // Walk down the tree looking for a discrepancy - while ( ap[i] === bp[i] ) { - i++; - } - - return i ? - // Do a sibling check if the nodes have a common ancestor - siblingCheck( ap[i], bp[i] ) : - - // Otherwise nodes in our document sort first - ap[i] === preferredDoc ? -1 : - bp[i] === preferredDoc ? 1 : - 0; }; - return doc; + return document; +} + +find.matches = function( expr, elements ) { + return find( expr, null, null, elements ); }; -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; +find.matchesSelector = function( elem, expr ) { + setDocument( elem ); -Sizzle.matchesSelector = function( elem, expr ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - // Make sure that attribute selectors are quoted - expr = expr.replace( rattributeQuotes, "='$1']" ); - - if ( support.matchesSelector && documentIsHTML && - ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && - ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + if ( documentIsHTML && + !nonnativeSelectorCache[ expr + " " ] && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { try { var ret = matches.call( elem, expr ); // IE 9's matchesSelector returns false on disconnected nodes if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document // fragment in IE 9 elem.document && elem.document.nodeType !== 11 ) { return ret; } - } catch (e) {} + } catch ( e ) { + nonnativeSelectorCache( expr, true ); + } } - return Sizzle( expr, document, null, [ elem ] ).length > 0; + return find( expr, document, null, [ elem ] ).length > 0; }; -Sizzle.contains = function( context, elem ) { +find.contains = function( context, elem ) { + // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( context.ownerDocument || context ) != document ) { setDocument( context ); } - return contains( context, elem ); + return jQuery.contains( context, elem ); }; -Sizzle.attr = function( elem, name ) { + +find.attr = function( elem, name ) { + // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( elem.ownerDocument || elem ) != document ) { setDocument( elem ); } var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #13807) + + // Don't get fooled by Object.prototype properties (see trac-13807) val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? fn( elem, name, !documentIsHTML ) : undefined; - return val !== undefined ? - val : - support.attributes || !documentIsHTML ? - elem.getAttribute( name ) : - (val = elem.getAttributeNode(name)) && val.specified ? - val.value : - null; + if ( val !== undefined ) { + return val; + } + + return elem.getAttribute( name ); }; -Sizzle.error = function( msg ) { +find.error = function( msg ) { throw new Error( "Syntax error, unrecognized expression: " + msg ); }; @@ -1462,25 +1491,29 @@ Sizzle.error = function( msg ) { * Document sorting and removing duplicates * @param {ArrayLike} results */ -Sizzle.uniqueSort = function( results ) { +jQuery.uniqueSort = function( results ) { var elem, duplicates = [], j = 0, i = 0; // Unless we *know* we can detect duplicates, assume their presence - hasDuplicate = !support.detectDuplicates; - sortInput = !support.sortStable && results.slice( 0 ); - results.sort( sortOrder ); + // + // Support: Android <=4.0+ + // Testing for detecting duplicates is unpredictable so instead assume we can't + // depend on duplicate detection in all browsers without a stable sort. + hasDuplicate = !support.sortStable; + sortInput = !support.sortStable && slice.call( results, 0 ); + sort.call( results, sortOrder ); if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { + while ( ( elem = results[ i++ ] ) ) { if ( elem === results[ i ] ) { j = duplicates.push( i ); } } while ( j-- ) { - results.splice( duplicates[ j ], 1 ); + splice.call( results, duplicates[ j ], 1 ); } } @@ -1491,42 +1524,11 @@ Sizzle.uniqueSort = function( results ) { return results; }; -/** - * Utility function for retrieving the text value of an array of DOM nodes - * @param {Array|Element} elem - */ -getText = Sizzle.getText = function( elem ) { - var node, - ret = "", - i = 0, - nodeType = elem.nodeType; - - if ( !nodeType ) { - // If no nodeType, this is expected to be an array - while ( (node = elem[i++]) ) { - // Do not traverse comment nodes - ret += getText( node ); - } - } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { - // Use textContent for elements - // innerText usage removed for consistency of new lines (jQuery #11153) - if ( typeof elem.textContent === "string" ) { - return elem.textContent; - } else { - // Traverse its children - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - ret += getText( elem ); - } - } - } else if ( nodeType === 3 || nodeType === 4 ) { - return elem.nodeValue; - } - // Do not include comment or processing instruction nodes - - return ret; +jQuery.fn.uniqueSort = function() { + return this.pushStack( jQuery.uniqueSort( slice.apply( this ) ) ); }; -Expr = Sizzle.selectors = { +Expr = jQuery.expr = { // Can be adjusted by the user cacheLength: 50, @@ -1547,20 +1549,22 @@ Expr = Sizzle.selectors = { }, preFilter: { - "ATTR": function( match ) { - match[1] = match[1].replace( runescape, funescape ); + ATTR: function( match ) { + match[ 1 ] = match[ 1 ].replace( runescape, funescape ); // Move the given value to match[3] whether quoted or unquoted - match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + match[ 3 ] = ( match[ 3 ] || match[ 4 ] || match[ 5 ] || "" ) + .replace( runescape, funescape ); - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; + if ( match[ 2 ] === "~=" ) { + match[ 3 ] = " " + match[ 3 ] + " "; } return match.slice( 0, 4 ); }, - "CHILD": function( match ) { + CHILD: function( match ) { + /* matches from matchExpr["CHILD"] 1 type (only|nth|...) 2 what (child|of-type) @@ -1571,49 +1575,55 @@ Expr = Sizzle.selectors = { 7 sign of y-component 8 y of y-component */ - match[1] = match[1].toLowerCase(); + match[ 1 ] = match[ 1 ].toLowerCase(); + + if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { - if ( match[1].slice( 0, 3 ) === "nth" ) { // nth-* requires argument - if ( !match[3] ) { - Sizzle.error( match[0] ); + if ( !match[ 3 ] ) { + find.error( match[ 0 ] ); } // numeric x and y parameters for Expr.filter.CHILD // remember that false/true cast respectively to 0/1 - match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); - match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + match[ 4 ] = +( match[ 4 ] ? + match[ 5 ] + ( match[ 6 ] || 1 ) : + 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) + ); + match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); + } else if ( match[ 3 ] ) { + find.error( match[ 0 ] ); } return match; }, - "PSEUDO": function( match ) { + PSEUDO: function( match ) { var excess, - unquoted = !match[6] && match[2]; + unquoted = !match[ 6 ] && match[ 2 ]; - if ( matchExpr["CHILD"].test( match[0] ) ) { + if ( matchExpr.CHILD.test( match[ 0 ] ) ) { return null; } // Accept quoted arguments as-is - if ( match[3] ) { - match[2] = match[4] || match[5] || ""; + if ( match[ 3 ] ) { + match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; // Strip excess characters from unquoted arguments } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) - (excess = tokenize( unquoted, true )) && + ( excess = tokenize( unquoted, true ) ) && + // advance to the next closing parenthesis - (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { // excess is a negative index - match[0] = match[0].slice( 0, excess ); - match[2] = unquoted.slice( 0, excess ); + match[ 0 ] = match[ 0 ].slice( 0, excess ); + match[ 2 ] = unquoted.slice( 0, excess ); } // Return only captures needed by the pseudo filter method (type and argument) @@ -1623,28 +1633,36 @@ Expr = Sizzle.selectors = { filter: { - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + TAG: function( nodeNameSelector ) { + var expectedNodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); return nodeNameSelector === "*" ? - function() { return true; } : + function() { + return true; + } : function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + return nodeName( elem, expectedNodeName ); }; }, - "CLASS": function( className ) { + CLASS: function( className ) { var pattern = classCache[ className + " " ]; return pattern || - (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + ( pattern = new RegExp( "(^|" + whitespace + ")" + className + + "(" + whitespace + "|$)" ) ) && classCache( className, function( elem ) { - return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); - }); + return pattern.test( + typeof elem.className === "string" && elem.className || + typeof elem.getAttribute !== "undefined" && + elem.getAttribute( "class" ) || + "" + ); + } ); }, - "ATTR": function( name, operator, check ) { + ATTR: function( name, operator, check ) { return function( elem ) { - var result = Sizzle.attr( elem, name ); + var result = find.attr( elem, name ); if ( result == null ) { return operator === "!="; @@ -1655,18 +1673,34 @@ Expr = Sizzle.selectors = { result += ""; - return operator === "=" ? result === check : - operator === "!=" ? result !== check : - operator === "^=" ? check && result.indexOf( check ) === 0 : - operator === "*=" ? check && result.indexOf( check ) > -1 : - operator === "$=" ? check && result.slice( -check.length ) === check : - operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : - operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : - false; + if ( operator === "=" ) { + return result === check; + } + if ( operator === "!=" ) { + return result !== check; + } + if ( operator === "^=" ) { + return check && result.indexOf( check ) === 0; + } + if ( operator === "*=" ) { + return check && result.indexOf( check ) > -1; + } + if ( operator === "$=" ) { + return check && result.slice( -check.length ) === check; + } + if ( operator === "~=" ) { + return ( " " + result.replace( rwhitespace, " " ) + " " ) + .indexOf( check ) > -1; + } + if ( operator === "|=" ) { + return result === check || result.slice( 0, check.length + 1 ) === check + "-"; + } + + return false; }; }, - "CHILD": function( type, what, argument, first, last ) { + CHILD: function( type, what, _argument, first, last ) { var simple = type.slice( 0, 3 ) !== "nth", forward = type.slice( -4 ) !== "last", ofType = what === "of-type"; @@ -1678,12 +1712,13 @@ Expr = Sizzle.selectors = { return !!elem.parentNode; } : - function( elem, context, xml ) { - var cache, outerCache, node, diff, nodeIndex, start, + function( elem, _context, xml ) { + var cache, outerCache, node, nodeIndex, start, dir = simple !== forward ? "nextSibling" : "previousSibling", parent = elem.parentNode, name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType; + useCache = !xml && !ofType, + diff = false; if ( parent ) { @@ -1691,11 +1726,15 @@ Expr = Sizzle.selectors = { if ( simple ) { while ( dir ) { node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + while ( ( node = node[ dir ] ) ) { + if ( ofType ? + nodeName( node, name ) : + node.nodeType === 1 ) { + return false; } } + // Reverse direction for :only-* (if we haven't yet done so) start = dir = type === "only" && !start && "nextSibling"; } @@ -1706,17 +1745,18 @@ Expr = Sizzle.selectors = { // non-xml :nth-child(...) stores cache data on `parent` if ( forward && useCache ) { + // Seek `elem` from a previously-cached index - outerCache = parent[ expando ] || (parent[ expando ] = {}); + outerCache = parent[ expando ] || ( parent[ expando ] = {} ); cache = outerCache[ type ] || []; - nodeIndex = cache[0] === dirruns && cache[1]; - diff = cache[0] === dirruns && cache[2]; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; node = nodeIndex && parent.childNodes[ nodeIndex ]; - while ( (node = ++nodeIndex && node && node[ dir ] || + while ( ( node = ++nodeIndex && node && node[ dir ] || // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { + ( diff = nodeIndex = 0 ) || start.pop() ) ) { // When found, cache indexes on `parent` and break if ( node.nodeType === 1 && ++diff && node === elem ) { @@ -1725,24 +1765,39 @@ Expr = Sizzle.selectors = { } } - // Use previously-cached element index if available - } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { - diff = cache[1]; - - // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) } else { - // Use the same loop as above to seek `elem` from the start - while ( (node = ++nodeIndex && node && node[ dir ] || - (diff = nodeIndex = 0) || start.pop()) ) { - if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { - // Cache the index of each encountered element - if ( useCache ) { - (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; - } + // Use previously-cached element index if available + if ( useCache ) { + outerCache = elem[ expando ] || ( elem[ expando ] = {} ); + cache = outerCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } - if ( node === elem ) { - break; + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + + // Use the same loop as above to seek `elem` from the start + while ( ( node = ++nodeIndex && node && node[ dir ] || + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + if ( ( ofType ? + nodeName( node, name ) : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || + ( node[ expando ] = {} ); + outerCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } } } } @@ -1755,18 +1810,19 @@ Expr = Sizzle.selectors = { }; }, - "PSEUDO": function( pseudo, argument ) { + PSEUDO: function( pseudo, argument ) { + // pseudo-class names are case-insensitive - // http://www.w3.org/TR/selectors/#pseudo-classes + // https://www.w3.org/TR/selectors/#pseudo-classes // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters // Remember that setFilters inherits from pseudos var args, fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || - Sizzle.error( "unsupported pseudo: " + pseudo ); + find.error( "unsupported pseudo: " + pseudo ); // The user may use createPseudo to indicate that // arguments are needed to create the filter function - // just as Sizzle does + // just as jQuery does if ( fn[ expando ] ) { return fn( argument ); } @@ -1775,15 +1831,15 @@ Expr = Sizzle.selectors = { if ( fn.length > 1 ) { args = [ pseudo, pseudo, "", argument ]; return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - markFunction(function( seed, matches ) { + markFunction( function( seed, matches ) { var idx, matched = fn( seed, argument ), i = matched.length; while ( i-- ) { - idx = indexOf( seed, matched[i] ); - seed[ idx ] = !( matches[ idx ] = matched[i] ); + idx = indexOf.call( seed, matched[ i ] ); + seed[ idx ] = !( matches[ idx ] = matched[ i ] ); } - }) : + } ) : function( elem ) { return fn( elem, 0, args ); }; @@ -1794,49 +1850,53 @@ Expr = Sizzle.selectors = { }, pseudos: { + // Potentially complex pseudos - "not": markFunction(function( selector ) { + not: markFunction( function( selector ) { + // Trim the selector passed to compile // to avoid treating leading and trailing // spaces as combinators var input = [], results = [], - matcher = compile( selector.replace( rtrim, "$1" ) ); + matcher = compile( selector.replace( rtrimCSS, "$1" ) ); return matcher[ expando ] ? - markFunction(function( seed, matches, context, xml ) { + markFunction( function( seed, matches, _context, xml ) { var elem, unmatched = matcher( seed, null, xml, [] ), i = seed.length; // Match elements unmatched by `matcher` while ( i-- ) { - if ( (elem = unmatched[i]) ) { - seed[i] = !(matches[i] = elem); + if ( ( elem = unmatched[ i ] ) ) { + seed[ i ] = !( matches[ i ] = elem ); } } - }) : - function( elem, context, xml ) { - input[0] = elem; + } ) : + function( elem, _context, xml ) { + input[ 0 ] = elem; matcher( input, null, xml, results ); - // Don't keep the element (issue #299) - input[0] = null; + + // Don't keep the element + // (see https://github.com/jquery/sizzle/issues/299) + input[ 0 ] = null; return !results.pop(); }; - }), + } ), - "has": markFunction(function( selector ) { + has: markFunction( function( selector ) { return function( elem ) { - return Sizzle( selector, elem ).length > 0; + return find( selector, elem ).length > 0; }; - }), + } ), - "contains": markFunction(function( text ) { + contains: markFunction( function( text ) { text = text.replace( runescape, funescape ); return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + return ( elem.textContent || jQuery.text( elem ) ).indexOf( text ) > -1; }; - }), + } ), // "Whether an element is represented by a :lang() selector // is based solely on the element's language value @@ -1844,62 +1904,65 @@ Expr = Sizzle.selectors = { // or beginning with the identifier C immediately followed by "-". // The matching of C against the element's language value is performed case-insensitively. // The identifier C does not have to be a valid language name." - // http://www.w3.org/TR/selectors/#lang-pseudo - "lang": markFunction( function( lang ) { + // https://www.w3.org/TR/selectors/#lang-pseudo + lang: markFunction( function( lang ) { + // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); + if ( !ridentifier.test( lang || "" ) ) { + find.error( "unsupported lang: " + lang ); } lang = lang.replace( runescape, funescape ).toLowerCase(); return function( elem ) { var elemLang; do { - if ( (elemLang = documentIsHTML ? + if ( ( elemLang = documentIsHTML ? elem.lang : - elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { elemLang = elemLang.toLowerCase(); return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; } - } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); return false; }; - }), + } ), // Miscellaneous - "target": function( elem ) { + target: function( elem ) { var hash = window.location && window.location.hash; return hash && hash.slice( 1 ) === elem.id; }, - "root": function( elem ) { - return elem === docElem; + root: function( elem ) { + return elem === documentElement; }, - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + focus: function( elem ) { + return elem === safeActiveElement() && + document.hasFocus() && + !!( elem.type || elem.href || ~elem.tabIndex ); }, // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, + enabled: createDisabledPseudo( false ), + disabled: createDisabledPseudo( true ), - "disabled": function( elem ) { - return elem.disabled === true; - }, + checked: function( elem ) { - "checked": function( elem ) { // In CSS3, :checked should return both checked and selected elements - // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked - var nodeName = elem.nodeName.toLowerCase(); - return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + // https://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + return ( nodeName( elem, "input" ) && !!elem.checked ) || + ( nodeName( elem, "option" ) && !!elem.selected ); }, - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly + selected: function( elem ) { + + // Support: IE <=11+ + // Accessing the selectedIndex property + // forces the browser to treat the default option as + // selected when in an optgroup. if ( elem.parentNode ) { + // eslint-disable-next-line no-unused-expressions elem.parentNode.selectedIndex; } @@ -1907,8 +1970,9 @@ Expr = Sizzle.selectors = { }, // Contents - "empty": function( elem ) { - // http://www.w3.org/TR/selectors/#empty-pseudo + empty: function( elem ) { + + // https://www.w3.org/TR/selectors/#empty-pseudo // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), // but not by others (comment: 8; processing instruction: 7; etc.) // nodeType < 6 works because attributes (2) do not appear as children @@ -1920,82 +1984,92 @@ Expr = Sizzle.selectors = { return true; }, - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); + parent: function( elem ) { + return !Expr.pseudos.empty( elem ); }, // Element/input types - "header": function( elem ) { + header: function( elem ) { return rheader.test( elem.nodeName ); }, - "input": function( elem ) { + input: function( elem ) { return rinputs.test( elem.nodeName ); }, - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; + button: function( elem ) { + return nodeName( elem, "input" ) && elem.type === "button" || + nodeName( elem, "button" ); }, - "text": function( elem ) { + text: function( elem ) { var attr; - return elem.nodeName.toLowerCase() === "input" && - elem.type === "text" && + return nodeName( elem, "input" ) && elem.type === "text" && - // Support: IE<8 - // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" - ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + // Support: IE <10 only + // New HTML5 attribute values (e.g., "search") appear + // with elem.type === "text" + ( ( attr = elem.getAttribute( "type" ) ) == null || + attr.toLowerCase() === "text" ); }, // Position-in-collection - "first": createPositionalPseudo(function() { + first: createPositionalPseudo( function() { return [ 0 ]; - }), + } ), - "last": createPositionalPseudo(function( matchIndexes, length ) { + last: createPositionalPseudo( function( _matchIndexes, length ) { return [ length - 1 ]; - }), + } ), - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + eq: createPositionalPseudo( function( _matchIndexes, length, argument ) { return [ argument < 0 ? argument + length : argument ]; - }), + } ), - "even": createPositionalPseudo(function( matchIndexes, length ) { + even: createPositionalPseudo( function( matchIndexes, length ) { var i = 0; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; - }), + } ), - "odd": createPositionalPseudo(function( matchIndexes, length ) { + odd: createPositionalPseudo( function( matchIndexes, length ) { var i = 1; for ( ; i < length; i += 2 ) { matchIndexes.push( i ); } return matchIndexes; - }), + } ), + + lt: createPositionalPseudo( function( matchIndexes, length, argument ) { + var i; + + if ( argument < 0 ) { + i = argument + length; + } else if ( argument > length ) { + i = length; + } else { + i = argument; + } - "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { - var i = argument < 0 ? argument + length : argument; for ( ; --i >= 0; ) { matchIndexes.push( i ); } return matchIndexes; - }), + } ), - "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + gt: createPositionalPseudo( function( matchIndexes, length, argument ) { var i = argument < 0 ? argument + length : argument; for ( ; ++i < length; ) { matchIndexes.push( i ); } return matchIndexes; - }) + } ) } }; -Expr.pseudos["nth"] = Expr.pseudos["eq"]; +Expr.pseudos.nth = Expr.pseudos.eq; // Add button/input type pseudos for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { @@ -2010,7 +2084,7 @@ function setFilters() {} setFilters.prototype = Expr.filters = Expr.pseudos; Expr.setFilters = new setFilters(); -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { +function tokenize( selector, parseOnly ) { var matched, match, tokens, type, soFar, groups, preFilters, cached = tokenCache[ selector + " " ]; @@ -2026,37 +2100,39 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) { while ( soFar ) { // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( !matched || ( match = rcomma.exec( soFar ) ) ) { if ( match ) { + // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; + soFar = soFar.slice( match[ 0 ].length ) || soFar; } - groups.push( (tokens = []) ); + groups.push( ( tokens = [] ) ); } matched = false; // Combinators - if ( (match = rcombinators.exec( soFar )) ) { + if ( ( match = rleadingCombinator.exec( soFar ) ) ) { matched = match.shift(); - tokens.push({ + tokens.push( { value: matched, + // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); + type: match[ 0 ].replace( rtrimCSS, " " ) + } ); soFar = soFar.slice( matched.length ); } // Filters for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { + if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || + ( match = preFilters[ type ]( match ) ) ) ) { matched = match.shift(); - tokens.push({ + tokens.push( { value: matched, type: type, matches: match - }); + } ); soFar = soFar.slice( matched.length ); } } @@ -2069,37 +2145,44 @@ tokenize = Sizzle.tokenize = function( selector, parseOnly ) { // Return the length of the invalid excess // if we're just parsing // Otherwise, throw an error or return tokens - return parseOnly ? - soFar.length : - soFar ? - Sizzle.error( selector ) : - // Cache the tokens - tokenCache( selector, groups ).slice( 0 ); -}; + if ( parseOnly ) { + return soFar.length; + } + + return soFar ? + find.error( selector ) : + + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} function toSelector( tokens ) { var i = 0, len = tokens.length, selector = ""; for ( ; i < len; i++ ) { - selector += tokens[i].value; + selector += tokens[ i ].value; } return selector; } function addCombinator( matcher, combinator, base ) { var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", doneName = done++; return combinator.first ? + // Check against closest ancestor/preceding element function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { + while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { return matcher( elem, context, xml ); } } + return false; } : // Check against all ancestor/preceding elements @@ -2107,9 +2190,9 @@ function addCombinator( matcher, combinator, base ) { var oldCache, outerCache, newCache = [ dirruns, doneName ]; - // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching if ( xml ) { - while ( (elem = elem[ dir ]) ) { + while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { if ( matcher( elem, context, xml ) ) { return true; @@ -2117,26 +2200,31 @@ function addCombinator( matcher, combinator, base ) { } } } else { - while ( (elem = elem[ dir ]) ) { + while ( ( elem = elem[ dir ] ) ) { if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - if ( (oldCache = outerCache[ dir ]) && + outerCache = elem[ expando ] || ( elem[ expando ] = {} ); + + if ( skip && nodeName( elem, skip ) ) { + elem = elem[ dir ] || elem; + } else if ( ( oldCache = outerCache[ key ] ) && oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); + return ( newCache[ 2 ] = oldCache[ 2 ] ); } else { + // Reuse newcache so results back-propagate to previous elements - outerCache[ dir ] = newCache; + outerCache[ key ] = newCache; // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { return true; } } } } } + return false; }; } @@ -2145,20 +2233,20 @@ function elementMatcher( matchers ) { function( elem, context, xml ) { var i = matchers.length; while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { + if ( !matchers[ i ]( elem, context, xml ) ) { return false; } } return true; } : - matchers[0]; + matchers[ 0 ]; } function multipleContexts( selector, contexts, results ) { var i = 0, len = contexts.length; for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); + find( selector, contexts[ i ], results ); } return results; } @@ -2171,7 +2259,7 @@ function condense( unmatched, map, filter, context, xml ) { mapped = map != null; for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { + if ( ( elem = unmatched[ i ] ) ) { if ( !filter || filter( elem, context, xml ) ) { newUnmatched.push( elem ); if ( mapped ) { @@ -2191,34 +2279,38 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS if ( postFinder && !postFinder[ expando ] ) { postFinder = setMatcher( postFinder, postSelector ); } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, + return markFunction( function( seed, results, context, xml ) { + var temp, i, elem, matcherOut, preMap = [], postMap = [], preexisting = results.length, // Get initial elements from seed or context - elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + elems = seed || + multipleContexts( selector || "*", + context.nodeType ? [ context ] : context, [] ), // Prefilter to get matcher input, preserving a map for seed-results synchronization matcherIn = preFilter && ( seed || !selector ) ? condense( elems, preMap, preFilter, context, xml ) : - elems, + elems; - matcherOut = matcher ? - // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, - postFinder || ( seed ? preFilter : preexisting || postFilter ) ? - - // ...intermediate processing is necessary - [] : - - // ...otherwise use results directly - results : - matcherIn; - - // Find primary matches if ( matcher ) { + + // If we have a postFinder, or filtered seed, or non-seed postFilter + // or preexisting results, + matcherOut = postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results; + + // Find primary matches matcher( matcherIn, matcherOut, context, xml ); + } else { + matcherOut = matcherIn; } // Apply postFilter @@ -2229,8 +2321,8 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS // Un-match failing elements by moving them back to matcherIn i = temp.length; while ( i-- ) { - if ( (elem = temp[i]) ) { - matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + if ( ( elem = temp[ i ] ) ) { + matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); } } } @@ -2238,25 +2330,27 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS if ( seed ) { if ( postFinder || preFilter ) { if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts temp = []; i = matcherOut.length; while ( i-- ) { - if ( (elem = matcherOut[i]) ) { + if ( ( elem = matcherOut[ i ] ) ) { + // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); + temp.push( ( matcherIn[ i ] = elem ) ); } } - postFinder( null, (matcherOut = []), temp, xml ); + postFinder( null, ( matcherOut = [] ), temp, xml ); } // Move matched elements from seed to results to keep them synchronized i = matcherOut.length; while ( i-- ) { - if ( (elem = matcherOut[i]) && - (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + if ( ( elem = matcherOut[ i ] ) && + ( temp = postFinder ? indexOf.call( seed, elem ) : preMap[ i ] ) > -1 ) { - seed[temp] = !(results[temp] = elem); + seed[ temp ] = !( results[ temp ] = elem ); } } } @@ -2274,14 +2368,14 @@ function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postS push.apply( results, matcherOut ); } } - }); + } ); } function matcherFromTokens( tokens ) { var checkContext, matcher, j, len = tokens.length, - leadingRelative = Expr.relative[ tokens[0].type ], - implicitRelative = leadingRelative || Expr.relative[" "], + leadingRelative = Expr.relative[ tokens[ 0 ].type ], + implicitRelative = leadingRelative || Expr.relative[ " " ], i = leadingRelative ? 1 : 0, // The foundational matcher ensures that elements are reachable from top-level context(s) @@ -2289,42 +2383,52 @@ function matcherFromTokens( tokens ) { return elem === checkContext; }, implicitRelative, true ), matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; + return indexOf.call( checkContext, elem ) > -1; }, implicitRelative, true ), matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + var ret = ( !leadingRelative && ( xml || context != outermostContext ) ) || ( + ( checkContext = context ).nodeType ? matchContext( elem, context, xml ) : matchAnyContext( elem, context, xml ) ); - // Avoid hanging onto element (issue #299) + + // Avoid hanging onto element + // (see https://github.com/jquery/sizzle/issues/299) checkContext = null; return ret; } ]; for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; } else { - matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); // Return special upon seeing a positional matcher if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling j = ++i; for ( ; j < len; j++ ) { - if ( Expr.relative[ tokens[j].type ] ) { + if ( Expr.relative[ tokens[ j ].type ] ) { break; } } return setMatcher( i > 1 && elementMatcher( matchers ), i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` - tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) - ).replace( rtrim, "$1" ), + tokens.slice( 0, i - 1 ) + .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) + ).replace( rtrimCSS, "$1" ), matcher, i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), j < len && toSelector( tokens ) ); } @@ -2345,26 +2449,42 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { unmatched = seed && [], setMatched = [], contextBackup = outermostContext, + // We must always have either seed elements or outermost context - elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + elems = seed || byElement && Expr.find.TAG( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher - dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), len = elems.length; if ( outermost ) { - outermostContext = context !== document && context; + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + outermostContext = context == document || context || outermost; } // Add elements passing elementMatchers directly to results - // Keep `i` a string if there are no elements so `matchedCount` will be "00" below - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + // Support: iOS <=7 - 9 only + // Tolerate NodeList properties (IE: "length"; Safari: ) matching + // elements by id. (see trac-14142) + for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { if ( byElement && elem ) { j = 0; - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context, xml ) ) { - results.push( elem ); + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( !context && elem.ownerDocument != document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( ( matcher = elementMatchers[ j++ ] ) ) { + if ( matcher( elem, context || document, xml ) ) { + push.call( results, elem ); break; } } @@ -2375,8 +2495,9 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { // Track unmatched elements for set filters if ( bySet ) { + // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { + if ( ( elem = !matcher && elem ) ) { matchedCount--; } @@ -2387,20 +2508,30 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { } } - // Apply set filters to unmatched elements + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. if ( bySet && i !== matchedCount ) { j = 0; - while ( (matcher = setMatchers[j++]) ) { + while ( ( matcher = setMatchers[ j++ ] ) ) { matcher( unmatched, setMatched, context, xml ); } if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting if ( matchedCount > 0 ) { while ( i-- ) { - if ( !(unmatched[i] || setMatched[i]) ) { - setMatched[i] = pop.call( results ); + if ( !( unmatched[ i ] || setMatched[ i ] ) ) { + setMatched[ i ] = pop.call( results ); } } } @@ -2416,7 +2547,7 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { if ( outermost && !seed && setMatched.length > 0 && ( matchedCount + setMatchers.length ) > 1 ) { - Sizzle.uniqueSort( results ); + jQuery.uniqueSort( results ); } } @@ -2434,20 +2565,21 @@ function matcherFromGroupMatchers( elementMatchers, setMatchers ) { superMatcher; } -compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { +function compile( selector, match /* Internal Use Only */ ) { var i, setMatchers = [], elementMatchers = [], cached = compilerCache[ selector + " " ]; if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element if ( !match ) { match = tokenize( selector ); } i = match.length; while ( i-- ) { - cached = matcherFromTokens( match[i] ); + cached = matcherFromTokens( match[ i ] ); if ( cached[ expando ] ) { setMatchers.push( cached ); } else { @@ -2456,40 +2588,44 @@ compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { } // Cache the compiled function - cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + cached = compilerCache( selector, + matcherFromGroupMatchers( elementMatchers, setMatchers ) ); // Save selector and tokenization cached.selector = selector; } return cached; -}; +} /** - * A low-level selection function that works with Sizzle's compiled + * A low-level selection function that works with jQuery's compiled * selector functions * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.compile + * selector function built with jQuery selector compile * @param {Element} context * @param {Array} [results] * @param {Array} [seed] A set of elements to match against */ -select = Sizzle.select = function( selector, context, results, seed ) { +function select( selector, context, results, seed ) { var i, tokens, token, type, find, compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); + match = !seed && tokenize( ( selector = compiled.selector || selector ) ); results = results || []; - // Try to minimize operations if there is no seed and only one group + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) if ( match.length === 1 ) { - // Take a shortcut and set the context if the root selector is an ID - tokens = match[0] = match[0].slice( 0 ); - if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { + // Reduce context if the leading compound selector is an ID + tokens = match[ 0 ] = match[ 0 ].slice( 0 ); + if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + context = ( Expr.find.ID( + token.matches[ 0 ].replace( runescape, funescape ), + context + ) || [] )[ 0 ]; if ( !context ) { return results; @@ -2502,20 +2638,22 @@ select = Sizzle.select = function( selector, context, results, seed ) { } // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + i = matchExpr.needsContext.test( selector ) ? 0 : tokens.length; while ( i-- ) { - token = tokens[i]; + token = tokens[ i ]; // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { + if ( Expr.relative[ ( type = token.type ) ] ) { break; } - if ( (find = Expr.find[ type ]) ) { + if ( ( find = Expr.find[ type ] ) ) { + // Search, expanding context for leading sibling combinators - if ( (seed = find( - token.matches[0].replace( runescape, funescape ), - rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context - )) ) { + if ( ( seed = find( + token.matches[ 0 ].replace( runescape, funescape ), + rsibling.test( tokens[ 0 ].type ) && + testContext( context.parentNode ) || context + ) ) ) { // If seed is empty or no tokens remain, we can return early tokens.splice( i, 1 ); @@ -2538,126 +2676,112 @@ select = Sizzle.select = function( selector, context, results, seed ) { context, !documentIsHTML, results, - rsibling.test( selector ) && testContext( context.parentNode ) || context + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context ); return results; -}; +} // One-time assignments +// Support: Android <=4.0 - 4.1+ // Sort stability -support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; - -// Support: Chrome 14-35+ -// Always assume duplicates if they aren't passed to the comparison function -support.detectDuplicates = !!hasDuplicate; +support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; // Initialize against the default document setDocument(); -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Support: Android <=4.0 - 4.1+ // Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { +support.sortDetached = assert( function( el ) { + // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 1; -}); + return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; +} ); -// Support: IE<8 -// Prevent attribute/property "interpolation" -// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx -if ( !assert(function( div ) { - div.innerHTML = ""; - return div.firstChild.getAttribute("href") === "#" ; -}) ) { - addHandle( "type|href|height|width", function( elem, name, isXML ) { - if ( !isXML ) { - return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); +jQuery.find = find; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.unique = jQuery.uniqueSort; + +// These have always been private, but they used to be documented as part of +// Sizzle so let's maintain them for now for backwards compatibility purposes. +find.compile = compile; +find.select = select; +find.setDocument = setDocument; +find.tokenize = tokenize; + +find.escape = jQuery.escapeSelector; +find.getText = jQuery.text; +find.isXML = jQuery.isXMLDoc; +find.selectors = jQuery.expr; +find.support = jQuery.support; +find.uniqueSort = jQuery.uniqueSort; + + /* eslint-enable */ + +} )(); + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); } - }); -} + } + return matched; +}; -// Support: IE<9 -// Use defaultValue in place of getAttribute("value") -if ( !support.attributes || !assert(function( div ) { - div.innerHTML = ""; - div.firstChild.setAttribute( "value", "" ); - return div.firstChild.getAttribute( "value" ) === ""; -}) ) { - addHandle( "value", function( elem, name, isXML ) { - if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { - return elem.defaultValue; + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); } - }); -} - -// Support: IE<9 -// Use getAttributeNode to fetch booleans when getAttribute lies -if ( !assert(function( div ) { - return div.getAttribute("disabled") == null; -}) ) { - addHandle( booleans, function( elem, name, isXML ) { - var val; - if ( !isXML ) { - return elem[ name ] === true ? name.toLowerCase() : - (val = elem.getAttributeNode( name )) && val.specified ? - val.value : - null; - } - }); -} - -return Sizzle; - -})( window ); - - - -jQuery.find = Sizzle; -jQuery.expr = Sizzle.selectors; -jQuery.expr[":"] = jQuery.expr.pseudos; -jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; + } + return matched; +}; var rneedsContext = jQuery.expr.match.needsContext; -var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); -var risSimple = /^.[^:#\[\.,]*$/; - // Implement the identical functionality for filter and not function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { + if ( isFunction( qualifier ) ) { return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ return !!qualifier.call( elem, i, elem ) !== not; - }); - + } ); } + // Single element if ( qualifier.nodeType ) { return jQuery.grep( elements, function( elem ) { return ( elem === qualifier ) !== not; - }); - + } ); } - if ( typeof qualifier === "string" ) { - if ( risSimple.test( qualifier ) ) { - return jQuery.filter( qualifier, elements, not ); - } - - qualifier = jQuery.filter( qualifier, elements ); + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); } - return jQuery.grep( elements, function( elem ) { - return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; - }); + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); } jQuery.filter = function( expr, elems, not ) { @@ -2667,44 +2791,44 @@ jQuery.filter = function( expr, elems, not ) { expr = ":not(" + expr + ")"; } - return elems.length === 1 && elem.nodeType === 1 ? - jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : - jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { - return elem.nodeType === 1; - })); + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); }; -jQuery.fn.extend({ +jQuery.fn.extend( { find: function( selector ) { - var i, + var i, ret, len = this.length, - ret = [], self = this; if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter(function() { + return this.pushStack( jQuery( selector ).filter( function() { for ( i = 0; i < len; i++ ) { if ( jQuery.contains( self[ i ], this ) ) { return true; } } - }) ); + } ) ); } + ret = this.pushStack( [] ); + for ( i = 0; i < len; i++ ) { jQuery.find( selector, self[ i ], ret ); } - // Needed because $( selector, context ) becomes $( context ).find( selector ) - ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); - ret.selector = this.selector ? this.selector + " " + selector : selector; - return ret; + return len > 1 ? jQuery.uniqueSort( ret ) : ret; }, filter: function( selector ) { - return this.pushStack( winnow(this, selector || [], false) ); + return this.pushStack( winnow( this, selector || [], false ) ); }, not: function( selector ) { - return this.pushStack( winnow(this, selector || [], true) ); + return this.pushStack( winnow( this, selector || [], true ) ); }, is: function( selector ) { return !!winnow( @@ -2718,7 +2842,7 @@ jQuery.fn.extend({ false ).length; } -}); +} ); // Initialize a jQuery object @@ -2728,11 +2852,12 @@ jQuery.fn.extend({ var rootjQuery, // A simple way to check for HTML strings - // Prioritize #id over to avoid XSS via location.hash (#9521) - // Strict HTML recognition (#11290: must start with <) - rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + // Prioritize #id over to avoid XSS via location.hash (trac-9521) + // Strict HTML recognition (trac-11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, - init = jQuery.fn.init = function( selector, context ) { + init = jQuery.fn.init = function( selector, context, root ) { var match, elem; // HANDLE: $(""), $(null), $(undefined), $(false) @@ -2740,9 +2865,16 @@ var rootjQuery, return this; } + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + // Handle HTML strings if ( typeof selector === "string" ) { - if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check match = [ null, selector, null ]; @@ -2751,25 +2883,26 @@ var rootjQuery, } // Match html or make sure no context is specified for #id - if ( match && (match[1] || !context) ) { + if ( match && ( match[ 1 ] || !context ) ) { // HANDLE: $(html) -> $(array) - if ( match[1] ) { - context = context instanceof jQuery ? context[0] : context; + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; // Option to run scripts is true for back-compat // Intentionally let the error be thrown if parseHTML is not present jQuery.merge( this, jQuery.parseHTML( - match[1], + match[ 1 ], context && context.nodeType ? context.ownerDocument || context : document, true ) ); // HANDLE: $(html, props) - if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { for ( match in context ) { + // Properties of context are called as methods if possible - if ( jQuery.isFunction( this[ match ] ) ) { + if ( isFunction( this[ match ] ) ) { this[ match ]( context[ match ] ); // ...and otherwise set as attributes @@ -2783,24 +2916,20 @@ var rootjQuery, // HANDLE: $(#id) } else { - elem = document.getElementById( match[2] ); + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { - // Support: Blackberry 4.6 - // gEBID returns nodes no longer in the document (#6963) - if ( elem && elem.parentNode ) { // Inject the element directly into the jQuery object + this[ 0 ] = elem; this.length = 1; - this[0] = elem; } - - this.context = document; - this.selector = selector; return this; } // HANDLE: $(expr, $(...)) } else if ( !context || context.jquery ) { - return ( context || rootjQuery ).find( selector ); + return ( context || root ).find( selector ); // HANDLE: $(expr, context) // (which is just equivalent to: $(context).find(expr) @@ -2810,24 +2939,20 @@ var rootjQuery, // HANDLE: $(DOMElement) } else if ( selector.nodeType ) { - this.context = this[0] = selector; + this[ 0 ] = selector; this.length = 1; return this; // HANDLE: $(function) // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof rootjQuery.ready !== "undefined" ? - rootjQuery.ready( selector ) : + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + // Execute immediately if ready is not present selector( jQuery ); } - if ( selector.selector !== undefined ) { - this.selector = selector.selector; - this.context = selector.context; - } - return jQuery.makeArray( selector, this ); }; @@ -2839,6 +2964,7 @@ rootjQuery = jQuery( document ); var rparentsprev = /^(?:parents|prev(?:Until|All))/, + // Methods guaranteed to produce a unique set when starting from a unique set guaranteedUnique = { children: true, @@ -2847,48 +2973,19 @@ var rparentsprev = /^(?:parents|prev(?:Until|All))/, prev: true }; -jQuery.extend({ - dir: function( elem, dir, until ) { - var matched = [], - truncate = until !== undefined; - - while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { - if ( elem.nodeType === 1 ) { - if ( truncate && jQuery( elem ).is( until ) ) { - break; - } - matched.push( elem ); - } - } - return matched; - }, - - sibling: function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; - } -}); - -jQuery.fn.extend({ +jQuery.fn.extend( { has: function( target ) { var targets = jQuery( target, this ), l = targets.length; - return this.filter(function() { + return this.filter( function() { var i = 0; for ( ; i < l; i++ ) { - if ( jQuery.contains( this, targets[i] ) ) { + if ( jQuery.contains( this, targets[ i ] ) ) { return true; } } - }); + } ); }, closest: function( selectors, context ) { @@ -2896,27 +2993,29 @@ jQuery.fn.extend({ i = 0, l = this.length, matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; + targets = typeof selectors !== "string" && jQuery( selectors ); - for ( ; i < l; i++ ) { - for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { - // Always skip document fragments - if ( cur.nodeType < 11 && (pos ? - pos.index(cur) > -1 : + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector(cur, selectors)) ) { + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : - matched.push( cur ); - break; + // Don't pass non-elements to jQuery#find + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } } } } - return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); }, // Determine the position of an element within the set @@ -2942,7 +3041,7 @@ jQuery.fn.extend({ add: function( selector, context ) { return this.pushStack( - jQuery.unique( + jQuery.uniqueSort( jQuery.merge( this.get(), jQuery( selector, context ) ) ) ); @@ -2950,26 +3049,26 @@ jQuery.fn.extend({ addBack: function( selector ) { return this.add( selector == null ? - this.prevObject : this.prevObject.filter(selector) + this.prevObject : this.prevObject.filter( selector ) ); } -}); +} ); function sibling( cur, dir ) { - while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} return cur; } -jQuery.each({ +jQuery.each( { parent: function( elem ) { var parent = elem.parentNode; return parent && parent.nodeType !== 11 ? parent : null; }, parents: function( elem ) { - return jQuery.dir( elem, "parentNode" ); + return dir( elem, "parentNode" ); }, - parentsUntil: function( elem, i, until ) { - return jQuery.dir( elem, "parentNode", until ); + parentsUntil: function( elem, _i, until ) { + return dir( elem, "parentNode", until ); }, next: function( elem ) { return sibling( elem, "nextSibling" ); @@ -2978,25 +3077,42 @@ jQuery.each({ return sibling( elem, "previousSibling" ); }, nextAll: function( elem ) { - return jQuery.dir( elem, "nextSibling" ); + return dir( elem, "nextSibling" ); }, prevAll: function( elem ) { - return jQuery.dir( elem, "previousSibling" ); + return dir( elem, "previousSibling" ); }, - nextUntil: function( elem, i, until ) { - return jQuery.dir( elem, "nextSibling", until ); + nextUntil: function( elem, _i, until ) { + return dir( elem, "nextSibling", until ); }, - prevUntil: function( elem, i, until ) { - return jQuery.dir( elem, "previousSibling", until ); + prevUntil: function( elem, _i, until ) { + return dir( elem, "previousSibling", until ); }, siblings: function( elem ) { - return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + return siblings( ( elem.parentNode || {} ).firstChild, elem ); }, children: function( elem ) { - return jQuery.sibling( elem.firstChild ); + return siblings( elem.firstChild ); }, contents: function( elem ) { - return elem.contentDocument || jQuery.merge( [], elem.childNodes ); + if ( elem.contentDocument != null && + + // Support: IE 11+ + // elements with no `data` attribute has an object + // `contentDocument` with a `null` prototype. + getProto( elem.contentDocument ) ) { + + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); } }, function( name, fn ) { jQuery.fn[ name ] = function( until, selector ) { @@ -3011,9 +3127,10 @@ jQuery.each({ } if ( this.length > 1 ) { + // Remove duplicates if ( !guaranteedUnique[ name ] ) { - jQuery.unique( matched ); + jQuery.uniqueSort( matched ); } // Reverse order for parents* and prev-derivatives @@ -3024,20 +3141,17 @@ jQuery.each({ return this.pushStack( matched ); }; -}); -var rnotwhite = (/\S+/g); +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); -// String to Object options format cache -var optionsCache = {}; - -// Convert String-formatted options into Object-formatted ones and store in cache +// Convert String-formatted options into Object-formatted ones function createOptions( options ) { - var object = optionsCache[ options ] = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { object[ flag ] = true; - }); + } ); return object; } @@ -3068,156 +3182,186 @@ jQuery.Callbacks = function( options ) { // Convert options from String-formatted to Object-formatted if needed // (we check in cache first) options = typeof options === "string" ? - ( optionsCache[ options ] || createOptions( options ) ) : + createOptions( options ) : jQuery.extend( {}, options ); - var // Last fire value (for non-forgettable lists) + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists memory, + // Flag to know if list was already fired fired, - // Flag to know if list is currently firing - firing, - // First callback to fire (used internally by add and fireWith) - firingStart, - // End of the loop when firing - firingLength, - // Index of currently firing callback (modified by remove if needed) - firingIndex, + + // Flag to prevent firing + locked, + // Actual callback list list = [], - // Stack of fire calls for repeatable lists - stack = !options.once && [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + // Fire callbacks - fire = function( data ) { - memory = options.memory && data; - fired = true; - firingIndex = firingStart || 0; - firingStart = 0; - firingLength = list.length; - firing = true; - for ( ; list && firingIndex < firingLength; firingIndex++ ) { - if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { - memory = false; // To prevent further calls using add - break; + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } } } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + firing = false; - if ( list ) { - if ( stack ) { - if ( stack.length ) { - fire( stack.shift() ); - } - } else if ( memory ) { + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { list = []; + + // Otherwise, this object is spent } else { - self.disable(); + list = ""; } } }, + // Actual Callbacks object self = { + // Add a callback or a collection of callbacks to the list add: function() { if ( list ) { - // First, we save the current length - var start = list.length; - (function add( args ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { jQuery.each( args, function( _, arg ) { - var type = jQuery.type( arg ); - if ( type === "function" ) { + if ( isFunction( arg ) ) { if ( !options.unique || !self.has( arg ) ) { list.push( arg ); } - } else if ( arg && arg.length && type !== "string" ) { + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + // Inspect recursively add( arg ); } - }); - })( arguments ); - // Do we need to add the callbacks to the - // current firing batch? - if ( firing ) { - firingLength = list.length; - // With memory, if we're not firing then - // we should call right away - } else if ( memory ) { - firingStart = start; - fire( memory ); + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); } } return this; }, + // Remove a callback from the list remove: function() { - if ( list ) { - jQuery.each( arguments, function( _, arg ) { - var index; - while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { - list.splice( index, 1 ); - // Handle firing indexes - if ( firing ) { - if ( index <= firingLength ) { - firingLength--; - } - if ( index <= firingIndex ) { - firingIndex--; - } - } + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; } - }); - } + } + } ); return this; }, + // Check if a given callback is in the list. // If no argument is given, return whether or not list has callbacks attached. has: function( fn ) { - return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; }, + // Remove all callbacks from the list empty: function() { - list = []; - firingLength = 0; - return this; - }, - // Have the list do nothing anymore - disable: function() { - list = stack = memory = undefined; - return this; - }, - // Is it disabled? - disabled: function() { - return !list; - }, - // Lock the list in its current state - lock: function() { - stack = undefined; - if ( !memory ) { - self.disable(); + if ( list ) { + list = []; } return this; }, - // Is it locked? - locked: function() { - return !stack; + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + // Call all callbacks with the given context and arguments fireWith: function( context, args ) { - if ( list && ( !fired || stack ) ) { + if ( !locked ) { args = args || []; args = [ context, args.slice ? args.slice() : args ]; - if ( firing ) { - stack.push( args ); - } else { - fire( args ); + queue.push( args ); + if ( !firing ) { + fire(); } } return this; }, + // Call all the callbacks with the given arguments fire: function() { self.fireWith( this, arguments ); return this; }, + // To know if the callbacks have already been called at least once fired: function() { return !!fired; @@ -3228,14 +3372,59 @@ jQuery.Callbacks = function( options ) { }; -jQuery.extend({ +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { Deferred: function( func ) { var tuples = [ - // action, add listener, listener list, final state - [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], - [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], - [ "notify", "progress", jQuery.Callbacks("memory") ] + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] ], state = "pending", promise = { @@ -3246,27 +3435,213 @@ jQuery.extend({ deferred.done( arguments ).fail( arguments ); return this; }, - then: function( /* fnDone, fnFail, fnProgress */ ) { - var fns = arguments; - return jQuery.Deferred(function( newDefer ) { - jQuery.each( tuples, function( i, tuple ) { - var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; - // deferred[ done | fail | progress ] for forwarding actions to newDefer - deferred[ tuple[1] ](function() { - var returned = fn && fn.apply( this, arguments ); - if ( returned && jQuery.isFunction( returned.promise ) ) { - returned.promise() - .done( newDefer.resolve ) - .fail( newDefer.reject ) - .progress( newDefer.notify ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); - } - }); - }); - fns = null; - }).promise(); + "catch": function( fn ) { + return promise.then( null, fn ); }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( _i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.error ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the error, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getErrorHook ) { + process.error = jQuery.Deferred.getErrorHook(); + + // The deprecated alias of the above. While the name suggests + // returning the stack, not an error instance, jQuery just passes + // it directly to `console.warn` so both will work; an instance + // just better cooperates with source maps. + } else if ( jQuery.Deferred.getStackHook ) { + process.error = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function( obj ) { @@ -3275,34 +3650,60 @@ jQuery.extend({ }, deferred = {}; - // Keep pipe for back-compat - promise.pipe = promise.then; - // Add list-specific methods jQuery.each( tuples, function( i, tuple ) { var list = tuple[ 2 ], - stateString = tuple[ 3 ]; + stateString = tuple[ 5 ]; - // promise[ done | fail | progress ] = list.add - promise[ tuple[1] ] = list.add; + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; // Handle state if ( stateString ) { - list.add(function() { - // state = [ resolved | rejected ] - state = stateString; + list.add( + function() { - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); } - // deferred[ resolve | reject | notify ] - deferred[ tuple[0] ] = function() { - deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); return this; }; - deferred[ tuple[0] + "With" ] = list.fireWith; - }); + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); // Make the deferred a promise promise.promise( deferred ); @@ -3317,86 +3718,112 @@ jQuery.extend({ }, // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), resolveValues = slice.call( arguments ), - length = resolveValues.length, - // the count of uncompleted subordinates - remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + // the primary Deferred + primary = jQuery.Deferred(), - // the master Deferred. If resolveValues consist of only a single Deferred, just use that. - deferred = remaining === 1 ? subordinate : jQuery.Deferred(), - - // Update function for both resolve and progress values - updateFunc = function( i, contexts, values ) { + // subordinate callback factory + updateFunc = function( i ) { return function( value ) { - contexts[ i ] = this; - values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; - if ( values === progressValues ) { - deferred.notifyWith( contexts, values ); - } else if ( !( --remaining ) ) { - deferred.resolveWith( contexts, values ); + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + primary.resolveWith( resolveContexts, resolveValues ); } }; - }, + }; - progressValues, progressContexts, resolveContexts; + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, primary.done( updateFunc( i ) ).resolve, primary.reject, + !remaining ); - // Add listeners to Deferred subordinates; treat others as resolved - if ( length > 1 ) { - progressValues = new Array( length ); - progressContexts = new Array( length ); - resolveContexts = new Array( length ); - for ( ; i < length; i++ ) { - if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { - resolveValues[ i ].promise() - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ) - .progress( updateFunc( i, progressContexts, progressValues ) ); - } else { - --remaining; - } + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( primary.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return primary.then(); } } - // If we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), primary.reject ); } - return deferred.promise(); + return primary.promise(); } -}); +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +// If `jQuery.Deferred.getErrorHook` is defined, `asyncError` is an error +// captured before the async barrier to get the original error cause +// which may otherwise be hidden. +jQuery.Deferred.exceptionHook = function( error, asyncError ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, + error.stack, asyncError ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + // The deferred used on DOM ready -var readyList; +var readyList = jQuery.Deferred(); jQuery.fn.ready = function( fn ) { - // Add the callback - jQuery.ready.promise().done( fn ); + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); return this; }; -jQuery.extend({ +jQuery.extend( { + // Is the DOM ready to be used? Set to true once it occurs. isReady: false, // A counter to track how many items to wait for before - // the ready event fires. See #6781 + // the ready event fires. See trac-6781 readyWait: 1, - // Hold (or release) the ready event - holdReady: function( hold ) { - if ( hold ) { - jQuery.readyWait++; - } else { - jQuery.ready( true ); - } - }, - // Handle when the DOM is ready ready: function( wait ) { @@ -3415,77 +3842,64 @@ jQuery.extend({ // If there are functions bound, to execute readyList.resolveWith( document, [ jQuery ] ); - - // Trigger any bound ready events - if ( jQuery.fn.triggerHandler ) { - jQuery( document ).triggerHandler( "ready" ); - jQuery( document ).off( "ready" ); - } } -}); +} ); -/** - * The ready event handler and self cleanup method - */ +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method function completed() { - document.removeEventListener( "DOMContentLoaded", completed, false ); - window.removeEventListener( "load", completed, false ); + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); jQuery.ready(); } -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - readyList = jQuery.Deferred(); + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); - // Catch cases where $(document).ready() is called after the browser event has already occurred. - // We once tried to use readyState "interactive" here, but it caused issues like the one - // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 - if ( document.readyState === "complete" ) { - // Handle it asynchronously to allow scripts the opportunity to delay ready - setTimeout( jQuery.ready ); +} else { - } else { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed, false ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed, false ); - } - } - return readyList.promise( obj ); -}; - -// Kick off the DOM ready check even if the user does not -jQuery.ready.promise(); + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} // Multifunctional method to get and set values of a collection // The value/s can optionally be executed if it's a function -var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { var i = 0, len = elems.length, bulk = key == null; // Sets many values - if ( jQuery.type( key ) === "object" ) { + if ( toType( key ) === "object" ) { chainable = true; for ( i in key ) { - jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + access( elems, fn, i, key[ i ], true, emptyGet, raw ); } // Sets one value } else if ( value !== undefined ) { chainable = true; - if ( !jQuery.isFunction( value ) ) { + if ( !isFunction( value ) ) { raw = true; } if ( bulk ) { + // Bulk operations run against the entire set if ( raw ) { fn.call( elems, value ); @@ -3494,7 +3908,7 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe // ...except when executing function values } else { bulk = fn; - fn = function( elem, key, value ) { + fn = function( elem, _key, value ) { return bulk.call( jQuery( elem ), value ); }; } @@ -3502,127 +3916,126 @@ var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGe if ( fn ) { for ( ; i < len; i++ ) { - fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); } } } - return chainable ? - elems : + if ( chainable ) { + return elems; + } - // Gets - bulk ? - fn.call( elems ) : - len ? fn( elems[0], key ) : emptyGet; + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; }; -/** - * Determines whether an object can have data - */ -jQuery.acceptData = function( owner ) { +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( _all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (trac-9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + // Accepts only: // - Node // - Node.ELEMENT_NODE // - Node.DOCUMENT_NODE // - Object // - Any - /* jshint -W018 */ return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); }; -function Data() { - // Support: Android<4, - // Old WebKit does not have Object.preventExtensions/freeze method, - // return new empty object instead with no [[set]] accessor - Object.defineProperty( this.cache = {}, 0, { - get: function() { - return {}; - } - }); + +function Data() { this.expando = jQuery.expando + Data.uid++; } Data.uid = 1; -Data.accepts = jQuery.acceptData; Data.prototype = { - key: function( owner ) { - // We can accept data for non-element nodes in modern browsers, - // but we should not, see #8335. - // Always return the key for a frozen object. - if ( !Data.accepts( owner ) ) { - return 0; - } - var descriptor = {}, - // Check if the owner object already has a cache key - unlock = owner[ this.expando ]; + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; // If not, create one - if ( !unlock ) { - unlock = Data.uid++; + if ( !value ) { + value = {}; - // Secure it in a non-enumerable, non-writable property - try { - descriptor[ this.expando ] = { value: unlock }; - Object.defineProperties( owner, descriptor ); + // We can accept data for non-element nodes in modern browsers, + // but we should not, see trac-8335. + // Always return an empty object. + if ( acceptData( owner ) ) { - // Support: Android<4 - // Fallback to a less secure definition - } catch ( e ) { - descriptor[ this.expando ] = unlock; - jQuery.extend( owner, descriptor ); + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } } } - // Ensure the cache object - if ( !this.cache[ unlock ] ) { - this.cache[ unlock ] = {}; - } - - return unlock; + return value; }, set: function( owner, data, value ) { var prop, - // There may be an unlock assigned to this node, - // if there is no entry for this "owner", create one inline - // and set the unlock as though an owner entry had always existed - unlock = this.key( owner ), - cache = this.cache[ unlock ]; + cache = this.cache( owner ); // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) if ( typeof data === "string" ) { - cache[ data ] = value; + cache[ camelCase( data ) ] = value; // Handle: [ owner, { properties } ] args } else { - // Fresh assignments by object are shallow copied - if ( jQuery.isEmptyObject( cache ) ) { - jQuery.extend( this.cache[ unlock ], data ); - // Otherwise, copy the properties one-by-one to the cache object - } else { - for ( prop in data ) { - cache[ prop ] = data[ prop ]; - } + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; } } return cache; }, get: function( owner, key ) { - // Either a valid cache is found, or will be created. - // New caches will be created and the unlock returned, - // allowing direct access to the newly created - // empty data object. A valid owner object must be provided. - var cache = this.cache[ this.key( owner ) ]; - return key === undefined ? - cache : cache[ key ]; + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; }, access: function( owner, key, value ) { - var stored; + // In cases where either: // // 1. No key was specified @@ -3635,15 +4048,12 @@ Data.prototype = { // 2. The data stored at the key // if ( key === undefined || - ((key && typeof key === "string") && value === undefined) ) { + ( ( key && typeof key === "string" ) && value === undefined ) ) { - stored = this.get( owner, key ); - - return stored !== undefined ? - stored : this.get( owner, jQuery.camelCase(key) ); + return this.get( owner, key ); } - // [*]When the key is not a string, or both a key and value + // When the key is not a string, or both a key and value // are specified, set or extend (existing objects) with either: // // 1. An object of properties @@ -3656,57 +4066,60 @@ Data.prototype = { return value !== undefined ? value : key; }, remove: function( owner, key ) { - var i, name, camel, - unlock = this.key( owner ), - cache = this.cache[ unlock ]; + var i, + cache = owner[ this.expando ]; - if ( key === undefined ) { - this.cache[ unlock ] = {}; + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { - } else { // Support array or space separated string of keys - if ( jQuery.isArray( key ) ) { - // If "name" is an array of keys... - // When data is initially created, via ("key", "val") signature, - // keys will be converted to camelCase. - // Since there is no way to tell _how_ a key was added, remove - // both plain key and camelCase key. #12786 - // This will only penalize the array argument path. - name = key.concat( key.map( jQuery.camelCase ) ); + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); } else { - camel = jQuery.camelCase( key ); - // Try the string as a key before any manipulation - if ( key in cache ) { - name = [ key, camel ]; - } else { - // If a key with the spaces exists, use it. - // Otherwise, create an array by matching non-whitespace - name = camel; - name = name in cache ? - [ name ] : ( name.match( rnotwhite ) || [] ); - } + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); } - i = name.length; + i = key.length; + while ( i-- ) { - delete cache[ name[ i ] ]; + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; } } }, hasData: function( owner ) { - return !jQuery.isEmptyObject( - this.cache[ owner[ this.expando ] ] || {} - ); - }, - discard: function( owner ) { - if ( owner[ this.expando ] ) { - delete this.cache[ owner[ this.expando ] ]; - } + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); } }; -var data_priv = new Data(); +var dataPriv = new Data(); -var data_user = new Data(); +var dataUser = new Data(); @@ -3721,7 +4134,32 @@ var data_user = new Data(); // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} function dataAttr( elem, key, data ) { var name; @@ -3729,22 +4167,16 @@ function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) { try { - data = data === "true" ? true : - data === "false" ? false : - data === "null" ? null : - // Only convert to a number if it doesn't change the string - +data + "" === data ? +data : - rbrace.test( data ) ? jQuery.parseJSON( data ) : - data; - } catch( e ) {} + data = getData( data ); + } catch ( e ) {} // Make sure we set the data so it isn't changed later - data_user.set( elem, key, data ); + dataUser.set( elem, key, data ); } else { data = undefined; } @@ -3752,31 +4184,31 @@ function dataAttr( elem, key, data ) { return data; } -jQuery.extend({ +jQuery.extend( { hasData: function( elem ) { - return data_user.hasData( elem ) || data_priv.hasData( elem ); + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); }, data: function( elem, name, data ) { - return data_user.access( elem, name, data ); + return dataUser.access( elem, name, data ); }, removeData: function( elem, name ) { - data_user.remove( elem, name ); + dataUser.remove( elem, name ); }, // TODO: Now that all calls to _data and _removeData have been replaced - // with direct calls to data_priv methods, these can be deprecated. + // with direct calls to dataPriv methods, these can be deprecated. _data: function( elem, name, data ) { - return data_priv.access( elem, name, data ); + return dataPriv.access( elem, name, data ); }, _removeData: function( elem, name ) { - data_priv.remove( elem, name ); + dataPriv.remove( elem, name ); } -}); +} ); -jQuery.fn.extend({ +jQuery.fn.extend( { data: function( key, value ) { var i, name, data, elem = this[ 0 ], @@ -3785,23 +4217,23 @@ jQuery.fn.extend({ // Gets all values if ( key === undefined ) { if ( this.length ) { - data = data_user.get( elem ); + data = dataUser.get( elem ); - if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { i = attrs.length; while ( i-- ) { - // Support: IE11+ - // The attrs elements can be null (#14894) + // Support: IE 11 only + // The attrs elements can be null (trac-14894) if ( attrs[ i ] ) { name = attrs[ i ].name; if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice(5) ); + name = camelCase( name.slice( 5 ) ); dataAttr( elem, name, data[ name ] ); } } } - data_priv.set( elem, "hasDataAttrs", true ); + dataPriv.set( elem, "hasDataAttrs", true ); } } @@ -3810,14 +4242,13 @@ jQuery.fn.extend({ // Sets multiple values if ( typeof key === "object" ) { - return this.each(function() { - data_user.set( this, key ); - }); + return this.each( function() { + dataUser.set( this, key ); + } ); } return access( this, function( value ) { - var data, - camelKey = jQuery.camelCase( key ); + var data; // The calling jQuery object (element matches) is not empty // (and therefore has an element appears at this[ 0 ]) and the @@ -3825,23 +4256,17 @@ jQuery.fn.extend({ // will result in `undefined` for elem = this[ 0 ] which will // throw an exception if an attempt to read a data cache is made. if ( elem && value === undefined ) { - // Attempt to get data from the cache - // with the key as-is - data = data_user.get( elem, key ); - if ( data !== undefined ) { - return data; - } // Attempt to get data from the cache - // with the key camelized - data = data_user.get( elem, camelKey ); + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); if ( data !== undefined ) { return data; } // Attempt to "discover" the data in // HTML5 custom data-* attrs - data = dataAttr( elem, camelKey, undefined ); + data = dataAttr( elem, key ); if ( data !== undefined ) { return data; } @@ -3851,46 +4276,34 @@ jQuery.fn.extend({ } // Set the data... - this.each(function() { - // First, attempt to store a copy or reference of any - // data that might've been store with a camelCased key. - var data = data_user.get( this, camelKey ); + this.each( function() { - // For HTML5 data-* attribute interop, we have to - // store property names with dashes in a camelCase form. - // This might not apply to all properties...* - data_user.set( this, camelKey, value ); - - // *... In the case of properties that might _actually_ - // have dashes, we need to also store a copy of that - // unchanged property. - if ( key.indexOf("-") !== -1 && data !== undefined ) { - data_user.set( this, key, value ); - } - }); + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); }, null, value, arguments.length > 1, null, true ); }, removeData: function( key ) { - return this.each(function() { - data_user.remove( this, key ); - }); + return this.each( function() { + dataUser.remove( this, key ); + } ); } -}); +} ); -jQuery.extend({ +jQuery.extend( { queue: function( elem, type, data ) { var queue; if ( elem ) { type = ( type || "fx" ) + "queue"; - queue = data_priv.get( elem, type ); + queue = dataPriv.get( elem, type ); // Speed up dequeue by getting out quickly if this is just a lookup if ( data ) { - if ( !queue || jQuery.isArray( data ) ) { - queue = data_priv.access( elem, type, jQuery.makeArray(data) ); + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); } else { queue.push( data ); } @@ -3937,15 +4350,15 @@ jQuery.extend({ // Not public - generate a queueHooks object, or return the current one _queueHooks: function( elem, type ) { var key = type + "queueHooks"; - return data_priv.get( elem, key ) || data_priv.access( elem, key, { - empty: jQuery.Callbacks("once memory").add(function() { - data_priv.remove( elem, [ type + "queue", key ] ); - }) - }); + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); } -}); +} ); -jQuery.fn.extend({ +jQuery.fn.extend( { queue: function( type, data ) { var setter = 2; @@ -3956,30 +4369,31 @@ jQuery.fn.extend({ } if ( arguments.length < setter ) { - return jQuery.queue( this[0], type ); + return jQuery.queue( this[ 0 ], type ); } return data === undefined ? this : - this.each(function() { + this.each( function() { var queue = jQuery.queue( this, type, data ); // Ensure a hooks for this queue jQuery._queueHooks( this, type ); - if ( type === "fx" && queue[0] !== "inprogress" ) { + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { jQuery.dequeue( this, type ); } - }); + } ); }, dequeue: function( type ) { - return this.each(function() { + return this.each( function() { jQuery.dequeue( this, type ); - }); + } ); }, clearQueue: function( type ) { return this.queue( type || "fx", [] ); }, + // Get a promise resolved when queues of a certain type // are emptied (fx is the type by default) promise: function( type, obj ) { @@ -4001,7 +4415,7 @@ jQuery.fn.extend({ type = type || "fx"; while ( i-- ) { - tmp = data_priv.get( elements[ i ], type + "queueHooks" ); + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); if ( tmp && tmp.empty ) { count++; tmp.empty.add( resolve ); @@ -4010,58 +4424,410 @@ jQuery.fn.extend({ resolve(); return defer.promise( obj ); } -}); -var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; -var isHidden = function( elem, el ) { - // isHidden might be called from jQuery#filter function; +var documentElement = document.documentElement; + + + + var isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ); + }, + composed = { composed: true }; + + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only + // Check attachment across shadow DOM boundaries when possible (gh-3504) + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { + isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ) || + elem.getRootNode( composed ) === elem.ownerDocument; + }; + } +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; // in that case, element will be second argument elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + isAttached( elem ) && + + jQuery.css( elem, "display" ) === "none"; }; -var rcheckableType = (/^(?:checkbox|radio)$/i); + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); -(function() { +( function() { var fragment = document.createDocumentFragment(), div = fragment.appendChild( document.createElement( "div" ) ), input = document.createElement( "input" ); - // Support: Safari<=5.1 - // Check state lost if the name is set (#11217) + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (trac-11217) // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) + // `name` and `type` must use .setAttribute for WWA (trac-14901) input.setAttribute( "type", "radio" ); input.setAttribute( "checked", "checked" ); input.setAttribute( "name", "t" ); div.appendChild( input ); - // Support: Safari<=5.1, Android<4.2 + // Support: Android <=4.1 only // Older WebKit doesn't clone checked state correctly in fragments support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - // Support: IE<=11+ + // Support: IE <=11 only // Make sure textarea (and checkbox) defaultValue is properly cloned div.innerHTML = ""; support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; -})(); -var strundefined = typeof undefined; + + // Support: IE <=9 only + // IE <=9 replaces "; + support.option = !!div.lastChild; +} )(); +// We have to close these tags to support XHTML (trac-13200) +var wrapMap = { -support.focusinBubbles = "onfocusin" in window; + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
        " ], + col: [ 2, "", "
        " ], + tr: [ 2, "", "
        " ], + td: [ 3, "", "
        " ], + + _default: [ 0, "", "" ] +}; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: IE <=9 only +if ( !support.option ) { + wrapMap.optgroup = wrapMap.option = [ 1, "" ]; +} -var - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (trac-15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, attached, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (trac-12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + attached = isAttached( elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( attached ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +var rtypenamespace = /^([^.]*)(?:\.(.+)|)/; function returnTrue() { return true; @@ -4071,10 +4837,65 @@ function returnFalse() { return false; } -function safeActiveElement() { - try { - return document.activeElement; - } catch ( err ) { } +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); } /* @@ -4090,10 +4911,10 @@ jQuery.event = { var handleObjIn, eventHandle, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, - elemData = data_priv.get( elem ); + elemData = dataPriv.get( elem ); - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { + // Only attach events to objects that accept data + if ( !acceptData( elem ) ) { return; } @@ -4104,31 +4925,38 @@ jQuery.event = { selector = handleObjIn.selector; } + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + // Make sure that the handler has a unique ID, used to find/remove it later if ( !handler.guid ) { handler.guid = jQuery.guid++; } // Init the element's event structure and main handler, if this is the first - if ( !(events = elemData.events) ) { - events = elemData.events = {}; + if ( !( events = elemData.events ) ) { + events = elemData.events = Object.create( null ); } - if ( !(eventHandle = elemData.handle) ) { + if ( !( eventHandle = elemData.handle ) ) { eventHandle = elemData.handle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and // when an event is called after a page has unloaded - return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ? + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? jQuery.event.dispatch.apply( elem, arguments ) : undefined; }; } // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; t = types.length; while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // There *must* be a type, no attaching namespace-only handlers if ( !type ) { @@ -4145,7 +4973,7 @@ jQuery.event = { special = jQuery.event.special[ type ] || {}; // handleObj is passed to all event handlers - handleObj = jQuery.extend({ + handleObj = jQuery.extend( { type: type, origType: origType, data: data, @@ -4153,18 +4981,20 @@ jQuery.event = { guid: handler.guid, selector: selector, needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join(".") + namespace: namespaces.join( "." ) }, handleObjIn ); // Init the event handler queue if we're the first - if ( !(handlers = events[ type ]) ) { + if ( !( handlers = events[ type ] ) ) { handlers = events[ type ] = []; handlers.delegateCount = 0; // Only use addEventListener if the special events handler returns false - if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); + elem.addEventListener( type, eventHandle ); } } } @@ -4196,19 +5026,19 @@ jQuery.event = { var j, origCount, tmp, events, t, handleObj, special, handlers, type, namespaces, origType, - elemData = data_priv.hasData( elem ) && data_priv.get( elem ); + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); - if ( !elemData || !(events = elemData.events) ) { + if ( !elemData || !( events = elemData.events ) ) { return; } // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; t = types.length; while ( t-- ) { - tmp = rtypenamespace.exec( types[t] ) || []; - type = origType = tmp[1]; - namespaces = ( tmp[2] || "" ).split( "." ).sort(); + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); // Unbind all events (on this namespace, if provided) for the element if ( !type ) { @@ -4221,7 +5051,8 @@ jQuery.event = { special = jQuery.event.special[ type ] || {}; type = ( selector ? special.delegateType : special.bindType ) || type; handlers = events[ type ] || []; - tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); // Remove matching events origCount = j = handlers.length; @@ -4231,7 +5062,8 @@ jQuery.event = { if ( ( mappedTypes || origType === handleObj.origType ) && ( !handler || handler.guid === handleObj.guid ) && ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { handlers.splice( j, 1 ); if ( handleObj.selector ) { @@ -4246,7 +5078,9 @@ jQuery.event = { // Remove generic event handler if we removed something and no more handlers exist // (avoids potential for endless recursion during removal of special event handlers) if ( origCount && !handlers.length ) { - if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); } @@ -4254,158 +5088,32 @@ jQuery.event = { } } - // Remove the expando if it's no longer used + // Remove data and the expando if it's no longer used if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - data_priv.remove( elem, "events" ); + dataPriv.remove( elem, "handle events" ); } }, - trigger: function( event, data, elem, onlyHandlers ) { + dispatch: function( nativeEvent ) { - var i, cur, tmp, bubbleType, ontype, handle, special, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), - cur = tmp = elem = elem || document; + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), - // Don't do events on text and comment nodes - if ( elem.nodeType === 3 || elem.nodeType === 8 ) { - return; - } - - // focus/blur morphs to focusin/out; ensure we're not firing them right now - if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { - return; - } - - if ( type.indexOf(".") >= 0 ) { - // Namespaced trigger; create a regexp to match event type in handle() - namespaces = type.split("."); - type = namespaces.shift(); - namespaces.sort(); - } - ontype = type.indexOf(":") < 0 && "on" + type; - - // Caller can pass in a jQuery.Event object, Object, or just an event type string - event = event[ jQuery.expando ] ? - event : - new jQuery.Event( type, typeof event === "object" && event ); - - // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) - event.isTrigger = onlyHandlers ? 2 : 3; - event.namespace = namespaces.join("."); - event.namespace_re = event.namespace ? - new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : - null; - - // Clean up the event in case it is being reused - event.result = undefined; - if ( !event.target ) { - event.target = elem; - } - - // Clone any incoming data and prepend the event, creating the handler arg list - data = data == null ? - [ event ] : - jQuery.makeArray( data, [ event ] ); - - // Allow special events to draw outside the lines - special = jQuery.event.special[ type ] || {}; - if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { - return; - } - - // Determine event propagation path in advance, per W3C events spec (#9951) - // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) - if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { - - bubbleType = special.delegateType || type; - if ( !rfocusMorph.test( bubbleType + type ) ) { - cur = cur.parentNode; - } - for ( ; cur; cur = cur.parentNode ) { - eventPath.push( cur ); - tmp = cur; - } - - // Only add window if we got to document (e.g., not plain obj or detached DOM) - if ( tmp === (elem.ownerDocument || document) ) { - eventPath.push( tmp.defaultView || tmp.parentWindow || window ); - } - } - - // Fire handlers on the event path - i = 0; - while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { - - event.type = i > 1 ? - bubbleType : - special.bindType || type; - - // jQuery handler - handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" ); - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && jQuery.acceptData( cur ) ) { - event.result = handle.apply( cur, data ); - if ( event.result === false ) { - event.preventDefault(); - } - } - } - event.type = type; - - // If nobody prevented the default action, do it now - if ( !onlyHandlers && !event.isDefaultPrevented() ) { - - if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && - jQuery.acceptData( elem ) ) { - - // Call a native DOM method on the target with the same name name as the event. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { - - // Don't re-trigger an onFOO event when we call its FOO() method - tmp = elem[ ontype ]; - - if ( tmp ) { - elem[ ontype ] = null; - } - - // Prevent re-triggering of the same event, since we already bubbled it above - jQuery.event.triggered = type; - elem[ type ](); - jQuery.event.triggered = undefined; - - if ( tmp ) { - elem[ ontype ] = tmp; - } - } - } - } - - return event.result; - }, - - dispatch: function( event ) { - - // Make a writable jQuery.Event from the native event object - event = jQuery.event.fix( event ); - - var i, j, ret, matched, handleObj, - handlerQueue = [], - args = slice.call( arguments ), - handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [], + handlers = ( + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], special = jQuery.event.special[ event.type ] || {}; // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[0] = event; + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + event.delegateTarget = this; // Call the preDispatch hook for the mapped type, and let it bail if desired @@ -4418,24 +5126,26 @@ jQuery.event = { // Run delegates first; they may want to stop propagation beneath us i = 0; - while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { event.currentTarget = matched.elem; j = 0; - while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { - // Triggered event must either 1) have no namespace, or 2) have namespace(s) - // a subset or equal to those in the bound event (both can have no namespace). - if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + // If the event is namespaced, then each handler is only invoked if it is + // specially universal or its namespaces are a superset of the event's. + if ( !event.rnamespace || handleObj.namespace === false || + event.rnamespace.test( handleObj.namespace ) ) { event.handleObj = handleObj; event.data = handleObj.data; - ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) - .apply( matched.elem, args ); + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); if ( ret !== undefined ) { - if ( (event.result = ret) === false ) { + if ( ( event.result = ret ) === false ) { event.preventDefault(); event.stopPropagation(); } @@ -4453,173 +5163,148 @@ jQuery.event = { }, handlers: function( event, handlers ) { - var i, matches, sel, handleObj, + var i, handleObj, sel, matchedHandlers, matchedSelectors, handlerQueue = [], delegateCount = handlers.delegateCount, cur = event.target; // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // Avoid non-left-click bubbling in Firefox (#3861) - if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { for ( ; cur !== this; cur = cur.parentNode || this ) { - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.disabled !== true || event.type !== "click" ) { - matches = []; + // Don't check non-elements (trac-13208) + // Don't process clicks on disabled elements (trac-6911, trac-8165, trac-11382, trac-11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; for ( i = 0; i < delegateCount; i++ ) { handleObj = handlers[ i ]; - // Don't conflict with Object.prototype properties (#13203) + // Don't conflict with Object.prototype properties (trac-13203) sel = handleObj.selector + " "; - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) >= 0 : + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : jQuery.find( sel, this, null, [ cur ] ).length; } - if ( matches[ sel ] ) { - matches.push( handleObj ); + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); } } - if ( matches.length ) { - handlerQueue.push({ elem: cur, handlers: matches }); + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); } } } } // Add the remaining (directly-bound) handlers + cur = this; if ( delegateCount < handlers.length ) { - handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); } return handlerQueue; }, - // Includes some event props shared by KeyEvent and MouseEvent - props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, - fixHooks: {}, + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, - keyHooks: { - props: "char charCode key keyCode".split(" "), - filter: function( event, original ) { - - // Add which for key events - if ( event.which == null ) { - event.which = original.charCode != null ? original.charCode : original.keyCode; + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); } - - return event; - } + } ); }, - mouseHooks: { - props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), - filter: function( event, original ) { - var eventDoc, doc, body, - button = original.button; - - // Calculate pageX/Y if missing and clientX/Y available - if ( event.pageX == null && original.clientX != null ) { - eventDoc = event.target.ownerDocument || document; - doc = eventDoc.documentElement; - body = eventDoc.body; - - event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); - event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); - } - - // Add which for click: 1 === left; 2 === middle; 3 === right - // Note: button is not normalized, so don't use it - if ( !event.which && button !== undefined ) { - event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); - } - - return event; - } - }, - - fix: function( event ) { - if ( event[ jQuery.expando ] ) { - return event; - } - - // Create a writable copy of the event object and normalize some properties - var i, prop, copy, - type = event.type, - originalEvent = event, - fixHook = this.fixHooks[ type ]; - - if ( !fixHook ) { - this.fixHooks[ type ] = fixHook = - rmouseEvent.test( type ) ? this.mouseHooks : - rkeyEvent.test( type ) ? this.keyHooks : - {}; - } - copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; - - event = new jQuery.Event( originalEvent ); - - i = copy.length; - while ( i-- ) { - prop = copy[ i ]; - event[ prop ] = originalEvent[ prop ]; - } - - // Support: Cordova 2.5 (WebKit) (#13255) - // All events should have a target; Cordova deviceready doesn't - if ( !event.target ) { - event.target = document; - } - - // Support: Safari 6.0+, Chrome<28 - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); }, special: { load: { + // Prevent triggered image.load events from bubbling to window.load noBubble: true }, - focus: { - // Fire native event if possible so blur/focus sequence is correct - trigger: function() { - if ( this !== safeActiveElement() && this.focus ) { - this.focus(); - return false; - } - }, - delegateType: "focusin" - }, - blur: { - trigger: function() { - if ( this === safeActiveElement() && this.blur ) { - this.blur(); - return false; - } - }, - delegateType: "focusout" - }, click: { - // For checkbox, fire native event so checked state will be right - trigger: function() { - if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { - this.click(); - return false; + + // Utilize native event to ensure correct state for checkable inputs + setup: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Claim the first handler + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + // dataPriv.set( el, "click", ... ) + leverageNative( el, "click", true ); } + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Force setup before triggering a click + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + leverageNative( el, "click" ); + } + + // Return non-false to allow normal event-path propagation + return true; }, - // For cross-browser consistency, don't fire native .click() on links + // For cross-browser consistency, suppress native .click() on links + // Also prevent it if we're currently inside a leveraged native-event stack _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); + var target = event.target; + return rcheckableType.test( target.type ) && + target.click && nodeName( target, "input" ) && + dataPriv.get( target, "click" ) || + nodeName( target, "a" ); } }, @@ -4633,41 +5318,104 @@ jQuery.event = { } } } - }, - - simulate: function( type, elem, event, bubble ) { - // Piggyback on a donor event to simulate a different one. - // Fake originalEvent to avoid donor's stopPropagation, but if the - // simulated event prevents default then we do the same on the donor. - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true, - originalEvent: {} - } - ); - if ( bubble ) { - jQuery.event.trigger( e, null, elem ); - } else { - jQuery.event.dispatch.call( elem, e ); - } - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } } }; +// Ensure the presence of an event listener that handles manually-triggered +// synthetic events by interrupting progress until reinvoked in response to +// *native* events that it fires directly, ensuring that state changes have +// already occurred before other listeners are invoked. +function leverageNative( el, type, isSetup ) { + + // Missing `isSetup` indicates a trigger call, which must force setup through jQuery.event.add + if ( !isSetup ) { + if ( dataPriv.get( el, type ) === undefined ) { + jQuery.event.add( el, type, returnTrue ); + } + return; + } + + // Register the controller as a special universal handler for all event namespaces + dataPriv.set( el, type, false ); + jQuery.event.add( el, type, { + namespace: false, + handler: function( event ) { + var result, + saved = dataPriv.get( this, type ); + + if ( ( event.isTrigger & 1 ) && this[ type ] ) { + + // Interrupt processing of the outer synthetic .trigger()ed event + if ( !saved ) { + + // Store arguments for use when handling the inner native event + // There will always be at least one argument (an event object), so this array + // will not be confused with a leftover capture object. + saved = slice.call( arguments ); + dataPriv.set( this, type, saved ); + + // Trigger the native event and capture its result + this[ type ](); + result = dataPriv.get( this, type ); + dataPriv.set( this, type, false ); + + if ( saved !== result ) { + + // Cancel the outer synthetic event + event.stopImmediatePropagation(); + event.preventDefault(); + + return result; + } + + // If this is an inner synthetic event for an event with a bubbling surrogate + // (focus or blur), assume that the surrogate already propagated from triggering + // the native event and prevent that from happening again here. + // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the + // bubbling surrogate propagates *after* the non-bubbling base), but that seems + // less bad than duplication. + } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { + event.stopPropagation(); + } + + // If this is a native event triggered above, everything is now in order + // Fire an inner synthetic event with the original arguments + } else if ( saved ) { + + // ...and capture the result + dataPriv.set( this, type, jQuery.event.trigger( + saved[ 0 ], + saved.slice( 1 ), + this + ) ); + + // Abort handling of the native event by all jQuery handlers while allowing + // native handlers on the same element to run. On target, this is achieved + // by stopping immediate propagation just on the jQuery event. However, + // the native event is re-wrapped by a jQuery one on each level of the + // propagation so the only way to stop it for jQuery is to stop it for + // everyone via native `stopPropagation()`. This is not a problem for + // focus/blur which don't bubble, but it does also stop click on checkboxes + // and radios. We accept this limitation. + event.stopPropagation(); + event.isImmediatePropagationStopped = returnTrue; + } + } + } ); +} + jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle, false ); + elem.removeEventListener( type, handle ); } }; jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword - if ( !(this instanceof jQuery.Event) ) { + if ( !( this instanceof jQuery.Event ) ) { return new jQuery.Event( src, props ); } @@ -4680,11 +5428,22 @@ jQuery.Event = function( src, props ) { // by a handler lower down the tree; reflect the correct value. this.isDefaultPrevented = src.defaultPrevented || src.defaultPrevented === undefined && - // Support: Android<4.0 + + // Support: Android <=2.3 only src.returnValue === false ? returnTrue : returnFalse; + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (trac-504, trac-13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + // Event type } else { this.type = src; @@ -4696,25 +5455,27 @@ jQuery.Event = function( src, props ) { } // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.now(); + this.timeStamp = src && src.timeStamp || Date.now(); // Mark it as fixed this[ jQuery.expando ] = true; }; // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding -// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html jQuery.Event.prototype = { + constructor: jQuery.Event, isDefaultPrevented: returnFalse, isPropagationStopped: returnFalse, isImmediatePropagationStopped: returnFalse, + isSimulated: false, preventDefault: function() { var e = this.originalEvent; this.isDefaultPrevented = returnTrue; - if ( e && e.preventDefault ) { + if ( e && !this.isSimulated ) { e.preventDefault(); } }, @@ -4723,7 +5484,7 @@ jQuery.Event.prototype = { this.isPropagationStopped = returnTrue; - if ( e && e.stopPropagation ) { + if ( e && !this.isSimulated ) { e.stopPropagation(); } }, @@ -4732,7 +5493,7 @@ jQuery.Event.prototype = { this.isImmediatePropagationStopped = returnTrue; - if ( e && e.stopImmediatePropagation ) { + if ( e && !this.isSimulated ) { e.stopImmediatePropagation(); } @@ -4740,9 +5501,208 @@ jQuery.Event.prototype = { } }; +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + code: true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + which: true +}, jQuery.event.addProp ); + +jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { + + function focusMappedHandler( nativeEvent ) { + if ( document.documentMode ) { + + // Support: IE 11+ + // Attach a single focusin/focusout handler on the document while someone wants + // focus/blur. This is because the former are synchronous in IE while the latter + // are async. In other browsers, all those handlers are invoked synchronously. + + // `handle` from private data would already wrap the event, but we need + // to change the `type` here. + var handle = dataPriv.get( this, "handle" ), + event = jQuery.event.fix( nativeEvent ); + event.type = nativeEvent.type === "focusin" ? "focus" : "blur"; + event.isSimulated = true; + + // First, handle focusin/focusout + handle( nativeEvent ); + + // ...then, handle focus/blur + // + // focus/blur don't bubble while focusin/focusout do; simulate the former by only + // invoking the handler at the lower level. + if ( event.target === event.currentTarget ) { + + // The setup part calls `leverageNative`, which, in turn, calls + // `jQuery.event.add`, so event handle will already have been set + // by this point. + handle( event ); + } + } else { + + // For non-IE browsers, attach a single capturing handler on the document + // while someone wants focusin/focusout. + jQuery.event.simulate( delegateType, nativeEvent.target, + jQuery.event.fix( nativeEvent ) ); + } + } + + jQuery.event.special[ type ] = { + + // Utilize native event if possible so blur/focus sequence is correct + setup: function() { + + var attaches; + + // Claim the first handler + // dataPriv.set( this, "focus", ... ) + // dataPriv.set( this, "blur", ... ) + leverageNative( this, type, true ); + + if ( document.documentMode ) { + + // Support: IE 9 - 11+ + // We use the same native handler for focusin & focus (and focusout & blur) + // so we need to coordinate setup & teardown parts between those events. + // Use `delegateType` as the key as `type` is already used by `leverageNative`. + attaches = dataPriv.get( this, delegateType ); + if ( !attaches ) { + this.addEventListener( delegateType, focusMappedHandler ); + } + dataPriv.set( this, delegateType, ( attaches || 0 ) + 1 ); + } else { + + // Return false to allow normal processing in the caller + return false; + } + }, + trigger: function() { + + // Force setup before trigger + leverageNative( this, type ); + + // Return non-false to allow normal event-path propagation + return true; + }, + + teardown: function() { + var attaches; + + if ( document.documentMode ) { + attaches = dataPriv.get( this, delegateType ) - 1; + if ( !attaches ) { + this.removeEventListener( delegateType, focusMappedHandler ); + dataPriv.remove( this, delegateType ); + } else { + dataPriv.set( this, delegateType, attaches ); + } + } else { + + // Return false to indicate standard teardown should be applied + return false; + } + }, + + // Suppress native focus or blur if we're currently inside + // a leveraged native-event stack + _default: function( event ) { + return dataPriv.get( event.target, type ); + }, + + delegateType: delegateType + }; + + // Support: Firefox <=44 + // Firefox doesn't have focus(in | out) events + // Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 + // + // Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 + // focus(in | out) events fire after focus & blur events, + // which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order + // Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 + // + // Support: IE 9 - 11+ + // To preserve relative focusin/focus & focusout/blur event order guaranteed on the 3.x branch, + // attach a single handler for both events in IE. + jQuery.event.special[ delegateType ] = { + setup: function() { + + // Handle: regular nodes (via `this.ownerDocument`), window + // (via `this.document`) & document (via `this`). + var doc = this.ownerDocument || this.document || this, + dataHolder = document.documentMode ? this : doc, + attaches = dataPriv.get( dataHolder, delegateType ); + + // Support: IE 9 - 11+ + // We use the same native handler for focusin & focus (and focusout & blur) + // so we need to coordinate setup & teardown parts between those events. + // Use `delegateType` as the key as `type` is already used by `leverageNative`. + if ( !attaches ) { + if ( document.documentMode ) { + this.addEventListener( delegateType, focusMappedHandler ); + } else { + doc.addEventListener( type, focusMappedHandler, true ); + } + } + dataPriv.set( dataHolder, delegateType, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this.document || this, + dataHolder = document.documentMode ? this : doc, + attaches = dataPriv.get( dataHolder, delegateType ) - 1; + + if ( !attaches ) { + if ( document.documentMode ) { + this.removeEventListener( delegateType, focusMappedHandler ); + } else { + doc.removeEventListener( type, focusMappedHandler, true ); + } + dataPriv.remove( dataHolder, delegateType ); + } else { + dataPriv.set( dataHolder, delegateType, attaches ); + } + } + }; +} ); + // Create mouseenter/leave events using mouseover/out and event-time checks -// Support: Chrome 15+ -jQuery.each({ +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", @@ -4758,9 +5718,9 @@ jQuery.each({ related = event.relatedTarget, handleObj = event.handleObj; - // For mousenter/leave call the handler if related is outside the target. + // For mouseenter/leave call the handler if related is outside the target. // NB: No relatedTarget if the mouse left/entered the browser window - if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { event.type = handleObj.origType; ret = handleObj.handler.apply( this, arguments ); event.type = fix; @@ -4768,115 +5728,33 @@ jQuery.each({ return ret; } }; -}); +} ); -// Support: Firefox, Chrome, Safari -// Create "bubbling" focus and blur events -if ( !support.focusinBubbles ) { - jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { +jQuery.fn.extend( { - // Attach a single capturing handler on the document while someone wants focusin/focusout - var handler = function( event ) { - jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = data_priv.access( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - data_priv.access( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = data_priv.access( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - data_priv.remove( doc, fix ); - - } else { - data_priv.access( doc, fix, attaches ); - } - } - }; - }); -} - -jQuery.fn.extend({ - - on: function( types, selector, data, fn, /*INTERNAL*/ one ) { - var origFn, type; - - // Types can be a map of types/handlers - if ( typeof types === "object" ) { - // ( types-Object, selector, data ) - if ( typeof selector !== "string" ) { - // ( types-Object, data ) - data = data || selector; - selector = undefined; - } - for ( type in types ) { - this.on( type, selector, data, types[ type ], one ); - } - return this; - } - - if ( data == null && fn == null ) { - // ( types, fn ) - fn = selector; - data = selector = undefined; - } else if ( fn == null ) { - if ( typeof selector === "string" ) { - // ( types, selector, fn ) - fn = data; - data = undefined; - } else { - // ( types, data, fn ) - fn = data; - data = selector; - selector = undefined; - } - } - if ( fn === false ) { - fn = returnFalse; - } else if ( !fn ) { - return this; - } - - if ( one === 1 ) { - origFn = fn; - fn = function( event ) { - // Can use an empty set, since event contains the info - jQuery().off( event ); - return origFn.apply( this, arguments ); - }; - // Use same guid so caller can remove using origFn - fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); - } - return this.each( function() { - jQuery.event.add( this, types, fn, data, selector ); - }); + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); }, one: function( types, selector, data, fn ) { - return this.on( types, selector, data, fn, 1 ); + return on( this, types, selector, data, fn, 1 ); }, off: function( types, selector, fn ) { var handleObj, type; if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event handleObj = types.handleObj; jQuery( types.delegateTarget ).off( - handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, handleObj.selector, handleObj.handler ); return this; } if ( typeof types === "object" ) { + // ( types-object [, selector] ) for ( type in types ) { this.off( type, selector, types[ type ] ); @@ -4884,6 +5762,7 @@ jQuery.fn.extend({ return this; } if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) fn = selector; selector = undefined; @@ -4891,112 +5770,65 @@ jQuery.fn.extend({ if ( fn === false ) { fn = returnFalse; } - return this.each(function() { + return this.each( function() { jQuery.event.remove( this, types, fn, selector ); - }); - }, - - trigger: function( type, data ) { - return this.each(function() { - jQuery.event.trigger( type, data, this ); - }); - }, - triggerHandler: function( type, data ) { - var elem = this[0]; - if ( elem ) { - return jQuery.event.trigger( type, data, elem, true ); - } + } ); } -}); +} ); var - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, - rtagName = /<([\w:]+)/, - rhtml = /<|&#?\w+;/, - rnoInnerhtml = /<(?:script|style|link)/i, + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g, - // We have to close these tags to support XHTML (#13200) - wrapMap = { + rcleanScript = /^\s*\s*$/g; - // Support: IE9 - option: [ 1, "" ], - - thead: [ 1, "", "
        " ], - col: [ 2, "", "
        " ], - tr: [ 2, "", "
        " ], - td: [ 3, "", "
        " ], - - _default: [ 0, "", "" ] - }; - -// Support: IE9 -wrapMap.optgroup = wrapMap.option; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - -// Support: 1.x compatibility -// Manipulating tables requires a tbody +// Prefer a tbody over its parent table for containing new rows function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { - elem.getElementsByTagName("tbody")[0] || - elem.appendChild( elem.ownerDocument.createElement("tbody") ) : - elem; + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; } // Replace/restore the type attribute of script elements for safe DOM manipulation function disableScript( elem ) { - elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; return elem; } function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - - if ( match ) { - elem.type = match[ 1 ]; + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); } else { - elem.removeAttribute("type"); + elem.removeAttribute( "type" ); } return elem; } -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - data_priv.set( - elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) - ); - } -} - function cloneCopyEvent( src, dest ) { - var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + var i, l, type, pdataOld, udataOld, udataCur, events; if ( dest.nodeType !== 1 ) { return; } // 1. Copy private data: events, handlers, etc. - if ( data_priv.hasData( src ) ) { - pdataOld = data_priv.access( src ); - pdataCur = data_priv.set( dest, pdataOld ); + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.get( src ); events = pdataOld.events; if ( events ) { - delete pdataCur.handle; - pdataCur.events = {}; + dataPriv.remove( dest, "handle events" ); for ( type in events ) { for ( i = 0, l = events[ type ].length; i < l; i++ ) { @@ -5007,24 +5839,14 @@ function cloneCopyEvent( src, dest ) { } // 2. Copy user data - if ( data_user.hasData( src ) ) { - udataOld = data_user.access( src ); + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); udataCur = jQuery.extend( {}, udataOld ); - data_user.set( dest, udataCur ); + dataUser.set( dest, udataCur ); } } -function getAll( context, tag ) { - var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : - context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : - []; - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], ret ) : - ret; -} - // Fix IE bugs, see support tests function fixInput( src, dest ) { var nodeName = dest.nodeName.toLowerCase(); @@ -5039,17 +5861,141 @@ function fixInput( src, dest ) { } } -jQuery.extend({ +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = flat( args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (trac-8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Re-enable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl && !node.noModule ) { + jQuery._evalUrl( node.src, { + nonce: node.nonce || node.getAttribute( "nonce" ) + }, doc ); + } + } else { + + // Unwrap a CDATA section containing script contents. This shouldn't be + // needed as in XML documents they're already not visible when + // inspecting element contents and in HTML documents they have no + // meaning but we're preserving that logic for backwards compatibility. + // This will be removed completely in 4.0. See gh-4904. + DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && isAttached( node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html; + }, + clone: function( elem, dataAndEvents, deepDataAndEvents ) { var i, l, srcElements, destElements, clone = elem.cloneNode( true ), - inPage = jQuery.contains( elem.ownerDocument, elem ); + inPage = isAttached( elem ); // Fix IE cloning issues if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && !jQuery.isXMLDoc( elem ) ) { - // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + // We eschew jQuery#find here for performance reasons: + // https://jsperf.com/getall-vs-sizzle/2 destElements = getAll( clone ); srcElements = getAll( elem ); @@ -5082,102 +6028,14 @@ jQuery.extend({ return clone; }, - buildFragment: function( elems, context, scripts, selection ) { - var elem, tmp, tag, wrap, contains, j, - fragment = context.createDocumentFragment(), - nodes = [], - i = 0, - l = elems.length; - - for ( ; i < l; i++ ) { - elem = elems[ i ]; - - if ( elem || elem === 0 ) { - - // Add nodes directly - if ( jQuery.type( elem ) === "object" ) { - // Support: QtWebKit, PhantomJS - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); - - // Convert non-html into a text node - } else if ( !rhtml.test( elem ) ) { - nodes.push( context.createTextNode( elem ) ); - - // Convert html into DOM nodes - } else { - tmp = tmp || fragment.appendChild( context.createElement("div") ); - - // Deserialize a standard representation - tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); - wrap = wrapMap[ tag ] || wrapMap._default; - tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[ 2 ]; - - // Descend through wrappers to the right content - j = wrap[ 0 ]; - while ( j-- ) { - tmp = tmp.lastChild; - } - - // Support: QtWebKit, PhantomJS - // push.apply(_, arraylike) throws on ancient WebKit - jQuery.merge( nodes, tmp.childNodes ); - - // Remember the top-level container - tmp = fragment.firstChild; - - // Ensure the created nodes are orphaned (#12392) - tmp.textContent = ""; - } - } - } - - // Remove wrapper from fragment - fragment.textContent = ""; - - i = 0; - while ( (elem = nodes[ i++ ]) ) { - - // #4087 - If origin and destination elements are the same, and this is - // that element, do not do anything - if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { - continue; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( fragment.appendChild( elem ), "script" ); - - // Preserve script evaluation history - if ( contains ) { - setGlobalEval( tmp ); - } - - // Capture executables - if ( scripts ) { - j = 0; - while ( (elem = tmp[ j++ ]) ) { - if ( rscriptType.test( elem.type || "" ) ) { - scripts.push( elem ); - } - } - } - } - - return fragment; - }, - cleanData: function( elems ) { - var data, elem, type, key, + var data, elem, type, special = jQuery.event.special, i = 0; - for ( ; (elem = elems[ i ]) !== undefined; i++ ) { - if ( jQuery.acceptData( elem ) ) { - key = elem[ data_priv.expando ]; - - if ( key && (data = data_priv.cache[ key ]) ) { + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { if ( data.events ) { for ( type in data.events ) { if ( special[ type ] ) { @@ -5189,91 +6047,82 @@ jQuery.extend({ } } } - if ( data_priv.cache[ key ] ) { - // Discard any remaining `private` data - delete data_priv.cache[ key ]; - } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; } } - // Discard any remaining `user` data - delete data_user.cache[ elem[ data_user.expando ] ]; } } -}); +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, -jQuery.fn.extend({ text: function( value ) { return access( this, function( value ) { return value === undefined ? jQuery.text( this ) : - this.empty().each(function() { + this.empty().each( function() { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { this.textContent = value; } - }); + } ); }, null, value, arguments.length ); }, append: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.appendChild( elem ); } - }); + } ); }, prepend: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { var target = manipulationTarget( this, elem ); target.insertBefore( elem, target.firstChild ); } - }); + } ); }, before: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this ); } - }); + } ); }, after: function() { - return this.domManip( arguments, function( elem ) { + return domManip( this, arguments, function( elem ) { if ( this.parentNode ) { this.parentNode.insertBefore( elem, this.nextSibling ); } - }); - }, - - remove: function( selector, keepData /* Internal Use Only */ ) { - var elem, - elems = selector ? jQuery.filter( selector, this ) : this, - i = 0; - - for ( ; (elem = elems[i]) != null; i++ ) { - if ( !keepData && elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem ) ); - } - - if ( elem.parentNode ) { - if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { - setGlobalEval( getAll( elem, "script" ) ); - } - elem.parentNode.removeChild( elem ); - } - } - - return this; + } ); }, empty: function() { var elem, i = 0; - for ( ; (elem = this[i]) != null; i++ ) { + for ( ; ( elem = this[ i ] ) != null; i++ ) { if ( elem.nodeType === 1 ) { // Prevent memory leaks @@ -5291,9 +6140,9 @@ jQuery.fn.extend({ dataAndEvents = dataAndEvents == null ? false : dataAndEvents; deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - return this.map(function() { + return this.map( function() { return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - }); + } ); }, html: function( value ) { @@ -5310,7 +6159,7 @@ jQuery.fn.extend({ if ( typeof value === "string" && !rnoInnerhtml.test( value ) && !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - value = value.replace( rxhtmlTag, "<$1>" ); + value = jQuery.htmlPrefilter( value ); try { for ( ; i < l; i++ ) { @@ -5326,7 +6175,7 @@ jQuery.fn.extend({ elem = 0; // If using innerHTML throws an exception, use the fallback method - } catch( e ) {} + } catch ( e ) {} } if ( elem ) { @@ -5336,115 +6185,25 @@ jQuery.fn.extend({ }, replaceWith: function() { - var arg = arguments[ 0 ]; + var ignored = []; - // Make the changes, replacing each context element with the new content - this.domManip( arguments, function( elem ) { - arg = this.parentNode; + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; - jQuery.cleanData( getAll( this ) ); - - if ( arg ) { - arg.replaceChild( elem, this ); - } - }); - - // Force removal if there was no new content (e.g., from empty arguments) - return arg && (arg.length || arg.nodeType) ? this : this.remove(); - }, - - detach: function( selector ) { - return this.remove( selector, true ); - }, - - domManip: function( args, callback ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var fragment, first, scripts, hasScripts, node, doc, - i = 0, - l = this.length, - set = this, - iNoClone = l - 1, - value = args[ 0 ], - isFunction = jQuery.isFunction( value ); - - // We can't cloneNode fragments that contain checked, in WebKit - if ( isFunction || - ( l > 1 && typeof value === "string" && - !support.checkClone && rchecked.test( value ) ) ) { - return this.each(function( index ) { - var self = set.eq( index ); - if ( isFunction ) { - args[ 0 ] = value.call( this, index, self.html() ); - } - self.domManip( args, callback ); - }); - } - - if ( l ) { - fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); - first = fragment.firstChild; - - if ( fragment.childNodes.length === 1 ) { - fragment = first; - } - - if ( first ) { - scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); - hasScripts = scripts.length; - - // Use the original fragment for the last item instead of the first because it can end up - // being emptied incorrectly in certain situations (#8070). - for ( ; i < l; i++ ) { - node = fragment; - - if ( i !== iNoClone ) { - node = jQuery.clone( node, true, true ); - - // Keep references to cloned scripts for later restoration - if ( hasScripts ) { - // Support: QtWebKit - // jQuery.merge because push.apply(_, arraylike) throws - jQuery.merge( scripts, getAll( node, "script" ) ); - } - } - - callback.call( this[ i ], node, i ); - } - - if ( hasScripts ) { - doc = scripts[ scripts.length - 1 ].ownerDocument; - - // Reenable scripts - jQuery.map( scripts, restoreScript ); - - // Evaluate executable scripts on first document insertion - for ( i = 0; i < hasScripts; i++ ) { - node = scripts[ i ]; - if ( rscriptType.test( node.type || "" ) && - !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { - - if ( node.src ) { - // Optional AJAX dependency, but won't run scripts if not present - if ( jQuery._evalUrl ) { - jQuery._evalUrl( node.src ); - } - } else { - jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); - } - } - } + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); } } - } - return this; + // Force callback invocation + }, ignored ); } -}); +} ); -jQuery.each({ +jQuery.each( { appendTo: "append", prependTo: "prepend", insertBefore: "before", @@ -5462,117 +6221,258 @@ jQuery.each({ elems = i === last ? this : this.clone( true ); jQuery( insert[ i ] )[ original ]( elems ); - // Support: QtWebKit - // .get() because push.apply(_, arraylike) throws + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit push.apply( ret, elems.get() ); } return this.pushStack( ret ); }; -}); - - -var iframe, - elemdisplay = {}; - -/** - * Retrieve the actual display of a element - * @param {String} name nodeName of the element - * @param {Object} doc Document object - */ -// Called only from within defaultDisplay -function actualDisplay( name, doc ) { - var style, - elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - // getDefaultComputedStyle might be reliably used only on attached element - display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? - - // Use of this method is a temporary fix (more like optimization) until something better comes along, - // since it was removed from specification and supported only in FF - style.display : jQuery.css( elem[ 0 ], "display" ); - - // We don't have any data stored on the element, - // so use "detach" method as fast way to get rid of the element - elem.detach(); - - return display; -} - -/** - * Try to determine the default display value of an element - * @param {String} nodeName - */ -function defaultDisplay( nodeName ) { - var doc = document, - display = elemdisplay[ nodeName ]; - - if ( !display ) { - display = actualDisplay( nodeName, doc ); - - // If the simple way fails, read from inside an iframe - if ( display === "none" || !display ) { - - // Use the already-created iframe if possible - iframe = (iframe || jQuery( "