From 532ca81fd7d3d5d1eb82152cfa297a46ab7890be Mon Sep 17 00:00:00 2001 From: William Nolin Date: Tue, 16 Mar 2021 16:43:29 -0400 Subject: [PATCH] Drop thymeleaf --- backup.ps1 | 46 - build.gradle.kts | 6 - lombok.config | 2 - .../config/InitialDataLoader.java | 32 - .../config/LocaleConfiguration.java | 51 - .../config/Preferences.java | 22 - .../config/SpringConfiguration.java | 88 - .../config/properties/CREProperties.java | 19 - ...notDeleteDefaultMaterialTypeException.java | 14 - ...annotEditDefaultMaterialTypeException.java | 14 - .../exception/SimdutException.java | 12 - .../exception/TooLowQuantityException.java | 25 - .../model/EntityAlreadyExistsException.java | 37 - .../model/EntityLinkedException.java | 13 - .../model/EntityNotFoundException.java | 39 - .../exception/model/ModelException.java | 38 - .../model/NullIdentifierException.java | 15 - .../model/dto/MaterialTypeEditorDto.java | 42 - .../model/dto/MixFormDto.java | 26 - .../model/dto/RecipeEditorFormDto.java | 39 - .../model/dto/RecipeExplorerFormDto.java | 14 - .../service/AbstractJavaNamedService.java | 29 - .../service/AbstractJavaService.java | 157 - .../service/IGenericJavaService.java | 77 - .../service/PasswordService.java | 17 - .../service/files/FilesService.java | 155 - .../service/files/ImagesService.java | 80 - .../service/files/MarkdownFilesService.java | 35 - .../service/files/SimdutService.java | 130 - .../service/files/XlsService.java | 14 +- .../service/model/CompanyJavaService.java | 75 - .../service/model/MaterialJavaService.java | 109 - .../model/MaterialTypeJavaService.java | 152 - .../service/model/MixJavaService.java | 141 - .../service/model/MixMaterialJavaService.java | 31 - .../service/model/MixTypeJavaService.java | 99 - .../service/model/RecipeJavaService.java | 199 - .../service/model/RecipeStepJavaService.java | 46 - .../utils/ControllerUtils.java | 64 - .../utils/MixBuilder.java | 116 - .../utils/PdfBuilder.java | 41 +- .../colorrecipesexplorer/web/StringBank.java | 30 - .../web/WebsitePaths.java | 73 - .../controller/angular/AngularController.kt | 14 - .../thymeleaf/CREErrorController.java | 53 - .../web/controller/thymeleaf/Controllers.kt | 20 - .../controller/thymeleaf/IndexController.java | 53 - .../thymeleaf/InventoryController.java | 71 - .../thymeleaf/OthersController.java | 66 - .../thymeleaf/RecipeExplorerController.java | 73 - .../creators/CompanyCreatorController.java | 55 - .../creators/MaterialCreatorController.java | 66 - .../creators/MaterialCreatorController.kt | 49 - .../MaterialTypeCreatorController.java | 62 - .../creators/MixCreatorController.java | 89 - .../creators/RecipeCreatorController.java | 57 - .../editors/MaterialEditorController.java | 108 - .../editors/MaterialTypeEditorController.java | 79 - .../editors/MixEditorController.java | 85 - .../editors/RecipeEditorController.java | 79 - .../thymeleaf/files/ImageFilesController.java | 83 - .../files/SimdutFilesController.java | 59 - .../thymeleaf/files/TouchUpKitController.java | 52 - .../files/XlsExporterController.java | 63 - .../removers/CompanyRemoverController.java | 56 - .../removers/MaterialRemoverController.java | 58 - .../MaterialTypeRemoverController.java | 60 - .../removers/MixRemoverController.java | 44 - .../removers/RecipeRemoverController.java | 51 - .../web/response/JSONResponseBuilder.java | 25 - .../web/response/ModelResponseBuilder.java | 63 - .../web/response/ResponseBuilder.java | 113 - .../web/response/ResponseCode.java | 78 - .../web/response/ResponseDataType.java | 92 - .../xlsx/XlsxExporter.java | 11 +- .../xlsx/component/Document.java | 8 +- .../ColorRecipesExplorerApplication.kt | 8 +- .../config/InitialDataLoader.kt | 19 + .../config/SpringConfiguration.kt | 13 + .../config/WebSecurityConfig.kt | 4 +- .../config/properties/CreProperties.kt | 8 + .../exception/Exception.kt | 31 - .../exception/RestException.kt | 34 +- .../service/AccountService.kt | 13 +- .../service/CompanyService.kt | 11 +- .../service/InventoryService.kt | 46 +- .../service/MaterialService.kt | 4 +- .../service/MaterialTypeService.kt | 10 +- .../service/MixService.kt | 4 +- .../service/MixTypeService.kt | 14 +- .../service/RecipeService.kt | 18 +- .../colorrecipesexplorer/service/Service.kt | 16 +- .../service/files/FileService.kt | 89 + .../service/files/SimdutService.kt | 64 + ...itional-spring-configuration-metadata.json | 9 - .../resources/application-rest.properties | 1 - .../application-thymeleaf.properties | 3 - src/main/resources/application.properties | 5 +- .../resources/lang/messages_en.properties | 118 - .../resources/lang/messages_fr.properties | 118 - .../resources/lang/responses_en.properties | 41 - .../resources/lang/responses_fr.properties | 41 - src/main/resources/thymeleaf/static/bpac.xpi | Bin 18204 -> 0 bytes .../thymeleaf/static/css/explore.css | 168 - .../resources/thymeleaf/static/css/flex.css | 14 - .../resources/thymeleaf/static/css/form.css | 57 - .../resources/thymeleaf/static/css/main.css | 242 - .../resources/thymeleaf/static/css/menu.css | 106 - .../resources/thymeleaf/static/css/mix.css | 114 - .../thymeleaf/static/css/recipesList.css | 41 - .../resources/thymeleaf/static/favicon.png | Bin 252 -> 0 bytes .../thymeleaf/static/icons/bucket.svg | 5 - .../thymeleaf/static/icons/confirm.svg | 7 - .../thymeleaf/static/icons/error.svg | 6 - .../thymeleaf/static/icons/printer.svg | 6 - .../thymeleaf/static/icons/printerError.svg | 6 - .../thymeleaf/static/icons/success.svg | 5 - .../thymeleaf/static/icons/warning.svg | 5 - .../thymeleaf/static/js/libs/axios.min.js | 9 - .../thymeleaf/static/js/libs/axios.min.map | 336 - .../thymeleaf/static/js/libs/bpac.js | 1182 - .../static/js/libs/jquery-3.4.1.min.js | 2 - .../js/libs/jquery-ui-1.12.1/AUTHORS.txt | 333 - .../js/libs/jquery-ui-1.12.1/LICENSE.txt | 43 - .../external/jquery/jquery.js | 11008 --------- .../images/ui-icons_444444_256x240.png | Bin 7006 -> 0 bytes .../images/ui-icons_555555_256x240.png | Bin 7074 -> 0 bytes .../images/ui-icons_777620_256x240.png | Bin 4676 -> 0 bytes .../images/ui-icons_777777_256x240.png | Bin 7013 -> 0 bytes .../images/ui-icons_cc0000_256x240.png | Bin 4632 -> 0 bytes .../images/ui-icons_ffffff_256x240.png | Bin 6313 -> 0 bytes .../js/libs/jquery-ui-1.12.1/index.html | 559 - .../js/libs/jquery-ui-1.12.1/jquery-ui.css | 1312 -- .../js/libs/jquery-ui-1.12.1/jquery-ui.js | 18706 ---------------- .../libs/jquery-ui-1.12.1/jquery-ui.min.css | 7 - .../js/libs/jquery-ui-1.12.1/jquery-ui.min.js | 13 - .../jquery-ui-1.12.1/jquery-ui.structure.css | 886 - .../jquery-ui.structure.min.css | 5 - .../libs/jquery-ui-1.12.1/jquery-ui.theme.css | 443 - .../jquery-ui-1.12.1/jquery-ui.theme.min.css | 5 - .../js/libs/jquery-ui-1.12.1/package.json | 74 - .../resources/thymeleaf/static/js/main.js | 303 - src/main/resources/thymeleaf/static/js/mix.js | 235 - .../thymeleaf/static/js/ptouchPrint.js | 47 - .../thymeleaf/static/js/recipeList.js | 8 - .../thymeleaf/static/js/recipeResearch.js | 81 - .../thymeleaf/static/lbx/Couleur.lbx | Bin 2236 -> 0 bytes .../thymeleaf/static/lbx/Templates.zip | Bin 4130 -> 0 bytes .../thymeleaf/static/lbx/Touchup.lbx | Bin 1996 -> 0 bytes src/main/resources/thymeleaf/static/logo.png | Bin 3131 -> 0 bytes .../thymeleaf/static/pdf/touchup.old.pdf | Bin 15545 -> 0 bytes .../thymeleaf/static/pdf/touchup.pdf | Bin 16909 -> 0 bytes .../thymeleaf/templates/closeTab.html | 12 - .../thymeleaf/templates/company/creator.html | 40 - .../thymeleaf/templates/company/remover.html | 57 - .../resources/thymeleaf/templates/error.html | 22 - .../thymeleaf/templates/fragments.html | 228 - .../thymeleaf/templates/images/add.html | 26 - .../resources/thymeleaf/templates/index.html | 68 - .../thymeleaf/templates/inventory.html | 260 - .../thymeleaf/templates/material/creator.html | 119 - .../thymeleaf/templates/material/edit.html | 141 - .../thymeleaf/templates/material/editor.html | 60 - .../thymeleaf/templates/material/remover.html | 53 - .../thymeleaf/templates/material/simdut.html | 41 - .../templates/materialType/creator.html | 62 - .../templates/materialType/edit.html | 63 - .../templates/materialType/editor.html | 58 - .../templates/materialType/remover.html | 51 - .../thymeleaf/templates/mix/creator.html | 88 - .../thymeleaf/templates/mix/editor.html | 109 - .../thymeleaf/templates/mix/selector.html | 28 - .../thymeleaf/templates/recipe/creator.html | 71 - .../thymeleaf/templates/recipe/edit.html | 292 - .../thymeleaf/templates/recipe/editor.html | 68 - .../thymeleaf/templates/recipe/explore.html | 547 - .../thymeleaf/templates/recipe/remover.html | 62 - .../thymeleaf/templates/touchup.html | 69 - .../thymeleaf/templates/touchupPtouch.html | 52 - .../thymeleaf/templates/updates.html | 41 - src/main/resources/updates.md | 116 - .../service/AbstractServiceTest.kt | 32 +- .../service/AccountsServiceTest.kt | 24 +- .../service/CompanyServiceTest.kt | 4 +- .../service/MaterialServiceTest.kt | 10 +- .../service/MaterialTypeServiceTest.kt | 20 +- .../service/MixTypeServiceTest.kt | 13 +- .../service/RecipeServiceTest.kt | 13 +- start.bat | 1 - 189 files changed, 380 insertions(+), 44221 deletions(-) delete mode 100644 backup.ps1 delete mode 100644 lombok.config delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/InitialDataLoader.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/LocaleConfiguration.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/Preferences.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/SpringConfiguration.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/properties/CREProperties.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/CannotDeleteDefaultMaterialTypeException.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/CannotEditDefaultMaterialTypeException.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/SimdutException.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/TooLowQuantityException.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityAlreadyExistsException.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityLinkedException.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityNotFoundException.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/ModelException.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/NullIdentifierException.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/MaterialTypeEditorDto.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/MixFormDto.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/RecipeEditorFormDto.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/RecipeExplorerFormDto.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/AbstractJavaNamedService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/AbstractJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/IGenericJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/PasswordService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/FilesService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/ImagesService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/MarkdownFilesService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/SimdutService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/CompanyJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MaterialJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MaterialTypeJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixMaterialJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixTypeJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/RecipeJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/RecipeStepJavaService.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/ControllerUtils.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/MixBuilder.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/StringBank.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/WebsitePaths.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/angular/AngularController.kt delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/CREErrorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/Controllers.kt delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/IndexController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/InventoryController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/OthersController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/RecipeExplorerController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/CompanyCreatorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialCreatorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialCreatorController.kt delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialTypeCreatorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MixCreatorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/RecipeCreatorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MaterialEditorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MaterialTypeEditorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MixEditorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/RecipeEditorController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/ImageFilesController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/SimdutFilesController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/TouchUpKitController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/XlsExporterController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/CompanyRemoverController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MaterialRemoverController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MaterialTypeRemoverController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MixRemoverController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/RecipeRemoverController.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/JSONResponseBuilder.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ModelResponseBuilder.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseBuilder.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseCode.java delete mode 100644 src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseDataType.java create mode 100644 src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/InitialDataLoader.kt create mode 100644 src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/SpringConfiguration.kt create mode 100644 src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/properties/CreProperties.kt delete mode 100644 src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/exception/Exception.kt create mode 100644 src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/files/FileService.kt create mode 100644 src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/files/SimdutService.kt delete mode 100644 src/main/resources/META-INF/additional-spring-configuration-metadata.json delete mode 100644 src/main/resources/application-rest.properties delete mode 100644 src/main/resources/application-thymeleaf.properties delete mode 100644 src/main/resources/lang/messages_en.properties delete mode 100644 src/main/resources/lang/messages_fr.properties delete mode 100644 src/main/resources/lang/responses_en.properties delete mode 100644 src/main/resources/lang/responses_fr.properties delete mode 100644 src/main/resources/thymeleaf/static/bpac.xpi delete mode 100644 src/main/resources/thymeleaf/static/css/explore.css delete mode 100644 src/main/resources/thymeleaf/static/css/flex.css delete mode 100644 src/main/resources/thymeleaf/static/css/form.css delete mode 100644 src/main/resources/thymeleaf/static/css/main.css delete mode 100644 src/main/resources/thymeleaf/static/css/menu.css delete mode 100644 src/main/resources/thymeleaf/static/css/mix.css delete mode 100644 src/main/resources/thymeleaf/static/css/recipesList.css delete mode 100644 src/main/resources/thymeleaf/static/favicon.png delete mode 100644 src/main/resources/thymeleaf/static/icons/bucket.svg delete mode 100644 src/main/resources/thymeleaf/static/icons/confirm.svg delete mode 100644 src/main/resources/thymeleaf/static/icons/error.svg delete mode 100644 src/main/resources/thymeleaf/static/icons/printer.svg delete mode 100644 src/main/resources/thymeleaf/static/icons/printerError.svg delete mode 100644 src/main/resources/thymeleaf/static/icons/success.svg delete mode 100644 src/main/resources/thymeleaf/static/icons/warning.svg delete mode 100644 src/main/resources/thymeleaf/static/js/libs/axios.min.js delete mode 100644 src/main/resources/thymeleaf/static/js/libs/axios.min.map delete mode 100644 src/main/resources/thymeleaf/static/js/libs/bpac.js delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-3.4.1.min.js delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/AUTHORS.txt delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/LICENSE.txt delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/external/jquery/jquery.js delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/images/ui-icons_444444_256x240.png delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/images/ui-icons_555555_256x240.png delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/images/ui-icons_777620_256x240.png delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/images/ui-icons_777777_256x240.png delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/images/ui-icons_cc0000_256x240.png delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/images/ui-icons_ffffff_256x240.png delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/index.html delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/jquery-ui.css delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/jquery-ui.js delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/jquery-ui.min.css delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/jquery-ui.min.js delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/jquery-ui.structure.css delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/jquery-ui.structure.min.css delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/jquery-ui.theme.css delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/jquery-ui.theme.min.css delete mode 100644 src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/package.json delete mode 100644 src/main/resources/thymeleaf/static/js/main.js delete mode 100644 src/main/resources/thymeleaf/static/js/mix.js delete mode 100644 src/main/resources/thymeleaf/static/js/ptouchPrint.js delete mode 100644 src/main/resources/thymeleaf/static/js/recipeList.js delete mode 100644 src/main/resources/thymeleaf/static/js/recipeResearch.js delete mode 100644 src/main/resources/thymeleaf/static/lbx/Couleur.lbx delete mode 100644 src/main/resources/thymeleaf/static/lbx/Templates.zip delete mode 100644 src/main/resources/thymeleaf/static/lbx/Touchup.lbx delete mode 100644 src/main/resources/thymeleaf/static/logo.png delete mode 100644 src/main/resources/thymeleaf/static/pdf/touchup.old.pdf delete mode 100644 src/main/resources/thymeleaf/static/pdf/touchup.pdf delete mode 100644 src/main/resources/thymeleaf/templates/closeTab.html delete mode 100644 src/main/resources/thymeleaf/templates/company/creator.html delete mode 100644 src/main/resources/thymeleaf/templates/company/remover.html delete mode 100644 src/main/resources/thymeleaf/templates/error.html delete mode 100644 src/main/resources/thymeleaf/templates/fragments.html delete mode 100644 src/main/resources/thymeleaf/templates/images/add.html delete mode 100644 src/main/resources/thymeleaf/templates/index.html delete mode 100644 src/main/resources/thymeleaf/templates/inventory.html delete mode 100644 src/main/resources/thymeleaf/templates/material/creator.html delete mode 100644 src/main/resources/thymeleaf/templates/material/edit.html delete mode 100644 src/main/resources/thymeleaf/templates/material/editor.html delete mode 100644 src/main/resources/thymeleaf/templates/material/remover.html delete mode 100644 src/main/resources/thymeleaf/templates/material/simdut.html delete mode 100644 src/main/resources/thymeleaf/templates/materialType/creator.html delete mode 100644 src/main/resources/thymeleaf/templates/materialType/edit.html delete mode 100644 src/main/resources/thymeleaf/templates/materialType/editor.html delete mode 100644 src/main/resources/thymeleaf/templates/materialType/remover.html delete mode 100644 src/main/resources/thymeleaf/templates/mix/creator.html delete mode 100644 src/main/resources/thymeleaf/templates/mix/editor.html delete mode 100644 src/main/resources/thymeleaf/templates/mix/selector.html delete mode 100644 src/main/resources/thymeleaf/templates/recipe/creator.html delete mode 100644 src/main/resources/thymeleaf/templates/recipe/edit.html delete mode 100644 src/main/resources/thymeleaf/templates/recipe/editor.html delete mode 100644 src/main/resources/thymeleaf/templates/recipe/explore.html delete mode 100644 src/main/resources/thymeleaf/templates/recipe/remover.html delete mode 100644 src/main/resources/thymeleaf/templates/touchup.html delete mode 100644 src/main/resources/thymeleaf/templates/touchupPtouch.html delete mode 100644 src/main/resources/thymeleaf/templates/updates.html delete mode 100644 src/main/resources/updates.md delete mode 100644 start.bat diff --git a/backup.ps1 b/backup.ps1 deleted file mode 100644 index ba3686b..0000000 --- a/backup.ps1 +++ /dev/null @@ -1,46 +0,0 @@ -param ( - [string]$WorkDir = "./workdir", - [string]$BackupPath = "./backup", - [boolean]$OverWrite = $False -) - -Write-Host "Démarrage de la sauvegarde..." -if (!(Test-Path -Path $WorkDir)) -{ - Write-Host "Le dossier de travail ($WorkDir) n'existe pas." - exit -} - -if (!(Test-Path -Path $BackupPath)) -{ - Write-Host "Création du dossier des sauvegardes. ($BackupPath)" - New-Item -ItemType directory -Path $BackupPath | Out-Null -} - -Write-Host "Début de la compression..." -$BackupFile = "$BackupPath/backup_$( Get-Date -f yyyyMMdd-HHmm ).zip" -$CompressArgs = @{ - 'Path' = $WorkDir - 'DestinationPath' = $BackupFile - 'Update' = $OverWrite -} - -try -{ - Compress-Archive @CompressArgs - - Write-Host "Sauvegarde réussie! ($BackupFile)" -} -catch [System.IO.IOException] -{ - Write-Output "Une erreur est survenue lors de la sauvegarde:" - - if ($_.FullyQualifiedErrorId -like "ArchiveFileExists*") - { - Write-Host "L'archive de sauvegarde '$BackupFile' existe déjà. Ajoutez l'argument '-OverWrite `$true' pour écraser l'archive." - } - else - { - Write-Host $_ - } -} \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 7ddcd0f..7344416 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -5,7 +5,6 @@ plugins { id("org.jetbrains.kotlin.jvm") version "1.4.30" id("org.jetbrains.dokka") version "1.4.20" id("com.leobia.gradle.sassjavacompiler") version "0.2.1" - id("io.freefair.lombok") version "5.2.1" id("org.springframework.boot") version "2.3.4.RELEASE" id("org.jetbrains.kotlin.plugin.spring") version "1.4.30" id("org.jetbrains.kotlin.plugin.jpa") version "1.4.30" @@ -29,13 +28,10 @@ dependencies { implementation("io.jsonwebtoken:jjwt:0.9.1") implementation("org.apache.poi:poi-ooxml:4.1.0") implementation("org.apache.pdfbox:pdfbox:2.0.4") - implementation("com.atlassian.commonmark:commonmark:0.13.1") - implementation("commons-io:commons-io:2.6") implementation("dev.fyloz.colorrecipesexplorer:database-manager:1.1.0") implementation("org.springframework.boot:spring-boot-starter-data-jpa:2.3.4.RELEASE") implementation("org.springframework.boot:spring-boot-starter-jdbc:2.3.4.RELEASE") - implementation("org.springframework.boot:spring-boot-starter-thymeleaf:2.3.4.RELEASE") implementation("org.springframework.boot:spring-boot-starter-web:2.3.4.RELEASE") implementation("org.springframework.boot:spring-boot-starter-validation:2.3.4.RELEASE") implementation("org.springframework.boot:spring-boot-starter-security:2.3.4.RELEASE") @@ -55,8 +51,6 @@ dependencies { runtimeOnly("mysql:mysql-connector-java:8.0.22") runtimeOnly("org.postgresql:postgresql:42.2.16") runtimeOnly("com.microsoft.sqlserver:mssql-jdbc:9.2.1.jre11") - - compileOnly("org.projectlombok:lombok:1.18.10") } java { diff --git a/lombok.config b/lombok.config deleted file mode 100644 index 6aa51d7..0000000 --- a/lombok.config +++ /dev/null @@ -1,2 +0,0 @@ -# This file is generated by the 'io.freefair.lombok' Gradle plugin -config.stopBubbling = true diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/InitialDataLoader.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/InitialDataLoader.java deleted file mode 100644 index 7239ba8..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/InitialDataLoader.java +++ /dev/null @@ -1,32 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.config; - -import dev.fyloz.trial.colorrecipesexplorer.config.properties.MaterialTypeProperties; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import dev.fyloz.trial.colorrecipesexplorer.service.MaterialService; -import dev.fyloz.trial.colorrecipesexplorer.service.MaterialTypeService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialTypeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.context.event.ApplicationReadyEvent; -import org.springframework.context.ApplicationListener; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; -import org.springframework.core.annotation.Order; - -@Configuration -@Order(Ordered.HIGHEST_PRECEDENCE) -public class InitialDataLoader implements ApplicationListener { - private final MaterialTypeService materialTypeService; - private final MaterialTypeProperties materialTypeProperties; - - @Autowired - public InitialDataLoader(MaterialTypeService materialTypeService, MaterialTypeProperties materialTypeProperties) { - this.materialTypeService = materialTypeService; - this.materialTypeProperties = materialTypeProperties; - } - - @Override - public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) { - materialTypeService.saveSystemTypes(materialTypeProperties.getSystemTypes()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/LocaleConfiguration.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/LocaleConfiguration.java deleted file mode 100644 index d0ebca7..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/LocaleConfiguration.java +++ /dev/null @@ -1,51 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.config; - -import org.springframework.context.MessageSource; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.support.ReloadableResourceBundleMessageSource; -import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; -import org.springframework.web.servlet.LocaleResolver; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; -import org.springframework.web.servlet.i18n.LocaleChangeInterceptor; -import org.springframework.web.servlet.i18n.SessionLocaleResolver; - -import java.util.Locale; - -@Configuration -public class LocaleConfiguration implements WebMvcConfigurer { - @Bean - public MessageSource messageSource() { - ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource(); - messageSource.setBasenames("classpath:lang/messages", "classpath:lang/responses"); - messageSource.setDefaultEncoding("UTF-8"); - return messageSource; - } - - @Bean - public LocaleResolver localeResolver() { - SessionLocaleResolver localeResolver = new SessionLocaleResolver(); - localeResolver.setDefaultLocale(Locale.FRENCH); - return localeResolver; - } - - @Bean - public LocaleChangeInterceptor localeChangeInterceptor() { - LocaleChangeInterceptor localeChangeInterceptor = new LocaleChangeInterceptor(); - localeChangeInterceptor.setParamName("lang"); - return localeChangeInterceptor; - } - - @Bean - public LocalValidatorFactoryBean validator(MessageSource messageSource) { - LocalValidatorFactoryBean bean = new LocalValidatorFactoryBean(); - bean.setValidationMessageSource(messageSource); - return bean; - } - - @Override - public void addInterceptors(InterceptorRegistry registry) { - registry.addInterceptor(localeChangeInterceptor()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/Preferences.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/Preferences.java deleted file mode 100644 index 6123b9f..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/Preferences.java +++ /dev/null @@ -1,22 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.config; - -import org.slf4j.Logger; -import org.springframework.context.MessageSource; - -public class Preferences { - - public static Logger logger; - - public static MessageSource messageSource; - - public static boolean urlUsePort; - - public static boolean urlUseHttps; - - public static String uploadDirectory; - - public static String passwordsFileName; - - public static String baseMaterialTypeName; - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/SpringConfiguration.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/SpringConfiguration.java deleted file mode 100644 index b265130..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/SpringConfiguration.java +++ /dev/null @@ -1,88 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.config; - -import dev.fyloz.trial.colorrecipesexplorer.ColorRecipesExplorerApplication; -import dev.fyloz.trial.colorrecipesexplorer.config.properties.CREProperties; -import dev.fyloz.trial.colorrecipesexplorer.config.properties.MaterialTypeProperties; -import dev.fyloz.trial.colorrecipesexplorer.service.PasswordService; -import dev.fyloz.trial.colorrecipesexplorer.service.files.FilesService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Qualifier; -import org.springframework.context.MessageSource; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import java.io.IOException; -import java.util.List; - -@Configuration -public class SpringConfiguration { - - private FilesService filesService; - private MessageSource messageSource; - private CREProperties creProperties; - private MaterialTypeProperties materialTypeProperties; - - @Autowired - public void setFilesService(FilesService filesService) { - this.filesService = filesService; - } - - @Autowired - public void setMessageSource(MessageSource messageSource) { - this.messageSource = messageSource; - } - - @Autowired - @Qualifier("CREProperties") - public void setCreProperties(CREProperties creProperties) { - this.creProperties = creProperties; - } - - @Autowired - public void setMaterialTypeProperties(MaterialTypeProperties materialTypeProperties) { - this.materialTypeProperties = materialTypeProperties; - } - - @Bean - public Logger getLogger() { - return LoggerFactory.getLogger(ColorRecipesExplorerApplication.class); - } - - @Bean - public void setPreferences() { - Preferences.urlUsePort = creProperties.isUrlUsePort(); - Preferences.urlUseHttps = creProperties.isUrlUseHttps(); - Preferences.uploadDirectory = creProperties.getUploadDirectory(); - Preferences.passwordsFileName = creProperties.getPasswordFile(); - Preferences.logger = getLogger(); - Preferences.messageSource = messageSource; - Preferences.baseMaterialTypeName = materialTypeProperties.getBaseName(); - } - - @Bean - public void initializePasswords() { - Logger logger = Preferences.logger; - String filePath = filesService.getPath(Preferences.passwordsFileName); - - logger.info("Le fichier des utilisateurs se situe à: " + filesService.getFile(filePath).getAbsolutePath()); - - try { - if (!filesService.exists(filePath)) filesService.create(filePath); - List fileContent = filesService.readAsStrings(filePath); - - if (fileContent.size() < 1) { - logger.warn("Aucun mot de passe trouvé. Il sera impossible d'utiliser certaines fonctionnalités de l'application."); - } - - for (String line : fileContent) { - PasswordService.addPassword(line); - } - } catch (IOException e) { - logger.error("Une erreur est survenue lors du chargement du fichier des utilisateurs", e); - logger.warn("Il sera impossible d'utiliser certaines fonctionnalités de l'application."); - } - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/properties/CREProperties.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/properties/CREProperties.java deleted file mode 100644 index 3fd9f83..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/config/properties/CREProperties.java +++ /dev/null @@ -1,19 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.config.properties; - -import lombok.Getter; -import lombok.Setter; -import org.springframework.boot.context.properties.ConfigurationProperties; -import org.springframework.stereotype.Component; - -@Component -@ConfigurationProperties(prefix = "cre.server") -@Getter -@Setter -public class CREProperties { - - private String passwordFile; - private String uploadDirectory; - private boolean urlUseHttps; - private boolean urlUsePort; - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/CannotDeleteDefaultMaterialTypeException.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/CannotDeleteDefaultMaterialTypeException.java deleted file mode 100644 index 2087581..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/CannotDeleteDefaultMaterialTypeException.java +++ /dev/null @@ -1,14 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.exception; - -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import lombok.Getter; - -@Getter -public class CannotDeleteDefaultMaterialTypeException extends RuntimeException { - - private MaterialType materialType; - - public CannotDeleteDefaultMaterialTypeException(MaterialType materialType) { - this.materialType = materialType; - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/CannotEditDefaultMaterialTypeException.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/CannotEditDefaultMaterialTypeException.java deleted file mode 100644 index 787fac3..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/CannotEditDefaultMaterialTypeException.java +++ /dev/null @@ -1,14 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.exception; - -import dev.fyloz.trial.colorrecipesexplorer.model.dto.MaterialTypeEditorDto; -import lombok.Getter; - -@Getter -public class CannotEditDefaultMaterialTypeException extends RuntimeException { - - private MaterialTypeEditorDto materialType; - - public CannotEditDefaultMaterialTypeException(MaterialTypeEditorDto materialType) { - this.materialType = materialType; - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/SimdutException.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/SimdutException.java deleted file mode 100644 index ab6ed8b..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/SimdutException.java +++ /dev/null @@ -1,12 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.exception; - -import dev.fyloz.trial.colorrecipesexplorer.model.Material; - -public class SimdutException extends RuntimeException { - - private Material material; - - public SimdutException(Material material) { - this.material = material; - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/TooLowQuantityException.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/TooLowQuantityException.java deleted file mode 100644 index 6b96062..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/TooLowQuantityException.java +++ /dev/null @@ -1,25 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.exception; - -import dev.fyloz.trial.colorrecipesexplorer.model.Material; -import lombok.Getter; - -@Getter -public class TooLowQuantityException extends RuntimeException { - - private Long mixId; - private Material material; - private Float storedQuantity; - private Float requestQuantity; - - private String response; - - public TooLowQuantityException(Long mixId, Material material, Float storedQuantity, Float requestQuantity) { - this.mixId = mixId; - this.material = material; - this.storedQuantity = storedQuantity; - this.requestQuantity = requestQuantity; - - response = String.format("%s_%s", mixId, material.getId()); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityAlreadyExistsException.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityAlreadyExistsException.java deleted file mode 100644 index 3b1088a..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityAlreadyExistsException.java +++ /dev/null @@ -1,37 +0,0 @@ -//package dev.fyloz.trial.colorrecipesexplorer.exception.model; -// -//import dev.fyloz.trial.colorrecipesexplorer.model.IModel; -//import lombok.Getter; -//import lombok.NonNull; -//import org.springframework.http.HttpStatus; -//import org.springframework.web.bind.annotation.ResponseStatus; -// -//@Getter -//@ResponseStatus(HttpStatus.CONFLICT) -//public class EntityAlreadyExistsException extends ModelException { -// -// @NonNull -// private IdentifierType identifierType; -// -// private String identifierName; -// -// @NonNull -// private Object requestedId; -// -// public EntityAlreadyExistsException(EntityAlreadyExistsException ex) { -// this(ex.type, ex.identifierType, ex.identifierName, ex.requestedId); -// } -// -// public EntityAlreadyExistsException(Class type, IdentifierType identifierType, Object requestedId) { -// super(type); -// this.identifierType = identifierType; -// this.requestedId = requestedId; -// } -// -// public EntityAlreadyExistsException(Class type, IdentifierType identifierType, String identifierName, Object requestedId) { -// super(type); -// this.identifierType = identifierType; -// this.identifierName = identifierName != null ? identifierName : identifierType.getName(); -// this.requestedId = requestedId; -// } -//} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityLinkedException.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityLinkedException.java deleted file mode 100644 index bb44bff..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityLinkedException.java +++ /dev/null @@ -1,13 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.exception.model; - -import dev.fyloz.trial.colorrecipesexplorer.model.Model; - -/** - * Représente une exception qui sera lancée lorsqu'un objet du modèle qui est lié à un autre entité doit être supprimé - */ -public class EntityLinkedException extends ModelException { - - public EntityLinkedException(Class type) { - super(type); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityNotFoundException.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityNotFoundException.java deleted file mode 100644 index 5dac894..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/EntityNotFoundException.java +++ /dev/null @@ -1,39 +0,0 @@ -//package dev.fyloz.trial.colorrecipesexplorer.exception.model; -// -//import dev.fyloz.trial.colorrecipesexplorer.model.IModel; -//import lombok.Getter; -// -///** -// * Représente une exception qui sera lancée lorsqu'un objet du modèle n'est pas trouvé. -// */ -//@Getter -//public class EntityNotFoundException extends ModelException { -// -// /** -// * Le type d'identifiant utilisé -// */ -// private IdentifierType identifierType; -// -// /** -// * Le nom de l'identifiant utilisé (optionnel) -// */ -// private String identifierName; -// -// /** -// * La valeur de l'identifiant -// */ -// private Object requestedId; -// -// public EntityNotFoundException(Class type, IdentifierType identifierType, Object requestedId) { -// super(type); -// this.identifierType = identifierType; -// this.requestedId = requestedId; -// } -// -// public EntityNotFoundException(Class type, IdentifierType identifierType, String identifierName, Object requestedId) { -// super(type); -// this.identifierType = identifierType; -// this.identifierName = identifierName != null ? identifierName : identifierType.getName(); -// this.requestedId = requestedId; -// } -//} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/ModelException.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/ModelException.java deleted file mode 100644 index f259cfb..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/ModelException.java +++ /dev/null @@ -1,38 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.exception.model; - -import dev.fyloz.trial.colorrecipesexplorer.model.Model; - -/** - * Représente une exception qui sera déclenchée lors des opérations sur le modèle. - */ -public class ModelException extends RuntimeException { - - /** - * Le type de modèle qui est sujet à l'exception - */ - protected Class type; - - public ModelException(Class type) { - this.type = type; - } - - public Class getType() { - return type; - } - - public enum IdentifierType { - ID("id"), - NAME("name"), - OTHER(""); - - private String name; - - IdentifierType(String name) { - this.name = name; - } - - public String getName() { - return name; - } - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/NullIdentifierException.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/NullIdentifierException.java deleted file mode 100644 index e6157cf..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/exception/model/NullIdentifierException.java +++ /dev/null @@ -1,15 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.exception.model; - -import dev.fyloz.trial.colorrecipesexplorer.model.Model; - -public class NullIdentifierException extends ModelException { - - public NullIdentifierException(Class type) { - super(type); - } - - @Override - public String getMessage() { - return String.format("Un modèle de type '%s' avait un identifiant nécessaire null", type.getSimpleName()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/MaterialTypeEditorDto.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/MaterialTypeEditorDto.java deleted file mode 100644 index 4456b23..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/MaterialTypeEditorDto.java +++ /dev/null @@ -1,42 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.model.dto; - -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class MaterialTypeEditorDto { - - private Long id; - - private String oldName; - - private String name; - - private String oldPrefix; - - private String prefix; - - private boolean usePercentages; - - public MaterialTypeEditorDto(MaterialType materialType) { - this.id = materialType.getId(); - this.oldName = materialType.getName(); - this.name = materialType.getName(); - this.oldPrefix = materialType.getPrefix(); - this.prefix = materialType.getPrefix(); - this.usePercentages = materialType.getUsePercentages(); - } - - public MaterialType getMaterialType() { - return new MaterialType(id, name, prefix, usePercentages, false); - } - - public MaterialType getOldMaterialType() { - return new MaterialType(id, oldName, oldPrefix, usePercentages, false); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/MixFormDto.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/MixFormDto.java deleted file mode 100644 index 4e5b42c..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/MixFormDto.java +++ /dev/null @@ -1,26 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.model.dto; - -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@NoArgsConstructor -public class MixFormDto { - - private Recipe recipe; - - private String oldMixTypeName; - - private String mixTypeName; - - private MaterialType materialType; - - private List materials; - - private List quantities; - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/RecipeEditorFormDto.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/RecipeEditorFormDto.java deleted file mode 100644 index 90e617d..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/RecipeEditorFormDto.java +++ /dev/null @@ -1,39 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.model.dto; - -import dev.fyloz.trial.colorrecipesexplorer.model.Company; -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import lombok.Data; - -import java.time.LocalDate; -import java.util.List; - -@Data -public class RecipeEditorFormDto { - - private Long id; - - private String name; - - private Company company; - - private String description; - - private Integer sample; - - private LocalDate approbationDate; - - private String remark; - - private String note; - - private List step; - - public Recipe getRecipe() { - return new Recipe(id, name, company, description, "ffffff", (byte) 0, sample, approbationDate, remark, note); - } - - public Recipe update(Recipe original) { - return new Recipe(original.getId(), name, company, description, "ffffff", (byte) 0, sample, approbationDate, remark, note); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/RecipeExplorerFormDto.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/RecipeExplorerFormDto.java deleted file mode 100644 index 5168262..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/model/dto/RecipeExplorerFormDto.java +++ /dev/null @@ -1,14 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.model.dto; - -import lombok.Data; - -import java.util.Map; - -@Data -public class RecipeExplorerFormDto { - - private Long recipeId; - private Map locations; - private String note; - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/AbstractJavaNamedService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/AbstractJavaNamedService.java deleted file mode 100644 index 363996c..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/AbstractJavaNamedService.java +++ /dev/null @@ -1,29 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException; -import dev.fyloz.trial.colorrecipesexplorer.model.NamedModel; -import dev.fyloz.trial.colorrecipesexplorer.repository.NamedJpaRepository; - -abstract public class AbstractJavaNamedService> extends AbstractJavaService { - - public AbstractJavaNamedService(Class type) { - super(type); - } - - public boolean existsByName(String name) { - return repository.existsByName(name); - } - - public E getByName(String name) { - E found = repository.findByName(name); - if (found == null) throw new EntityNotFoundException(type, ModelException.IdentifierType.NAME, name); - - return found; - } - - public void deleteByName(String name) { - repository.deleteByName(name); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/AbstractJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/AbstractJavaService.java deleted file mode 100644 index 51beda2..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/AbstractJavaService.java +++ /dev/null @@ -1,157 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import dev.fyloz.trial.colorrecipesexplorer.config.Preferences; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.NullIdentifierException; -import dev.fyloz.trial.colorrecipesexplorer.model.Model; -import org.jetbrains.annotations.Nullable; -import org.slf4j.Logger; -import org.springframework.data.jpa.repository.JpaRepository; -import org.springframework.transaction.annotation.Transactional; - -import javax.validation.constraints.NotNull; -import java.util.Collection; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -public abstract class AbstractJavaService> implements IGenericJavaService { - - protected Logger logger = Preferences.logger; - protected R repository; - protected Class type; - - public AbstractJavaService(Class type) { - this.type = type; - } - - public R getRepository() { - return repository; - } - - @Override - public boolean existsById(Long id) { - return repository.existsById(id); - } - - /** - * Vérifie si une entité correspondant à un identifiant existe. - *

- * Méthode pour la compatibilité avec les services Kotlin. - * - * @param id L'identifiant de l'entité - * @return Si un entité correspondant à l'identifiant existe - */ - public boolean existsById(long id) { - return existsById(Long.valueOf(id)); - } - - /** - * Méthode utilitaire pour wrapper les entités nullables dans un Optional. - *

- * Méthode pour la compatibilité avec les repository Kotlin. - * - * @param entity L'entité nullable - * @return Un optional wrapper l'entité donnée - */ - protected Optional findOptional(@Nullable E entity) { - return Optional.ofNullable(entity); - } - - @Override - public E getById(Long id) { - Optional found = repository.findById(id); - if (found.isEmpty()) throw new EntityNotFoundException(type, EntityNotFoundException.IdentifierType.ID, id); - - return found.get(); - } - - /** - * Récupère l'entité de type T correspondant à un identifiant. - *

- * Méthode pour la compatibilité avec les services Kotlin. - * - * @param id L'identifiant de l'entité - * @return L'entité correspondant à l'identifiant - */ - public E getById(long id) { - return getById(Long.valueOf(id)); - } - - @Override - public List getAll() { - return repository.findAll(); - } - - @Override - public E save(@NotNull E entity) { - if (entity.getId() != null && existsById(entity.getId())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.ID, entity.getId()); - - return repository.save(entity); - } - - @Override - @Transactional - public Collection saveAll(@NotNull Collection entities) { - return entities - .stream() - .map(this::save) - .collect(Collectors.toList()); - } - - @Override - public E update(@NotNull E entity) { - if (entity.getId() == null) throw new NullIdentifierException(type); - if (!existsById(entity.getId())) - throw new EntityNotFoundException(type, ModelException.IdentifierType.ID, entity.getId()); - - return repository.save(entity); - } - - @Override - public void delete(@NotNull E entity) { - repository.delete(entity); - } - - @Override - public void deleteById(Long id) { - delete(getById(id)); - } - - /** - * Supprime une entité correspondant à l'identifiant. - *

- * Méthode pour la compatibilité avec les services Kotlin. - * - * @param id L'identifiant de l'entité à supprimer - */ - public void deleteById(long id) { - deleteById(Long.valueOf(id)); - } - - @Override - public void deleteAll(Collection entities) { - repository.deleteAll(entities); - } - - /** - * Transforme un objet en Json. - * - * @param obj L'objet à transformer - * @return L'objet sous forme de Json. - */ - public String asJson(Object obj) { - ObjectMapper objectMapper = new ObjectMapper(); - try { - return objectMapper.writeValueAsString(obj); - } catch (JsonProcessingException e) { - Preferences.logger.error("Une erreur est survenue lors de la transformation d'un objet en Json", e); - return null; - } - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/IGenericJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/IGenericJavaService.java deleted file mode 100644 index b0ae65b..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/IGenericJavaService.java +++ /dev/null @@ -1,77 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service; - -import dev.fyloz.trial.colorrecipesexplorer.model.Model; - -import java.util.Collection; -import java.util.List; - -public interface IGenericJavaService { - - /** - * Vérifie si une entité correspondant à un identifiant existe. - * - * @param id L'identifiant de l'entité - * @return Si un entité correspondant à l'identifiant existe - */ - boolean existsById(Long id); - - /** - * Récupère toutes les entités de type T. - * - * @return Toutes les entités de type T - */ - List getAll(); - - /** - * Récupère l'entité de type T correspondant à un identifiant. - * - * @param id L'identifiant de l'entité - * @return L'entité correspondant à l'identifiant - */ - T getById(Long id); - - /** - * Crée une entité. - * - * @param entity L'entité à créer - * @return L'entité créée - */ - T save(T entity); - - /** - * Crée plusieurs entités. - * - * @param entities Les entités à créer - * @return Les entités créées - */ - Collection saveAll(Collection entities); - - /** - * Met à jour une entité dans le stockage. - * - * @param entity L'entité à mettre à jour - * @return L'entité mise à jour - */ - T update(T entity); - - /** - * Supprime une entité. - * - * @param entity L'entité à supprimer - */ - void delete(T entity); - - /** - * Supprime une entité correspondant à l'identifiant. - * - * @param id L'identifiant de l'entité à supprimer - */ - void deleteById(Long id); - - /** - * Supprime plusieurs entités. - * - * @param entities Les entités à supprimer - */ - void deleteAll(Collection entities); -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/PasswordService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/PasswordService.java deleted file mode 100644 index f48b689..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/PasswordService.java +++ /dev/null @@ -1,17 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service; - -import java.util.ArrayList; -import java.util.List; - -public class PasswordService { - - private static List passwords = new ArrayList<>(); - - public static boolean isValid(String password) { - return passwords.contains(password); - } - - public static void addPassword(String password) { - passwords.add(password); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/FilesService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/FilesService.java deleted file mode 100644 index 426bb84..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/FilesService.java +++ /dev/null @@ -1,155 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.files; - -import dev.fyloz.trial.colorrecipesexplorer.config.Preferences; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.io.ResourceLoader; -import org.springframework.stereotype.Service; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.multipart.MultipartFile; - -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; - -@Service -public class FilesService { - - private ResourceLoader resources; - - @Autowired - public FilesService(ResourceLoader resources) { - this.resources = resources; - } - - /** - * Lit un fichier dans le dossier resources. - * - * @param path Le chemin vers la fichier (sans classpath:, depuis le dossier resources) - * @return Le contenu du fichier - */ - public String readResource(String path) { - String fullPath = String.format("classpath:%s", path); - try (InputStream stream = resources.getResource(fullPath).getInputStream()) { - return readInputStreamAsString(stream); - } catch (IOException e) { - e.printStackTrace(); - return null; - } - } - - /** - * Lit un InputStream et le transforme en String - * - * @param input L'InputStream - * @return Le InputStream transformé en String - * @throws IOException La transformation vers un String a échoué - */ - public String readInputStreamAsString(InputStream input) throws IOException { - byte[] data = FileCopyUtils.copyToByteArray(input); - return new String(data, StandardCharsets.UTF_8); - } - - /** - * Récupère le contenu d'un fichier dans un tableau de Byte. - * - * @param path Le chemin vers le fichier - * @return Le contenu du fichier dans un tableau de Byte - * @throws IOException La lecture du fichier a échoué - */ - public byte[] readAsBytes(String path) throws IOException { - return Files.readAllBytes(Paths.get(path)); - } - - /** - * Récupère le contenu d'un fichier dans une liste de String. - * - * @param path Le chemin vers le fichier - * @return Le contenu du fichier dans une liste de String - * @throws IOException La lecture du fichier a échoué - */ - public List readAsStrings(String path) throws IOException { - return Files.readAllLines(Paths.get(path)); - } - - /** - * Écrit un fichier Multipart sur le disque. - * - * @param multipartFile Le fichier à écrire - * @param path Le chemin vers le fichier - * @return Si le fichier a bien été créé - */ - public boolean write(MultipartFile multipartFile, String path) { - if (multipartFile.getSize() <= 0) return true; - - try { - File file = create(path); - multipartFile.transferTo(file.toPath()); - return true; - } catch (IOException ex) { - Preferences.logger.error("Impossible d'écrire un fichier Multipart: " + ex.getMessage()); - return false; - } - } - - /** - * Crée un fichier sur le disque. - * - * @param path Le chemin vers le fichier - * @return Le fichier créé - * @throws IOException La création du fichier échoue - */ - public File create(String path) throws IOException { - File file = getFile(path); - - try { - if (!file.exists() || file.isDirectory()) { - Files.createDirectories(file.getParentFile().toPath()); - Files.createFile(file.toPath()); - } - - return file; - } catch (IOException ex) { - throw new RuntimeException("Impossible de créer un fichier: ", ex); - } - } - - /** - * Supprime un fichier sur le disque. - * - * @param path Le chemin vers le fichier - */ - public void delete(String path) { - File file = getFile(path); - - try { - if (file.exists() && !file.isDirectory()) Files.delete(file.toPath()); - } catch (IOException ex) { - throw new RuntimeException("Impossible de supprimer un fichier: " + ex.getMessage()); - } - } - - /** - * Vérifie si un fichier existe sur le disque. - * - * @param path Le chemin vers le fichier - * @return Si le fichier existe - */ - public boolean exists(String path) { - File file = getFile(path); - - return file.exists() && !file.isDirectory(); - } - - public File getFile(String path) { - return new File(path); - } - - public String getPath(String fileName) { - return String.format("%s/%s", Preferences.uploadDirectory, fileName); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/ImagesService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/ImagesService.java deleted file mode 100644 index 167ead5..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/ImagesService.java +++ /dev/null @@ -1,80 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.files; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import javax.imageio.ImageIO; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; - -@Service -public class ImagesService { - - private static final String IMAGES_DIRECTORY = "images"; - - private FilesService filesService; - - @Autowired - public ImagesService(FilesService filesService) { - this.filesService = filesService; - } - - /** - * Lit une image. - * - * @param name Le nom de l'image - * @return Le contenu de l'image - */ - public byte[] read(String name) { - try { - return filesService.readAsBytes(getPath(name)); - } catch (IOException ex) { - throw new RuntimeException("Erreur lors de la lecture d'une image: " + ex.getMessage()); - } - } - - /** - * Écrit des données image sur le disque. - * - * @param image Le contenu du fichier - * @param name Le nom de l'image - * @return Si l'écriture du fichier s'est achevée - */ - public boolean write(MultipartFile image, String name) { - return filesService.write(image, getPath(name)); - } - - /** - * Supprime un fichier image. - * - * @param name Le nom de l'image - */ - public void delete(String name) { - filesService.delete(getPath(name)); - } - - /** - * Vérifie si un InputStream contient une image. - * - * @param input L'InputStream - * @return Si l'InputStream contient une image - */ - public boolean isImage(InputStream input) { - try { - return !(ImageIO.read(input) == null); - } catch (IOException ex) { - throw new RuntimeException("Erreur lors de la vérification d'une image: " + ex.getMessage()); - } - } - - public File getDirectoryFile() { - return new File(getPath("")); - } - - private String getPath(String name) { - return filesService.getPath(String.format("%s/%s", IMAGES_DIRECTORY, name)); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/MarkdownFilesService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/MarkdownFilesService.java deleted file mode 100644 index 714d404..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/MarkdownFilesService.java +++ /dev/null @@ -1,35 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.files; - -import org.commonmark.node.Node; -import org.commonmark.parser.Parser; -import org.commonmark.renderer.html.HtmlRenderer; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class MarkdownFilesService { - - private FilesService filesService; - - @Autowired - public MarkdownFilesService(FilesService filesService) { - this.filesService = filesService; - } - - /** - * Lit et fait le rendu en HTML d'un fichier MarkDown. - * - * @param path Le chemin vers la fichier (sans classpath:, depuis le dossier resources) - * @return Le MarkDown rendu en HTML - */ - public String render(String path) { - String fileContent = filesService.readResource(path); - - Parser parser = Parser.builder().build(); - Node document = parser.parse(fileContent); - HtmlRenderer renderer = HtmlRenderer.builder().build(); - - return renderer.render(document); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/SimdutService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/SimdutService.java deleted file mode 100644 index 48df284..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/SimdutService.java +++ /dev/null @@ -1,130 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.files; - -import dev.fyloz.trial.colorrecipesexplorer.exception.SimdutException; -import dev.fyloz.trial.colorrecipesexplorer.model.Material; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - -import java.io.IOException; - -@Service -public class SimdutService { - - private static final String SIMDUT_DIRECTORY = "simdut"; - - private FilesService filesService; - private MaterialJavaService materialService; - - @Autowired - public SimdutService(FilesService filesService) { - this.filesService = filesService; - } - - @Autowired - @Lazy - public void setMaterialService(MaterialJavaService materialService) { - this.materialService = materialService; - } - - /** - * Vérifie si un produit a un fichier SIMDUT. - * - * @param material Le produit - * @return Si le produit a un fichier SIMDUT - */ - public boolean exists(Material material) { - return filesService.exists(getPath(material)); - } - - /** - * Vérifie si le produit correspondant à un identifiant a un fichier SIMDUT. - * - * @param id L'identifiant du produit - * @return si le produit correspondant à l'identifiant a un fichier SIMDUT - */ - public boolean exists(Long id) { - return exists(materialService.getById(id)); - } - - /** - * Lit le fichier SIMDUT d'un produit et retourne son contenu. - * - * @param material Le produit - * @return Le contenu du fichier SIMDUT du produit - */ - public byte[] read(Material material) { - String path = getPath(material); - - if (!filesService.exists(path)) return new byte[0]; - - try { - return filesService.readAsBytes(path); - } catch (IOException ex) { - throw new RuntimeException("Impossible de lire un fichier SIMDUT: " + ex.getMessage()); - } - } - - /** - * Lit le fichier SIMDUT du produit correspondant à un identifiant et retourne son contenu. - * - * @param id L'identifiant du produit - * @return Le contenu du fichier SIMDUT du produit correspondant à l'identifiant - */ - public byte[] read(Long id) { - return read(materialService.getById(id)); - } - - /** - * Écrit le fichier SIMDUT d'un produit. - * - * @param material Le produit - * @param simdut Le contenu du fichier SIMDUT à écrire - */ - public void write(Material material, MultipartFile simdut) { - if (!filesService.write(simdut, getPath(material))) throw new SimdutException(material); - } - - /** - * Met à jour le fichier SIMDUT d'un produit - * - * @param simdut Le contenu du fichier SIMDUT mis à jour - * @param material Le produit du SIMDUT - */ - public void update(MultipartFile simdut, Material material) { - delete(material); - write(material, simdut); - } - - /** - * Supprime le fichier SIMDUT pour un produit. - * - * @param material Le produit - */ - public void delete(Material material) { - filesService.delete(getPath(material)); - } - - /** - * Récupère le chemin vers le fichier SIMDUT d'un produit. - * - * @param material Le produit - * @return Le chemin vers le fichier SIMDUT du produit - */ - private String getPath(Material material) { - return filesService.getPath(String.format("%s/%s", SIMDUT_DIRECTORY, getSimdutFileName(material))); - } - - /** - * Récupère le nom du fichier SIMDUT d'un produit. - * - * @param material Le produit - * @return Le nom du fichier SIMDUT du produit - */ - public String getSimdutFileName(Material material) { - return String.valueOf(material.getId()); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/XlsService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/XlsService.java index e036e06..adb98ba 100644 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/XlsService.java +++ b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/files/XlsService.java @@ -1,9 +1,9 @@ package dev.fyloz.trial.colorrecipesexplorer.service.files; -import dev.fyloz.trial.colorrecipesexplorer.config.Preferences; import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService; +import dev.fyloz.trial.colorrecipesexplorer.service.RecipeService; import dev.fyloz.trial.colorrecipesexplorer.xlsx.XlsxExporter; +import org.slf4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -16,11 +16,13 @@ import java.util.zip.ZipOutputStream; @Service public class XlsService { - private RecipeJavaService recipeService; + private RecipeService recipeService; + private Logger logger; @Autowired - public XlsService(RecipeJavaService recipeService) { + public XlsService(RecipeService recipeService, Logger logger) { this.recipeService = recipeService; + this.logger = logger; } /** @@ -30,7 +32,7 @@ public class XlsService { * @return Le fichier XLS de la recette */ public byte[] generate(Recipe recipe) { - return new XlsxExporter().generate(recipe); + return new XlsxExporter(logger).generate(recipe); } /** @@ -49,7 +51,7 @@ public class XlsService { * @return Le fichier ZIP contenant tous les fichiers XLS */ public byte[] generateForAll() throws IOException { - Preferences.logger.info("Exportation de toutes les couleurs en XLS"); + logger.info("Exportation de toutes les couleurs en XLS"); byte[] zipContent; Collection recipes = recipeService.getAll(); diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/CompanyJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/CompanyJavaService.java deleted file mode 100644 index c88cf0f..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/CompanyJavaService.java +++ /dev/null @@ -1,75 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.model; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.EntityLinkedException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException; -import dev.fyloz.trial.colorrecipesexplorer.model.Company; -import dev.fyloz.trial.colorrecipesexplorer.repository.CompanyRepository; -import dev.fyloz.trial.colorrecipesexplorer.service.AbstractJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.stereotype.Service; - -import javax.validation.constraints.NotNull; - -@Service -public class CompanyJavaService extends AbstractJavaService { - - private RecipeJavaService recipeService; - - public CompanyJavaService() { - super(Company.class); - } - - @Autowired - public void setCompanyDao(CompanyRepository companyRepository) { - this.repository = companyRepository; - } - - // Pour éviter les dépendances circulaires - @Autowired - @Lazy - public void setRecipeService(RecipeJavaService recipeService) { - this.recipeService = recipeService; - } - - /** - * Vérifie si une bannière correspondant à un nom existe. - * - * @param name Le nom de la bannière - * @return Si une bannière correspondant au nome existe - */ - public boolean existsByName(String name) { - return repository.existsByName(name); - } - - /** - * Vérifie si une bannière est liée à une recette. - * - * @param company La bannière - * @return Si la bannière est liée à une recette - */ - public boolean isLinkedToRecipes(Company company) { - return recipeService.existsByCompany(company); - } - - @Override - public Company save(@NotNull Company entity) { - if (existsByName(entity.getName())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.NAME, entity.getName()); - - return super.save(entity); - } - - @Override - public void delete(Company entity) { - if (isLinkedToRecipes(entity)) throw new EntityLinkedException(type); - - super.delete(entity); - } - - @Deprecated(since = "1.3.0", forRemoval = true) - public void deleteIfNotLinked(Company company) { - if (!isLinkedToRecipes(company)) delete(company); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MaterialJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MaterialJavaService.java deleted file mode 100644 index 482b2f0..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MaterialJavaService.java +++ /dev/null @@ -1,109 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.model; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException; -import dev.fyloz.trial.colorrecipesexplorer.model.Material; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialSaveDto; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialUpdateDto; -import dev.fyloz.trial.colorrecipesexplorer.repository.MaterialRepository; -import dev.fyloz.trial.colorrecipesexplorer.service.AbstractJavaNamedService; -import dev.fyloz.trial.colorrecipesexplorer.service.files.SimdutService; -import org.jetbrains.annotations.NotNull; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Collectors; - -@Service -public class MaterialJavaService extends AbstractJavaNamedService { - - private MixMaterialJavaService mixQuantityService; - private SimdutService simdutService; - - public MaterialJavaService() { - super(Material.class); - } - - @Autowired - public void setMaterialDao(MaterialRepository materialRepository) { - this.repository = materialRepository; - } - - @Autowired - public void setMixQuantityService(MixMaterialJavaService mixQuantityService) { - this.mixQuantityService = mixQuantityService; - } - - @Autowired - public void setSimdutService(SimdutService simdutService) { - this.simdutService = simdutService; - } - - /** - * Vérifie si des produits sont d'un type de produit - * - * @param materialType Le type de produit - * @return Si des produits sont du type de produit - */ - public boolean existsByMaterialType(MaterialType materialType) { - return repository.existsByMaterialType(materialType); - } - - /** - * Vérifie si un produit est lié à un ou plusieurs mélanges. - * - * @param material Le produit à vérifier. - * @return Si le produit est lié à d'autres mélanges. - */ - public boolean isLinkedToMixes(Material material) { - return mixQuantityService.existsByMaterial(material); - } - - /** - * Récupère tous les produits qui ne sont pas des types de mélange. - * - * @return Tous les produits qui ne sont pas des types de mélange - */ - @NotNull - public List getAllNotMixType() { - return getAll() - .stream() - .filter(m -> !m.isMixType()) - .collect(Collectors.toList()); - } - - public Material save(MaterialSaveDto material) { - if (existsByName(material.getName())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.NAME, material.getName()); - Material saved = save(material.toMaterial()); - if (material.getSimdutFile() != null && !material.getSimdutFile().isEmpty()) - simdutService.write(saved, material.getSimdutFile()); - return saved; - } - - @Override - public Material update(Material material) { - Optional materialByName = findOptional(repository.findByName(material.getName())); - if (materialByName.isPresent() && !Objects.equals(material.getId(), materialByName.get().getId())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.NAME, material.getName()); - - return super.update(material); - } - - public Material update(MaterialUpdateDto material) { - simdutService.update(material.getSimdutFile(), material.toMaterial()); - return update(material.toMaterial()); - } - - @Override - public void delete(Material material) { - simdutService.delete(material); - - super.delete(material); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MaterialTypeJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MaterialTypeJavaService.java deleted file mode 100644 index 0a93f52..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MaterialTypeJavaService.java +++ /dev/null @@ -1,152 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.model; - -import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteDefaultMaterialTypeException; -import dev.fyloz.trial.colorrecipesexplorer.exception.CannotEditDefaultMaterialTypeException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.MaterialTypeEditorDto; -import dev.fyloz.trial.colorrecipesexplorer.repository.MaterialTypeRepository; -import dev.fyloz.trial.colorrecipesexplorer.service.AbstractJavaService; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialTypeKt; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.validation.constraints.NotNull; -import java.util.LinkedList; -import java.util.List; -import java.util.Optional; -import java.util.stream.Collectors; - -@Service -public class MaterialTypeJavaService extends AbstractJavaService { - - private MaterialJavaService materialService; - - private List defaultMaterialTypes = new LinkedList<>(); - - public MaterialTypeJavaService() { - super(MaterialType.class); - } - - @Autowired - public void setMaterialTypeDao(MaterialTypeRepository materialTypeRepository) { - this.repository = materialTypeRepository; - } - - @Autowired - public void setMaterialService(MaterialJavaService materialService) { - this.materialService = materialService; - } - - public void setDefaultMaterialTypes(List defaultMaterialTypes) { - this.defaultMaterialTypes = defaultMaterialTypes; - } - - /** - * Ajoute un type de produit dans les types de produit par défaut. - * - * @param materialType Le type de produit - */ - public void addDefault(MaterialType materialType) { - defaultMaterialTypes.add(materialType); - } - - /** - * Vérifie si un type de produit est un type de produit par défaut. - * - * @param materialType Le type de produit - * @return Si le type de produite est un type de produit par défaut - */ - public boolean isDefault(MaterialType materialType) { - return defaultMaterialTypes.contains(materialType); - } - - /** - * Vérifie si un type de produit correspondant à un nom existe. - * - * @param name Le nom à vérifier - * @return Si un type de produit ayant le nom existe - */ - public boolean existsByName(String name) { - return repository.existsByName(name); - } - - /** - * Vérifie si un type de produit correspondant à un préfixe existe. - * - * @param prefix Le préfixe à vérifier - * @return Si un type de produit ayant le préfixe existe - */ - public boolean existsByPrefix(String prefix) { - return repository.existsByPrefix(prefix); - } - - /** - * Vérifie si un type de produit est utilisé par des produits. - * - * @param materialType Le type de produit - * @return si le type de produit est utilisé par des produits. - */ - public boolean isLinkedToMaterials(MaterialType materialType) { - return materialService.existsByMaterialType(materialType); - } - - /** - * Récupère tous les type de produits qui ne sont pas des types de produit. - * - * @return Tous les type de produits qui ne sont pas des types de produit - */ - public List getAllNotDefault() { - return getAll().stream() - .filter(t -> !isDefault(t)) - .collect(Collectors.toList()); - } - - /** - * Récupère un type de produit par son nom. - * - * @param name Le nom du type de produit à récupérer - * @return Le type de produit correspondant au nom. - */ - public MaterialType getByName(String name) { - Optional found = findOptional(repository.findByName(name)); - if (found.isEmpty()) - throw new EntityNotFoundException(type, ModelException.IdentifierType.NAME, name); - - return found.get(); - } - - @Override - public MaterialType save(@NotNull MaterialType materialType) { - if (existsByName(materialType.getName())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.NAME, materialType.getName()); - if (existsByPrefix(materialType.getPrefix())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.OTHER, MaterialTypeKt.IDENTIFIER_PREFIX_NAME, materialType.getPrefix()); - - return super.save(materialType); - } - - public MaterialType update(MaterialTypeEditorDto materialTypeDto) { - MaterialType materialType = materialTypeDto.getMaterialType(); - - if (isDefault(materialTypeDto.getOldMaterialType())) - throw new CannotEditDefaultMaterialTypeException(materialTypeDto); - if (!existsByName(materialTypeDto.getOldName())) - throw new EntityNotFoundException(type, ModelException.IdentifierType.NAME, materialTypeDto.getOldName()); - if (!materialTypeDto.getOldName().equals(materialType.getName()) && existsByName(materialType.getName())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.NAME, materialType.getName()); - if (!materialTypeDto.getOldPrefix().equals(materialType.getPrefix()) && existsByPrefix(materialType.getPrefix())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.OTHER, MaterialTypeKt.IDENTIFIER_PREFIX_NAME, materialType.getPrefix()); - - return super.update(materialType); - } - - @Override - public void delete(MaterialType materialType) { - if (isDefault(materialType)) throw new CannotDeleteDefaultMaterialTypeException(materialType); - - super.delete(materialType); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixJavaService.java deleted file mode 100644 index bb1ffb8..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixJavaService.java +++ /dev/null @@ -1,141 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.model; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException; -import dev.fyloz.trial.colorrecipesexplorer.model.*; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.MixFormDto; -import dev.fyloz.trial.colorrecipesexplorer.repository.MixRepository; -import dev.fyloz.trial.colorrecipesexplorer.service.AbstractJavaService; -import dev.fyloz.trial.colorrecipesexplorer.utils.MixBuilder; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.Collection; -import java.util.Comparator; -import java.util.stream.Collectors; - -@Service -public class MixJavaService extends AbstractJavaService { - - private MaterialJavaService materialService; - private MixMaterialJavaService mixQuantityService; - private MixTypeJavaService mixTypeService; - - public MixJavaService() { - super(Mix.class); - } - - @Autowired - public void setMixDao(MixRepository mixRepository) { - this.repository = mixRepository; - } - - @Autowired - public void setMaterialService(MaterialJavaService materialService) { - this.materialService = materialService; - } - - @Autowired - public void setMixQuantityService(MixMaterialJavaService mixQuantityService) { - this.mixQuantityService = mixQuantityService; - } - - @Autowired - public void setMixTypeService(MixTypeJavaService mixTypeService) { - this.mixTypeService = mixTypeService; - } - - /** - * Récupère les produits disponibles pour un mélange. - * Le mélange peut ne pas exister. - * - * @param recipe La recette dans laquelle se trouve le mélange - * @param mixId L'identifiant du mélange (-1 si le mélange n'existe pas) - * @return Les produits disponibles pour ce mélange - */ - public Collection getAvailableMaterialsForMixId(Recipe recipe, Long mixId) { - return existsById(mixId) ? getAvailableMaterialsForMix(getById(mixId)) : getAvailableMaterialsForNewMix(recipe); - } - - /** - * Récupère les produits disponibles pour un mélange existant. - * ` - * - * @param mix Le mélange - * @return Les produits disponibles pour ce mélange - */ - public Collection getAvailableMaterialsForMix(Mix mix) { - return getAvailableMaterialsForNewMix(mix.getRecipe()) - .stream() - .filter(m -> !m.equals(mix.getMixType().getMaterial())) - .collect(Collectors.toList()); - } - - /** - * Récupère les produits disponibles pour un mélange inexistant. - * - * @param recipe La recette dans laquelle se trouve le mélange - * @return Les produits disponibles pour le nouveau mélange - */ - public Collection getAvailableMaterialsForNewMix(Recipe recipe) { - Collection recipeMixTypes = recipe.getMixTypes(); - - return materialService - .getAll() - .stream() - .filter(m -> !m.isMixType() || recipeMixTypes.contains(mixTypeService.getByMaterial(m))) - .sorted(Comparator.comparing(Material::getName)) - .sorted(Comparator.comparing(m -> m.getMaterialType().getName())) - .collect(Collectors.toList()); - } - - @Transactional - public void save(MixFormDto formDto) { - Mix mix = new MixBuilder(mixTypeService, materialService) - .withDto(formDto) - .build(); - - if (mix.getRecipe().containsMixType(mix.getMixType())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.OTHER, MixKt.IDENTIFIER_MIX_TYPE_NAME, mix.getMixType().getName()); - - mixTypeService.save(mix.getMixType()); - save(mix); - } - - public void update(Mix mix, MixFormDto formDto) { - mix = new MixBuilder(mixTypeService, materialService) - .withMix(mix) - .withDto(formDto) - .build(); - - MixType mixType = mix.getMixType(); - - if (!formDto.getOldMixTypeName().equals(mixType.getName()) && mixTypeService.existsByName(formDto.getMixTypeName()) && mix.getRecipe().containsMixType(mixType)) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.OTHER, MixKt.IDENTIFIER_MIX_TYPE_NAME, mix.getMixType().getName()); - - if (materialService.existsByName(mixType.getName()) && !materialService.getByName(mixType.getName()).isMixType()) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.OTHER, MixTypeKt.IDENTIFIER_MATERIAL_NAME, mixType.getName()); - - mixTypeService.update(mixType); - update(mix); - } - - @Deprecated(since = "1.3.0", forRemoval = true) - public void deleteMix(Mix mix) { - mixQuantityService.deleteAll(mix.getMixMaterials()); - delete(mix); - } - - @Override - public void delete(Mix mix) { - mixQuantityService.deleteAll(mix.getMixMaterials()); - - super.delete(mix); - } - - @Override - public void deleteById(Long id) { - delete(getById(id)); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixMaterialJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixMaterialJavaService.java deleted file mode 100644 index caf5f84..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixMaterialJavaService.java +++ /dev/null @@ -1,31 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.model; - -import dev.fyloz.trial.colorrecipesexplorer.model.Material; -import dev.fyloz.trial.colorrecipesexplorer.model.MixMaterial; -import dev.fyloz.trial.colorrecipesexplorer.repository.MixMaterialRepository; -import dev.fyloz.trial.colorrecipesexplorer.service.AbstractJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -@Service -public class MixMaterialJavaService extends AbstractJavaService { - - public MixMaterialJavaService() { - super(MixMaterial.class); - } - - @Autowired - public void setMixQuantityDao(MixMaterialRepository mixMaterialRepository) { - this.repository = mixMaterialRepository; - } - - /** - * Vérifie s'il y a un mélange qui contient un produit. - * - * @param material Le produit - * @return S'il y a un mélange qui contient le produit - */ - public boolean existsByMaterial(Material material) { - return repository.existsByMaterial(material); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixTypeJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixTypeJavaService.java deleted file mode 100644 index dffd318..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/MixTypeJavaService.java +++ /dev/null @@ -1,99 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.model; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException; -import dev.fyloz.trial.colorrecipesexplorer.model.Material; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import dev.fyloz.trial.colorrecipesexplorer.model.MixType; -import dev.fyloz.trial.colorrecipesexplorer.model.MixTypeKt; -import dev.fyloz.trial.colorrecipesexplorer.repository.MixTypeRepository; -import dev.fyloz.trial.colorrecipesexplorer.service.AbstractJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import javax.validation.constraints.NotNull; -import java.util.Optional; - -@Service -public class MixTypeJavaService extends AbstractJavaService { - - private MaterialJavaService materialService; - - public MixTypeJavaService() { - super(MixType.class); - } - - @Autowired - public void setMixTypeDao(MixTypeRepository mixTypeRepository) { - this.repository = mixTypeRepository; - } - - @Autowired - public void setMaterialService(MaterialJavaService materialService) { - this.materialService = materialService; - } - - /** - * Vérifie si un type de mélange correspondant à un nom existe. - * - * @param name Le nom du type de mélange - * @return Si un type de mélange correspondant au nom existe - */ - public boolean existsByName(String name) { - return repository.existsByName(name); - } - - /** - * Récupère le type de mélange correspondant à un nom. - * - * @param name Le nom du type de mélange - * @return Le type de mélange correspondant au nom - */ - public MixType getByName(String name) { - Optional found = findOptional(repository.findByName(name)); - if (found.isEmpty()) throw new EntityNotFoundException(type, ModelException.IdentifierType.NAME, name); - - return found.get(); - } - - /** - * Récupère le type de mélange correspondant à un produit. - * - * @param material Le produit du type de mélange - * @return Le type de mélange correspondant au produit - */ - public MixType getByMaterial(Material material) { - Optional found = findOptional(repository.findByMaterial(material)); - if (found.isEmpty()) - throw new EntityNotFoundException(type, ModelException.IdentifierType.OTHER, material); - - return found.get(); - } - - /** - * Crée un type de mélange. - * - * @param name Le nom du type de mélange - * @param materialType Le type de produit du type de mélange - * @return Le type de mélange créé - */ - public MixType create(String name, MaterialType materialType) { - Material mixTypeMaterial = new Material(name, 0f, true, materialType); - return new MixType(name, mixTypeMaterial); - } - - @Override - public MixType save(@NotNull MixType entity) { - if (materialService.existsByName(entity.getName())) - throw new EntityAlreadyExistsException(type, ModelException.IdentifierType.OTHER, MixTypeKt.IDENTIFIER_MATERIAL_NAME, entity.getName()); - - return super.save(entity); - } - - @Override - public MixType update(MixType mixType) { - - return super.update(mixType); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/RecipeJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/RecipeJavaService.java deleted file mode 100644 index 9694379..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/RecipeJavaService.java +++ /dev/null @@ -1,199 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.model; - -import dev.fyloz.trial.colorrecipesexplorer.model.Company; -import dev.fyloz.trial.colorrecipesexplorer.model.Mix; -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.RecipeEditorFormDto; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.RecipeExplorerFormDto; -import dev.fyloz.trial.colorrecipesexplorer.repository.RecipeRepository; -import dev.fyloz.trial.colorrecipesexplorer.service.AbstractJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.files.ImagesService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.io.File; -import java.util.*; -import java.util.stream.Collectors; - -@Service -public class RecipeJavaService extends AbstractJavaService { - - private CompanyJavaService companyService; - private MixJavaService mixService; - private RecipeStepJavaService stepService; - private ImagesService imagesService; - - public RecipeJavaService() { - super(Recipe.class); - } - - @Autowired - public void setRecipeDao(RecipeRepository recipeRepository) { - this.repository = recipeRepository; - } - - @Autowired - public void setCompanyService(CompanyJavaService companyService) { - this.companyService = companyService; - } - - @Autowired - public void setMixService(MixJavaService mixService) { - this.mixService = mixService; - } - - @Autowired - public void setStepService(RecipeStepJavaService stepService) { - this.stepService = stepService; - } - - @Autowired - public void setImagesService(ImagesService imagesService) { - this.imagesService = imagesService; - } - - /** - * Vérifie s'il y a une recette liée à une compagnie. - * - * @param company La compagnie - * @return S'il y a une recette liée à la compagnie - */ - public boolean existsByCompany(Company company) { - return repository.existsByCompany(company); - } - - /** - * Récupère toutes les recettes pour une compagnie. - * - * @param company La compagnie - * @return Toutes les recettes pour la compagnie - */ - public Collection getAllByCompany(Company company) { - return repository.findAllByCompany(company); - } - - /** - * Récupère toutes les recettes dans la base de données et les classes par compagnie. - * - * @return Un Map contenant les recettes classées par compagnie. - */ - public Map> getAllMappedByCompany() { - return companyService.getAll().stream() - .collect(Collectors.toMap(c -> c, this::getAllByCompany)); - } - - /** - * Met à jour une recette ainsi que ses étapes. - * - * @param recipeDto Les informations de la recette à mettre à jour - * @return La recette mise à jour - */ - @Transactional - public Recipe updateRecipeAndSteps(RecipeEditorFormDto recipeDto) { - Recipe recipe = recipeDto.update(getById(recipeDto.getId())); - - stepService.deleteAll(recipe.getSteps()); - recipe.setSteps(stepService.createAllForRecipe(recipe, recipeDto.getStep())); - - return update(recipe); - } - - /** - * Met à jour les informations d'une recette trouvées dans l'explorateur de recette. - * - * @param form Le formulaire contenant les données mises à jour - */ - @Transactional - public void updateRecipeExplorerInfos(RecipeExplorerFormDto form) { - long recipeId = form.getRecipeId(); - Map locations = form.getLocations(); - String note = form.getNote(); - - Recipe recipe = getById(recipeId); - - // Note - recipe.setNote(note); - update(recipe); - - // Casiers - for (Map.Entry location : locations.entrySet()) { - Mix mix = mixService.getById(location.getKey()); - mix.setLocation(location.getValue()); - mixService.update(mix); - } - } - - @Override - public void delete(Recipe recipe) { - super.delete(recipe); - removeAllFiles(recipe); - } - - /** - * Récupère le nom des images liées à une recette. - * - * @param recipe La recette dont on veut récupérer les images - * @return Une liste contenant le nom des images liées à la recette. - */ - public List getImageFiles(Recipe recipe) { - String imageName = getImageFileName(recipe); - File[] allImages = imagesService.getDirectoryFile().listFiles((d, n) -> n.startsWith(imageName)); - - if (allImages == null) return new ArrayList<>(); - return Arrays.stream(allImages).map(File::getName).collect(Collectors.toList()); - } - - /** - * Récupère l'index de la prochaine image pour une recette. - * - * @param recipe La recette - * @return L'index de la prochaine image pour la recette - */ - public int getNextImageIndex(Recipe recipe) { - String imageName = getImageFileName(recipe); - List allImages = getImageFiles(recipe); - List indexes = allImages.stream().map(i -> Integer.parseInt(i.replace(imageName + "-", "").replace(".jpeg", ""))).collect(Collectors.toList()); - return indexes.size() > 0 ? Collections.max(indexes) + 1 : 0; - } - - /** - * Récupère le nom des fichiers image d'une recette. - * - * @param recipe La recette - * @return Le nom des fichiers image de la recette - */ - public String getImageFileName(Recipe recipe) { - return recipe.getId().toString(); - } - - /** - * Récupère le nom du fichier image d'une recette avec le prochain index disponible. - * - * @param recipe La recette - * @return Le nom du fichier image de la recette avec le prochain index disponible - */ - public String getImageFileNameWithIndex(Recipe recipe) { - return getImageFileNameWithIndex(recipe, getNextImageIndex(recipe)); - } - - /** - * Récupère le nom du fichier image d'une recette avec un index. - * - * @param recipe La recette - * @param index L'index du fichier image - * @return Le nom du fichier image de la recette avec l'index - */ - public String getImageFileNameWithIndex(Recipe recipe, int index) { - return String.format("%s-%s", getImageFileName(recipe), index); - } - - /** - * Supprime tous les fichiers image d'une recette. - * - * @param recipe La recette - */ - private void removeAllFiles(Recipe recipe) { - getImageFiles(recipe).forEach(f -> imagesService.delete(f)); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/RecipeStepJavaService.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/RecipeStepJavaService.java deleted file mode 100644 index 6337394..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/service/model/RecipeStepJavaService.java +++ /dev/null @@ -1,46 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.service.model; - -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import dev.fyloz.trial.colorrecipesexplorer.model.RecipeStep; -import dev.fyloz.trial.colorrecipesexplorer.repository.RecipeStepRepository; -import dev.fyloz.trial.colorrecipesexplorer.service.AbstractJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; -import java.util.stream.Collectors; - -@Service -public class RecipeStepJavaService extends AbstractJavaService { - - public RecipeStepJavaService() { - super(RecipeStep.class); - } - - @Autowired - public void setStepDao(RecipeStepRepository recipeStepRepository) { - this.repository = recipeStepRepository; - } - - /** - * Crée une étape pour une recette. - * - * @param recipe La recette - * @param message Le message de l'étape à créer - */ - public RecipeStep createForRecipe(Recipe recipe, String message) { - return new RecipeStep(recipe, message); - } - - /** - * Crée toutes les étapes pour une recette. - * - * @param recipe La recette - * @param messages Tous les messages des étapes à créer - */ - @Transactional - public List createAllForRecipe(Recipe recipe, List messages) { - return messages.stream().map(m -> createForRecipe(recipe, m)).collect(Collectors.toList()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/ControllerUtils.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/ControllerUtils.java deleted file mode 100644 index c864f0d..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/ControllerUtils.java +++ /dev/null @@ -1,64 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.utils; - -import dev.fyloz.trial.colorrecipesexplorer.config.Preferences; -import org.springframework.web.context.request.RequestContextHolder; -import org.springframework.web.context.request.ServletRequestAttributes; - -import javax.servlet.http.HttpServletRequest; -import java.net.URI; -import java.net.URISyntaxException; - -public class ControllerUtils { - - private static final String HTTP_SCHEME = "http"; - private static final String HTTPS_SCHEME = "https"; - - public static String redirect(String viewName) { - return String.format("redirect:/%s", viewName); - } - - public static URI getUri(HttpServletRequest request) throws URISyntaxException { - return new URI(request.getRequestURL().toString()); - } - - public static String getUrlFromURI(URI uri) { - String host = uri.getHost(); - int port = uri.getPort(); - String scheme = getScheme(); - - return String.format("%s://%s:%s", scheme, host, port); - } - - public static String getCurrentBaseUrl() { - ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); - if (attributes == null) return ""; - - HttpServletRequest request = attributes.getRequest(); - - String port = ":" + (Preferences.urlUsePort ? request.getServerPort() : ""); - return String.format("%s://%s%s%s", getScheme(), request.getServerName(), port, request.getContextPath()); - } - - public static String getLatestUrl() { - ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes(); - if (attributes == null) return ""; - - HttpServletRequest request = attributes.getRequest(); - - try { - String currentDomainName = getUrlFromURI(getUri(request)); - String referer = request.getHeader("referer"); - if (referer == null) return currentDomainName; - - String refererURL = getUrlFromURI(new URI(referer)); - - return refererURL.equals(currentDomainName) ? referer : currentDomainName; - } catch (URISyntaxException e) { - return ""; - } - } - - private static String getScheme() { - return Preferences.urlUseHttps ? HTTPS_SCHEME : HTTP_SCHEME; - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/MixBuilder.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/MixBuilder.java deleted file mode 100644 index 2be227a..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/MixBuilder.java +++ /dev/null @@ -1,116 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.utils; - -import dev.fyloz.trial.colorrecipesexplorer.model.*; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.MixFormDto; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MixTypeJavaService; - -import java.util.*; - -public class MixBuilder { - - private MixTypeJavaService mixTypeService; - private MaterialJavaService materialService; - - private Long id; - private Recipe recipe; - private MixType mixType; - private String location; - private Collection mixMaterials = new ArrayList<>(); - - private Map quantities = new LinkedHashMap<>(); - - public MixBuilder(MixTypeJavaService mixTypeService, MaterialJavaService materialService) { - this.mixTypeService = mixTypeService; - this.materialService = materialService; - } - - public MixBuilder withMix(Mix mix) { - this.id = mix.getId(); - this.recipe = mix.getRecipe(); - this.mixType = mix.getMixType(); - this.location = mix.getLocation(); - this.mixMaterials = mix.getMixMaterials(); - - return this; - } - - public MixBuilder withDto(MixFormDto dto) { - String mixTypeName = dto.getMixTypeName(); - - if (this.mixType == null) { - this.mixType = mixTypeService.create(mixTypeName, dto.getMaterialType()); - } else { - this.mixType = new MixType(this.mixType.getId(), this.mixType.getName(), this.mixType.getMaterial()); - - if (materialService.existsByName(mixTypeName)) { - this.mixType.setName(mixTypeName); - this.mixType.setMaterial(materialService.getByName(mixTypeName)); - } else { - this.mixType.setName(mixTypeName); - this.mixType.getMaterial().setName(mixTypeName); - } - - this.mixType.getMaterial().setMaterialType(dto.getMaterialType()); - } - - this.recipe = dto.getRecipe(); - - for (int i = 0; i < dto.getMaterials().size(); i++) - quantities.put(dto.getMaterials().get(i), dto.getQuantities().get(i)); - - return this; - } - - public MixBuilder withId(Long id) { - this.id = id; - - return this; - } - - public MixBuilder withRecipe(Recipe recipe) { - this.recipe = recipe; - - return this; - } - - public MixBuilder withMixType(MixType mixType) { - this.mixType = mixType; - - return this; - } - - public MixBuilder withMixQuantity(MixMaterial mixMaterial) { - this.mixMaterials.add(mixMaterial); - - return this; - } - - public MixBuilder withMixQuantities(List mixQuantities) { - this.mixMaterials = mixQuantities; - - return this; - } - - public Mix build() { - Mix mix = new Mix(this.id, this.location, this.recipe, this.mixType, new ArrayList<>()); - - createMixQuantities(mix); - mix.getMixMaterials().addAll(this.mixMaterials); - - return mix; - } - - private void createMixQuantities(Mix mix) { - List mixQuantities = new ArrayList<>(); - - for (Map.Entry quantityEntry : quantities.entrySet()) { - Material material = materialService.getByName(quantityEntry.getKey()); - Float quantity = quantityEntry.getValue(); - - mixQuantities.add(new MixMaterial(mix, material, quantity)); - } - - this.mixMaterials = mixQuantities; - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/PdfBuilder.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/PdfBuilder.java index 22c5e78..9a23e1e 100644 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/PdfBuilder.java +++ b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/utils/PdfBuilder.java @@ -1,8 +1,5 @@ package dev.fyloz.trial.colorrecipesexplorer.utils; -import dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths; -import lombok.AllArgsConstructor; -import lombok.Data; import org.apache.pdfbox.pdmodel.PDDocument; import org.apache.pdfbox.pdmodel.PDPage; import org.apache.pdfbox.pdmodel.PDPageContentStream; @@ -17,6 +14,8 @@ import java.util.Collection; public class PdfBuilder { + private static final String PATH_FONT_ARIAL_BOLD = "classpath:fonts/arialbd.ttf"; + private PDFont font; private PDDocument document = new PDDocument(); private PDPage page = new PDPage(); @@ -33,7 +32,7 @@ public class PdfBuilder { this.lineSpacing = (int) (this.fontSize * 1.5f); document.addPage(page); - font = PDType0Font.load(document, resourceLoader.getResource(WebsitePaths.FONT_ARIAL_BOLD).getInputStream()); + font = PDType0Font.load(document, resourceLoader.getResource(PATH_FONT_ARIAL_BOLD).getInputStream()); } public PdfBuilder addLine(String text, boolean bold, int marginTop) { @@ -88,14 +87,44 @@ public class PdfBuilder { contentStream.newLineAtOffset(-textX, -textY); // Réinitialise la position pour la prochaine ligne } - @Data - @AllArgsConstructor public static class PdfLine { private String text; private boolean bold; private int marginTop; + public PdfLine() { + } + + public PdfLine(String text, boolean bold, int marginTop) { + this.text = text; + this.bold = bold; + this.marginTop = marginTop; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public boolean isBold() { + return bold; + } + + public void setBold(boolean bold) { + this.bold = bold; + } + + public int getMarginTop() { + return marginTop; + } + + public void setMarginTop(int marginTop) { + this.marginTop = marginTop; + } } } diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/StringBank.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/StringBank.java deleted file mode 100644 index 19f9f43..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/StringBank.java +++ /dev/null @@ -1,30 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web; - -public class StringBank { - - // Types de réponse - public static final String RESPONSE_ERROR = "error"; - public static final String RESPONSE_SUCCESS = "success"; - public static final String RESPONSE_REASON = "reason"; - - // Types d'attributs communs - public static final String MATERIALS = "materials"; - public static final String MATERIAL = "material"; - public static final String MATERIAL_ID = "materialID"; - public static final String MATERIAL_CODE = "materialCode"; - public static final String MATERIAL_TYPES = "materialTypes"; - public static final String MATERIAL_TYPE = "materialType"; - public static final String RECIPES = "recipes"; - public static final String RECIPE = "recipe"; - public static final String RECIPE_ID = "recipeId"; - public static final String RECIPE_CODE = "recipeCode"; - public static final String MIXES = "mixes"; - public static final String MIX = "mix"; - public static final String MIX_ID = "mixID"; - public static final String MIX_TYPE = "mixType"; - public static final String MIX_TYPES = "mixTypes"; - public static final String COMPANIES = "companies"; - public static final String COMPANY = "company"; - public static final String COMPANY_ID = "companyID"; - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/WebsitePaths.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/WebsitePaths.java deleted file mode 100644 index fde0547..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/WebsitePaths.java +++ /dev/null @@ -1,73 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web; - -public class WebsitePaths { - // Autres - public static final String INDEX = "index"; - public static final String SIMDUT_FILES = "simdut/{id}"; - public static final String PASSWORD_VALIDATION = "password/valid"; - public static final String RECIPE_XLS = "recipe/xls/{id}"; - public static final String ALL_RECIPES_XLS = "recipe/xls"; - public static final String ERROR = "error"; - public static final String CLOSE_TAB = "closeTab"; - public static final String UPDATES = "updates"; - public static final String UPDATES_GET = "updates/get"; - public static final String FONT_ARIAL_BOLD = "classpath:fonts/arialbd.ttf"; - - // Images - public static final String IMAGES_FILES = "images/{image}"; - public static final String ADD_IMAGE = "images/add"; - public static final String ADD_IMAGE_SPECIFIC = "images/add/{id}"; - public static final String DELETE_IMAGE = "images/delete/{image}"; - - // Touch up kits - public static final String TOUCHUP = "touchup"; - public static final String TOUCHUP_PDF = "touchup/pdf"; - public static final String TOUCHUP_PTOUCH = "touchup/ptouch"; - public static final String TOUCHUP_PTOUCH_PAGE = "touchupPtouch"; - - // Inventaire - public static final String INVENTORY = "inventory"; - public static final String USE_INVENTORY = "inventory/use"; - - // Recettes - public static final String EXPLORER_RECIPE = "recipe/explore"; - public static final String EXPLORER_RECIPE_SPECIFIC = "recipe/explore/{id}"; - public static final String CREATOR_RECIPE = "recipe/creator"; - public static final String EDITOR_RECIPE = "recipe/editor"; - public static final String EDITOR_RECIPE_SPECIFIC = "recipe/editor/{id}"; - public static final String EDITOR_RECIPE_EDITOR = "recipe/edit"; - public static final String REMOVER_RECIPE = "recipe/remover"; - public static final String REMOVER_RECIPE_SPECIFIC = "recipe/remover/{id}"; - - // Compagnies - public static final String CREATOR_COMPANY = "company/creator"; - public static final String REMOVER_COMPANY = "company/remover"; - public static final String REMOVER_COMPANY_SPECIFIC = "company/remover/{id}"; - - // Matériaux - public static final String CREATOR_MATERIAL = "material/creator"; - public static final String EDIT_MATERIAL_SIMDUT = "material/simdut"; - public static final String EDIT_MATERIAL_SIMDUT_SPECIFIC = "material/simdut/{id}"; - public static final String REMOVER_MATERIAL = "material/remover"; - public static final String REMOVER_MATERIAL_SPECIFIC = "material/remover/{id}"; - public static final String EDITOR_MATERIAL = "material/editor"; - public static final String EDITOR_MATERIAL_SPECIFIC = "material/editor/{id}"; - public static final String EDITOR_MATERIAL_EDITOR = "material/edit"; - - // Types de matériaux - public static final String CREATOR_MATERIAL_TYPE = "materialType/creator"; - public static final String REMOVER_MATERIAL_TYPE = "materialType/remover"; - public static final String REMOVER_MATERIAL_TYPE_SPECIFIC = "materialType/remover/{id}"; - public static final String EDITOR_MATERIAL_TYPE = "materialType/editor"; - public static final String EDITOR_MATERIAL_TYPE_SPECIFIC = "materialType/editor/{id}"; - public static final String EDITOR_MATERIAL_TYPE_EDITOR = "materialType/edit"; - - // Mélanges - public static final String CREATOR_MIX = "mix/creator"; - public static final String CREATOR_MIX_SPECIFIC = "mix/creator/{id}"; - public static final String EDITOR_MIX = "mix/editor"; - public static final String EDITOR_MIX_SPECIFIC = "mix/editor/{id}"; - public static final String REMOVER_MIX_SPECIFIC = "mix/remover/{id}"; - public static final String MATERIAL_SELECTOR_MIX = "mix/selector/{recipeId}/{mixId}"; - public static final String MATERIAL_SELECTOR_FRAGMENT = "mix/selector.html :: materialSelector"; -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/angular/AngularController.kt b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/angular/AngularController.kt deleted file mode 100644 index a001e2d..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/angular/AngularController.kt +++ /dev/null @@ -1,14 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.angular - -import org.springframework.context.annotation.Profile -import org.springframework.stereotype.Controller -import org.springframework.web.bind.annotation.GetMapping - -@Controller -@Profile("angular") -class AngularController { - @GetMapping("/explore") - fun frontend(): String { - return "forward:/" - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/CREErrorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/CREErrorController.java deleted file mode 100644 index e56894b..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/CREErrorController.java +++ /dev/null @@ -1,53 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf; - -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import org.springframework.boot.web.servlet.error.ErrorController; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.RequestDispatcher; -import javax.servlet.http.HttpServletRequest; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.ERROR; - -@Controller -@Profile("thymeleaf") -public class CREErrorController implements ErrorController { - - @RequestMapping("/error") - public ModelAndView handleError(HttpServletRequest request) { - ModelResponseBuilder responseBuilder = new ModelResponseBuilder("error"); - responseBuilder.addAttribute("referer", request.getHeader("referer")); - - Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE); - - ResponseCode responseCode = ResponseCode._500; - if (status != null) { - int statusCode = Integer.parseInt(status.toString()); - - switch (statusCode) { - case 401: - responseCode = ResponseCode._401; - break; - case 404: - responseCode = ResponseCode._404; - break; - default: - responseCode = ResponseCode._500; - break; - } - } - - responseBuilder.addResponseCode(responseCode); - return responseBuilder.build(); - } - - @Override - public String getErrorPath() { - return ERROR; - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/Controllers.kt b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/Controllers.kt deleted file mode 100644 index 34654ea..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/Controllers.kt +++ /dev/null @@ -1,20 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf - -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode -import dev.fyloz.trial.colorrecipesexplorer.utils.ControllerUtils -import org.springframework.web.servlet.ModelAndView - -fun modelAndView(model: ModelAndView = ModelAndView(), op: ModelAndView.() -> Unit = {}) = model.apply { - addObject("baseUrl", ControllerUtils.getCurrentBaseUrl()) - addObject("referer", ControllerUtils.getLatestUrl()) - apply(op) -} - -fun modelAndView(viewName: String, op: ModelAndView.() -> Unit = {}) = modelAndView(ModelAndView(viewName), op) - -fun ModelAndView.message(responseCode: ResponseCode, vararg parameters: Any?) { - addObject(if (responseCode.type == ResponseCode.ResponseCodeType.ERROR) "error" else "success", "response.${responseCode.code}") - parameters.forEachIndexed { index, param -> - addObject("responseArg${index + 1}", param) - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/IndexController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/IndexController.java deleted file mode 100644 index eb707ad..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/IndexController.java +++ /dev/null @@ -1,53 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf; - -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.service.PasswordService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import java.util.Map; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.INDEX; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.PASSWORD_VALIDATION; - -@Controller -@Profile("thymeleaf") -public class IndexController { - - private RecipeJavaService recipeService; - - @Autowired - public IndexController(RecipeJavaService recipeService) { - this.recipeService = recipeService; - } - - /** - * Affiche la page d'acceuil. - * - * @return La page à afficher. - */ - @GetMapping({INDEX, "/"}) - public ModelAndView getPage() { - return new ModelResponseBuilder(INDEX) - .addResponseData(ResponseDataType.RECIPE_MAP, recipeService.getAllMappedByCompany()) - .build(); - } - - /** - * Valide un mot de passe reçu dans une requête HTTP POST, dans le champ "password". - * - * @param data Corps de la requête HTTP - * @return Si le mot de passe est valide. - */ - @PostMapping(value = PASSWORD_VALIDATION, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public boolean validatePassword(@RequestBody Map data) { - return PasswordService.isValid((String) data.get("password")); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/InventoryController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/InventoryController.java deleted file mode 100644 index f4f9551..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/InventoryController.java +++ /dev/null @@ -1,71 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf; - -import dev.fyloz.trial.colorrecipesexplorer.exception.TooLowQuantityException; -import dev.fyloz.trial.colorrecipesexplorer.web.response.JSONResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.InventoryDto; -import dev.fyloz.trial.colorrecipesexplorer.service.InventoryService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialTypeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import java.util.List; -import java.util.Map; - -import static dev.fyloz.trial.colorrecipesexplorer.web.StringBank.RESPONSE_REASON; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.INVENTORY; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.USE_INVENTORY; - -@Controller -@Profile("thymeleaf") -public class InventoryController { - - private InventoryService inventoryService; - private MaterialJavaService materialService; - private MaterialTypeJavaService materialTypeService; - - @Autowired - public InventoryController(InventoryService inventoryService, MaterialJavaService materialService, MaterialTypeJavaService materialTypeService) { - this.inventoryService = inventoryService; - this.materialService = materialService; - this.materialTypeService = materialTypeService; - } - - @GetMapping(INVENTORY) - public ModelAndView getPage(ModelAndView model) { - return new ModelResponseBuilder(model) - .withView(INVENTORY) - .addResponseData(ResponseDataType.MATERIALS, materialService.getAllNotMixType()) - .addResponseData(ResponseDataType.MATERIAL_TYPES, materialTypeService.getAll()) - .build(); - } - - @PostMapping(value = USE_INVENTORY, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - @Transactional - public Map consumeMaterials(@RequestBody List mixes) { - JSONResponseBuilder jsonResponseBuilder = new JSONResponseBuilder(); - - try { - inventoryService.use(mixes); - - jsonResponseBuilder.addResponseCode(ResponseCode.SUCCESS_USING_MATERIALS); - } catch (TooLowQuantityException ex) { - jsonResponseBuilder.addResponseCode(ResponseCode.NOT_ENOUGH_MATERIAL, ex.getMaterial().getName()) - .addAttribute(RESPONSE_REASON, ex.getResponse()); - } - - return jsonResponseBuilder.build(); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/OthersController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/OthersController.java deleted file mode 100644 index 80d2c2b..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/OthersController.java +++ /dev/null @@ -1,66 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.service.files.MarkdownFilesService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MixJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.servlet.ModelAndView; - -import static dev.fyloz.trial.colorrecipesexplorer.web.StringBank.MATERIALS; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class OthersController { - - private MixJavaService mixService; - private RecipeJavaService recipeService; - private MarkdownFilesService markdownService; - - @Autowired - public OthersController(MixJavaService mixService, RecipeJavaService recipeService, MarkdownFilesService markdownService) { - this.mixService = mixService; - this.recipeService = recipeService; - this.markdownService = markdownService; - } - - @GetMapping(CLOSE_TAB) - public ModelAndView getCloseTab() { - return new ModelResponseBuilder(CLOSE_TAB).build(); - } - - @GetMapping(MATERIAL_SELECTOR_MIX) - public ModelAndView getMaterialSelectorFragment(@PathVariable Long recipeId, @PathVariable Long mixId) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(MATERIAL_SELECTOR_FRAGMENT); - - try { - modelResponseBuilder.addAttribute(MATERIALS, mixService.getAvailableMaterialsForMixId(recipeService.getById(recipeId), mixId)); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.RECIPE_NOT_FOUND, recipeId); - } - - return modelResponseBuilder.build(); - } - - @GetMapping(value = UPDATES) - public ModelAndView getUpdatesPage() { - return new ModelResponseBuilder(UPDATES).build(); - } - - @GetMapping(value = UPDATES_GET, produces = MediaType.TEXT_HTML_VALUE) - @ResponseBody - public ResponseEntity getUpdates() { - return new ResponseEntity<>(markdownService.render("updates.md"), HttpStatus.OK); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/RecipeExplorerController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/RecipeExplorerController.java deleted file mode 100644 index f1b236e..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/RecipeExplorerController.java +++ /dev/null @@ -1,73 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import dev.fyloz.trial.colorrecipesexplorer.web.response.JSONResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.RecipeExplorerFormDto; -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import java.util.Map; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class RecipeExplorerController { - - private RecipeJavaService recipeService; - - @Autowired - public RecipeExplorerController(RecipeJavaService recipeService) { - this.recipeService = recipeService; - } - - @GetMapping(EXPLORER_RECIPE_SPECIFIC) - public ModelAndView getPage(@PathVariable Long id) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(EXPLORER_RECIPE); - - try { - Recipe recipe = recipeService.getById(id); - - return modelResponseBuilder - .addResponseData(ResponseDataType.RECIPE, recipe) - .addResponseData(ResponseDataType.MIXES, recipe.getMixesSortedById()) - .addResponseData(ResponseDataType.IMAGES, recipeService.getImageFiles(recipe)) - .build(); - } catch (EntityNotFoundException e) { - return modelResponseBuilder - .withView(INDEX) - .addResponseCode(ResponseCode.RECIPE_NOT_FOUND, id) - .build(); - } - } - - @PostMapping(value = EXPLORER_RECIPE, consumes = MediaType.APPLICATION_JSON_VALUE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public Map saveRecipeInformations(@RequestBody RecipeExplorerFormDto form) { - JSONResponseBuilder responseBuilder = new JSONResponseBuilder(); - - try { - recipeService.updateRecipeExplorerInfos(form); - - responseBuilder.addResponseCode(ResponseCode.SUCCESS_SAVING_RECIPE_INFORMATIONS); - } catch (EntityNotFoundException e) { - responseBuilder.addResponseCode( - e.getType().equals(Recipe.class) ? - ResponseCode.RECIPE_NOT_FOUND : - ResponseCode.MIX_NOT_FOUND, - e.getRequestedId() - ); - } - - return responseBuilder.build(); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/CompanyCreatorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/CompanyCreatorController.java deleted file mode 100644 index 370c9ba..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/CompanyCreatorController.java +++ /dev/null @@ -1,55 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.model.Company; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.service.model.CompanyJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.validation.Valid; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CREATOR_COMPANY; - -@Controller -@Profile("thymeleaf") -public class CompanyCreatorController { - - private CompanyJavaService companyService; - - @Autowired - public CompanyCreatorController(CompanyJavaService companyService) { - this.companyService = companyService; - } - - @GetMapping(CREATOR_COMPANY) - public ModelAndView getPage(ModelAndView model, Company company) { - return new ModelResponseBuilder(model) - .withView(CREATOR_COMPANY) - .addResponseData(ResponseDataType.COMPANY, company) - .build(); - } - - @PostMapping(value = CREATOR_COMPANY, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) - public ModelAndView createCompany(@ModelAttribute @Valid Company company) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); - - try { - company = companyService.save(company); - - modelResponseBuilder.addResponseCode(ResponseCode.SUCCESS_SAVING_COMPANY, company.getName()); - } catch (EntityAlreadyExistsException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.COMPANY_ALREADY_EXIST, company.getName()); - } - - return getPage(modelResponseBuilder.build(), company); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialCreatorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialCreatorController.java deleted file mode 100644 index 3bc8a42..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialCreatorController.java +++ /dev/null @@ -1,66 +0,0 @@ -//package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators; -// -//import dev.fyloz.trial.colorrecipesexplorer.exception.SimdutException; -//import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -//import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -//import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -//import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -//import dev.fyloz.trial.colorrecipesexplorer.model.Material; -//import dev.fyloz.trial.colorrecipesexplorer.services.model.MaterialService; -//import dev.fyloz.trial.colorrecipesexplorer.services.model.MaterialTypeService; -//import org.springframework.beans.factory.annotation.Autowired; -//import org.springframework.http.MediaType; -//import org.springframework.lang.Nullable; -//import org.springframework.stereotype.Controller; -//import org.springframework.web.bind.annotation.GetMapping; -//import org.springframework.web.bind.annotation.PostMapping; -//import org.springframework.web.multipart.MultipartFile; -//import org.springframework.web.servlet.ModelAndView; -// -//import javax.validation.Valid; -// -//import java.util.Optional; -// -//import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CREATOR_MATERIAL; -// -//@Controller -//public class MaterialCreatorController { -// -// private MaterialService materialService; -// private MaterialTypeService materialTypeService; -// -// @Autowired -// public MaterialCreatorController(MaterialService materialService, MaterialTypeService materialTypeService) { -// this.materialService = materialService; -// this.materialTypeService = materialTypeService; -// } -// -// @GetMapping(CREATOR_MATERIAL) -// public ModelAndView getPage(ModelAndView model, Material material) { -// return new ModelResponseBuilder(model) -// .withView(CREATOR_MATERIAL) -//// .addResponseData(ResponseDataType.MATERIAL, material) -//// .addResponseData(ResponseDataType.MATERIAL_TYPES, materialTypeService.getAll()) -// .build(); -// } -// -// @PostMapping(value = CREATOR_MATERIAL, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) -// public ModelAndView createMaterial(@Valid Material material, MultipartFile simdut) { -// ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); -// -// try { -// materialService.save(material, simdut); -// return getPage( -// modelResponseBuilder.addResponseCode(ResponseCode.SUCCESS_SAVING_MATERIAL, material.getName()).build(), -// new Material() -// ); -// } catch (EntityAlreadyExistsException ex) { -// modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_ALREADY_EXIST, material.getName()); -// } catch (SimdutException ex) { -// modelResponseBuilder.addResponseCode(ResponseCode.SUCCESS_SAVING_MATERIAL, material.getName()); -// modelResponseBuilder.addResponseCode(ResponseCode.ERROR_SAVING_SIMDUT); -// } -// -// return getPage(modelResponseBuilder.build(), material); -// } -//} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialCreatorController.kt b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialCreatorController.kt deleted file mode 100644 index 80bbe88..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialCreatorController.kt +++ /dev/null @@ -1,49 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators - -import dev.fyloz.trial.colorrecipesexplorer.exception.SimdutException -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode -import dev.fyloz.trial.colorrecipesexplorer.model.Material -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialSaveDto -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialJavaService -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialTypeJavaService -import dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CREATOR_MATERIAL -import dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.message -import dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.modelAndView -import org.springframework.context.annotation.Profile -import org.springframework.http.MediaType -import org.springframework.stereotype.Controller -import org.springframework.web.bind.annotation.GetMapping -import org.springframework.web.bind.annotation.PostMapping -import org.springframework.web.bind.annotation.RequestParam -import org.springframework.web.multipart.MultipartFile -import org.springframework.web.servlet.ModelAndView -import javax.validation.Valid - -@Controller -@Profile("thymeleaf") -class MaterialCreatorController(val materialService: MaterialJavaService, val materialTypeService: MaterialTypeJavaService) { - @GetMapping(CREATOR_MATERIAL) - fun getPage(model: ModelAndView, @RequestParam(required = false) material: Material? = null): ModelAndView { - return modelAndView(model) { - viewName = CREATOR_MATERIAL - addObject("material", material ?: Material()) - addObject("materialTypes", materialTypeService.all) - } - } - - @PostMapping(value = [CREATOR_MATERIAL], consumes = [MediaType.MULTIPART_FORM_DATA_VALUE]) - fun createMaterial(@Valid material: Material, simdut: MultipartFile): ModelAndView { - return getPage(modelAndView { - try { - materialService.save(MaterialSaveDto(material.name, material.inventoryQuantity, material.materialType!!, simdut)) - message(ResponseCode.SUCCESS_SAVING_MATERIAL, material.name) - } catch (ex: EntityAlreadyExistsException) { - message(ResponseCode.MATERIAL_ALREADY_EXIST, material.name) - } catch (ex: SimdutException) { - message(ResponseCode.SUCCESS_SAVING_MATERIAL, material.name) - message(ResponseCode.ERROR_SAVING_SIMDUT) - } - }) - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialTypeCreatorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialTypeCreatorController.java deleted file mode 100644 index 64524d1..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MaterialTypeCreatorController.java +++ /dev/null @@ -1,62 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialTypeJavaService; -import dev.fyloz.trial.colorrecipesexplorer.utils.ControllerUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.validation.Valid; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CREATOR_MATERIAL_TYPE; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.INDEX; - -@Controller -@Profile("thymeleaf") -public class MaterialTypeCreatorController { - - private MaterialTypeJavaService materialTypeService; - - @Autowired - public MaterialTypeCreatorController(MaterialTypeJavaService materialTypeService) { - this.materialTypeService = materialTypeService; - } - - @GetMapping(CREATOR_MATERIAL_TYPE) - public ModelAndView getPage(ModelAndView model, MaterialType materialType) { - return new ModelResponseBuilder(model) - .withView(CREATOR_MATERIAL_TYPE) - .addResponseData(ResponseDataType.MATERIAL_TYPE, materialType == null ? new MaterialType() : materialType) - .build(); - } - - @PostMapping(CREATOR_MATERIAL_TYPE) - public ModelAndView createMaterialType(@Valid MaterialType materialType) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(ControllerUtils.redirect(INDEX)); - - try { - materialTypeService.save(materialType); - return getPage( - modelResponseBuilder.addResponseCode(ResponseCode.SUCCESS_SAVING_MATERIAL_TYPE, materialType.getName()).build(), - null - ); - } catch (EntityAlreadyExistsException ex) { - if (ex.getIdentifierType() == ModelException.IdentifierType.NAME) { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_TYPE_ALREADY_EXIST, materialType.getName()); - } else { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_TYPE_ALREADY_EXIST_PREFIX, materialType.getPrefix()); - } - } - - return getPage(modelResponseBuilder.build(), materialType); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MixCreatorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MixCreatorController.java deleted file mode 100644 index 8b76a3d..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/MixCreatorController.java +++ /dev/null @@ -1,89 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.model.MixKt; -import dev.fyloz.trial.colorrecipesexplorer.model.MixTypeKt; -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.MixFormDto; -import dev.fyloz.trial.colorrecipesexplorer.service.ServiceKt; -import dev.fyloz.trial.colorrecipesexplorer.service.model.*; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.validation.Valid; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class MixCreatorController { - - private MixJavaService mixService; - private RecipeJavaService recipeService; - private MaterialJavaService materialService; - private MaterialTypeJavaService materialTypeService; - - @Autowired - public MixCreatorController(MixJavaService mixService, RecipeJavaService recipeService, MaterialJavaService materialService, MixTypeJavaService mixTypeService, MaterialTypeJavaService materialTypeService) { - this.mixService = mixService; - this.recipeService = recipeService; - this.materialService = materialService; - this.materialTypeService = materialTypeService; - } - - @GetMapping(CREATOR_MIX_SPECIFIC) - public ModelAndView getPage(ModelAndView model, @PathVariable Long id) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(model) - .withView(CREATOR_MIX); - - try { - Recipe recipe = recipeService.getById(id); - - modelResponseBuilder - .addResponseData(ResponseDataType.RECIPE, recipe) - .addResponseData(ResponseDataType.MATERIAL_TYPES, materialTypeService.getAll()) - .addResponseData(ResponseDataType.MATERIALS_JSON, ServiceKt.asJson(mixService.getAvailableMaterialsForNewMix(recipe))); - - if (materialService.getAll().isEmpty()) - modelResponseBuilder.addResponseData(ResponseDataType.BLOCK_BUTTON, true); - } catch (EntityNotFoundException ex) { - modelResponseBuilder - .withRedirect(EDITOR_RECIPE); - } - - return modelResponseBuilder.build(); - } - - @PostMapping(value = CREATOR_MIX, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) - public ModelAndView createMix(@ModelAttribute @Valid MixFormDto formDto) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); - - try { - mixService.save(formDto); - - return modelResponseBuilder - .withRedirect(EDITOR_RECIPE_SPECIFIC, formDto.getRecipe().getId()) - .build(); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_NOT_FOUND, ex.getRequestedId()); - } catch (EntityAlreadyExistsException ex) { - if (ex.getIdentifierName().equals(MixKt.IDENTIFIER_MIX_TYPE_NAME)) - modelResponseBuilder.addResponseCode(ResponseCode.MIX_TYPE_ALREADY_USED, ex.getRequestedId()); - else if (ex.getIdentifierName().equals(MixTypeKt.IDENTIFIER_MATERIAL_NAME)) - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_AND_MIX_TYPE_CANNOT_HAVE_SAME_NAME); - } - - return getPage(modelResponseBuilder.build(), formDto.getRecipe().getId()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/RecipeCreatorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/RecipeCreatorController.java deleted file mode 100644 index a3640f5..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/creators/RecipeCreatorController.java +++ /dev/null @@ -1,57 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.creators; - -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import dev.fyloz.trial.colorrecipesexplorer.service.model.CompanyJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import javax.validation.Valid; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CREATOR_RECIPE; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.EDITOR_RECIPE_SPECIFIC; - -@Controller -@Profile("thymeleaf") -public class RecipeCreatorController { - - private RecipeJavaService recipeService; - private CompanyJavaService companyService; - - @Autowired - public RecipeCreatorController(RecipeJavaService recipeService, CompanyJavaService companyService) { - this.recipeService = recipeService; - this.companyService = companyService; - } - - @GetMapping(CREATOR_RECIPE) - public ModelAndView getPage(ModelAndView model, Recipe recipe) { - ModelResponseBuilder responseBuilder = new ModelResponseBuilder(model) - .withView(CREATOR_RECIPE) - .addResponseData(ResponseDataType.COMPANIES, companyService.getAll()) - .addResponseData(ResponseDataType.RECIPE, recipe == null ? new Recipe() : recipe); - - if (companyService.getAll().isEmpty()) { - responseBuilder.addResponseCode(ResponseCode.NO_COMPANY) - .addResponseData(ResponseDataType.BLOCK_BUTTON, true); - } - - return responseBuilder.build(); - } - - @PostMapping(CREATOR_RECIPE) - public ModelAndView createRecipe(@Valid Recipe recipe) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); - - long id = recipeService.save(recipe).getId(); - - return modelResponseBuilder.withRedirect(EDITOR_RECIPE_SPECIFIC, id).build(); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MaterialEditorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MaterialEditorController.java deleted file mode 100644 index 7e7fde1..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MaterialEditorController.java +++ /dev/null @@ -1,108 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.editors; - -import dev.fyloz.trial.colorrecipesexplorer.exception.SimdutException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.Material; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialUpdateDto; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialTypeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class MaterialEditorController { - - private MaterialJavaService materialService; - private MaterialTypeJavaService materialTypeService; - - @Autowired - public MaterialEditorController(MaterialJavaService materialService, MaterialTypeJavaService materialTypeService) { - this.materialService = materialService; - this.materialTypeService = materialTypeService; - } - - @GetMapping(EDITOR_MATERIAL) - public ModelAndView getPage(ModelAndView model) { - return new ModelResponseBuilder(model) - .withView(EDITOR_MATERIAL) - .addResponseData(ResponseDataType.MATERIALS, materialService.getAllNotMixType()) - .build(); - } - - @GetMapping(EDITOR_MATERIAL_SPECIFIC) - public ModelAndView getEditPage(ModelAndView model, @PathVariable Long id, Material material) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(model).withView(EDITOR_MATERIAL_EDITOR); - - try { - if (material.getName() == null) material = materialService.getById(id); - return modelResponseBuilder - .addResponseData(ResponseDataType.MATERIAL, material) - .addResponseData(ResponseDataType.MATERIAL_TYPES, materialTypeService.getAll()) - .build(); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_NOT_FOUND, id); - } - - return getPage(modelResponseBuilder.build()); - } - - @PostMapping(value = EDITOR_MATERIAL, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) - public ModelAndView updateMaterial(Material material) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); - - try { - material = materialService.update(material); - - return getPage(modelResponseBuilder - .addResponseCode(ResponseCode.SUCCESS_SAVING_MATERIAL, material.getName()) - .build()); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_NOT_FOUND, material.getId()); - } catch (EntityAlreadyExistsException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_ALREADY_EXIST, material.getName()); - } - - return getEditPage(modelResponseBuilder.build(), material.getId(), material); - } - - @GetMapping(value = EDIT_MATERIAL_SIMDUT_SPECIFIC) - public ModelAndView getSimdutPage(ModelAndView model, @PathVariable Long id) { - return new ModelResponseBuilder(model) - .withView(EDIT_MATERIAL_SIMDUT) - .addResponseData(ResponseDataType.MATERIAL_ID, id) - .build(); - } - - @PostMapping(value = EDIT_MATERIAL_SIMDUT, consumes = MediaType.MULTIPART_FORM_DATA_VALUE) - public ModelAndView updateSimdut(Long id, MultipartFile simdut) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder().withRedirect(EDITOR_MATERIAL_SPECIFIC, id); - - try { - Material material = materialService.getById(id); - materialService.update(new MaterialUpdateDto(material.getId(), material.getName(), material.getInventoryQuantity(), material.getMaterialType(), simdut)); - } catch (EntityNotFoundException ex) { - return getSimdutPage( - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_NOT_FOUND, id).build(), - id - ); - } catch (SimdutException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.ERROR_SAVING_SIMDUT); - } - - return modelResponseBuilder.build(); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MaterialTypeEditorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MaterialTypeEditorController.java deleted file mode 100644 index a4f9cd2..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MaterialTypeEditorController.java +++ /dev/null @@ -1,79 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.editors; - -import dev.fyloz.trial.colorrecipesexplorer.exception.CannotEditDefaultMaterialTypeException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.MaterialTypeEditorDto; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialTypeJavaService; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialTypeKt; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class MaterialTypeEditorController { - - private MaterialTypeJavaService materialTypeService; - - @Autowired - public MaterialTypeEditorController(MaterialTypeJavaService materialTypeService) { - this.materialTypeService = materialTypeService; - } - - @GetMapping(EDITOR_MATERIAL_TYPE) - public ModelAndView getPage(ModelAndView model) { - return new ModelResponseBuilder(model) - .withView(EDITOR_MATERIAL_TYPE) - .addResponseData(ResponseDataType.MATERIAL_TYPES, materialTypeService.getAllNotDefault()) - .build(); - } - - @GetMapping(EDITOR_MATERIAL_TYPE_SPECIFIC) - public ModelAndView getEditPage(ModelAndView model, @PathVariable Long id, MaterialTypeEditorDto materialTypeDto) { - ModelResponseBuilder responseBuilder = new ModelResponseBuilder(model).withView(EDITOR_MATERIAL_TYPE_EDITOR); - - try { - if (materialTypeDto.getName() == null) materialTypeDto = new MaterialTypeEditorDto(materialTypeService.getById(id)); - - return responseBuilder - .addResponseData(ResponseDataType.MATERIAL_TYPE_DTO, materialTypeDto) - .build(); - } catch (EntityNotFoundException ex) { - return getPage(responseBuilder.addResponseCode(ResponseCode.MATERIAL_TYPE_NOT_FOUND, id).build()); - } - } - - @PostMapping(value = EDITOR_MATERIAL_TYPE, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) - public ModelAndView updateMaterialType(MaterialTypeEditorDto materialTypeDto) { - ModelResponseBuilder responseBuilder = new ModelResponseBuilder(); - - try { - materialTypeService.update(materialTypeDto); - - return getPage(responseBuilder.addResponseCode(ResponseCode.SUCCESS_SAVING_MATERIAL_TYPE, materialTypeDto.getMaterialType().getName()).build()); - } catch (EntityNotFoundException ex) { - return getPage(responseBuilder.addResponseCode(ResponseCode.MATERIAL_TYPE_NOT_FOUND, materialTypeDto.getOldName()).build()); - } catch (EntityAlreadyExistsException ex) { - if (ModelException.IdentifierType.NAME.equals(ex.getIdentifierType())) - responseBuilder.addResponseCode(ResponseCode.MATERIAL_TYPE_ALREADY_EXIST, materialTypeDto.getMaterialType().getName()); - else if (MaterialTypeKt.IDENTIFIER_PREFIX_NAME.equals(ex.getIdentifierName())) - responseBuilder.addResponseCode(ResponseCode.MATERIAL_TYPE_ALREADY_EXIST_PREFIX, materialTypeDto.getMaterialType().getPrefix()); - } catch(CannotEditDefaultMaterialTypeException ex) { - responseBuilder.addResponseCode(ResponseCode.CANNOT_EDIT_DEFAULT_MATERIAL_TYPE); - } - - return getEditPage(responseBuilder.build(), materialTypeDto.getMaterialType().getId(), materialTypeDto); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MixEditorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MixEditorController.java deleted file mode 100644 index 958bcd3..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/MixEditorController.java +++ /dev/null @@ -1,85 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.editors; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.model.Mix; -import dev.fyloz.trial.colorrecipesexplorer.model.MixKt; -import dev.fyloz.trial.colorrecipesexplorer.model.MixTypeKt; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.MixFormDto; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialTypeJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MixJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.validation.Valid; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class MixEditorController { - - private MixJavaService mixService; - private MaterialJavaService materialService; - private MaterialTypeJavaService materialTypeService; - - @Autowired - public MixEditorController(MixJavaService mixService, MaterialJavaService materialService, MaterialTypeJavaService materialTypeService) { - this.mixService = mixService; - this.materialService = materialService; - this.materialTypeService = materialTypeService; - } - - @GetMapping(EDITOR_MIX_SPECIFIC) - public ModelAndView getPage(ModelAndView model, @PathVariable Long id) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(model).withView(EDITOR_MIX); - - try { - Mix mix = mixService.getById(id); - - return modelResponseBuilder - .addResponseData(ResponseDataType.MIX, mix) - .addResponseData(ResponseDataType.MATERIAL_TYPE, mix.getMixType().getMaterial().getMaterialType()) - .addResponseData(ResponseDataType.MATERIAL_TYPES, materialTypeService.getAll()) - .addResponseData(ResponseDataType.MIX_JSON, mixService.asJson(mix)) - .addResponseData(ResponseDataType.MATERIALS_JSON, materialService.asJson(mixService.getAvailableMaterialsForMix(mix))) - .build(); - - } catch (EntityNotFoundException ex) { - return modelResponseBuilder - .withRedirect(EDITOR_RECIPE) - .build(); - } - } - - @PostMapping(value = EDITOR_MIX, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) - public ModelAndView updateMix(@ModelAttribute @Valid MixFormDto formDto, @RequestParam("mixId") Long id) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder().withRedirect(EDITOR_RECIPE_SPECIFIC, formDto.getRecipe().getId()); - - try { - Mix mix = mixService.getById(id); - - mixService.update(mix, formDto); - - return modelResponseBuilder.build(); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MIX_NOT_FOUND, id).build(); - } catch (EntityAlreadyExistsException ex) { - if (ex.getIdentifierName().equals(MixTypeKt.IDENTIFIER_MATERIAL_NAME)) - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_AND_MIX_TYPE_CANNOT_HAVE_SAME_NAME); - else if (ex.getIdentifierName().equals(MixKt.IDENTIFIER_MIX_TYPE_NAME)) - modelResponseBuilder.addResponseCode(ResponseCode.MIX_TYPE_ALREADY_USED, ex.getRequestedId()); - else throw new EntityAlreadyExistsException(ex); - } - - return getPage(modelResponseBuilder.build(), id); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/RecipeEditorController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/RecipeEditorController.java deleted file mode 100644 index 4c5c30e..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/editors/RecipeEditorController.java +++ /dev/null @@ -1,79 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.editors; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.RecipeEditorFormDto; -import dev.fyloz.trial.colorrecipesexplorer.service.model.CompanyJavaService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.MediaType; -import org.springframework.stereotype.Controller; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class RecipeEditorController { - - private RecipeJavaService recipeService; - private CompanyJavaService companyService; - - @Autowired - public RecipeEditorController(RecipeJavaService recipeService, CompanyJavaService companyService) { - this.recipeService = recipeService; - this.companyService = companyService; - } - - @GetMapping(EDITOR_RECIPE) - public ModelAndView getPage(ModelAndView model) { - return new ModelResponseBuilder(model) - .withView(EDITOR_RECIPE) - .addResponseData(ResponseDataType.RECIPE_MAP, recipeService.getAllMappedByCompany()) - .build(); - } - - @GetMapping(EDITOR_RECIPE_SPECIFIC) - public ModelAndView getEditPage(ModelAndView model, @PathVariable Long id, Recipe recipe) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(model).withView(EDITOR_RECIPE_EDITOR); - - try { - if (recipe.getName() == null) recipe = recipeService.getById(id); - - modelResponseBuilder - .addResponseData(ResponseDataType.RECIPE, recipe) - .addResponseData(ResponseDataType.COMPANIES, companyService.getAll()) - .addResponseData(ResponseDataType.MIXES, recipe.getMixesSortedById()) - .addResponseData(ResponseDataType.IMAGES, recipeService.getImageFiles(recipe)) - .addResponseData(ResponseDataType.RECIPE_JSON, recipeService.asJson(recipe)); - } catch (EntityNotFoundException ex) { - return getPage(modelResponseBuilder.addResponseCode(ResponseCode.RECIPE_NOT_FOUND, id).build()); - } - - return modelResponseBuilder.build(); - } - - @PostMapping(value = EDITOR_RECIPE, consumes = MediaType.APPLICATION_FORM_URLENCODED_VALUE) - @Transactional - public ModelAndView updateRecipe(RecipeEditorFormDto recipeDto) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); - - try { - recipeService.updateRecipeAndSteps(recipeDto); - - modelResponseBuilder.addResponseCode(ResponseCode.SUCCESS_SAVING_RECIPE, recipeDto.getRecipe().getName()); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.RECIPE_NOT_FOUND, recipeDto.getRecipe().getId()).build(); - } - - return getPage(modelResponseBuilder.build()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/ImageFilesController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/ImageFilesController.java deleted file mode 100644 index d73b36f..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/ImageFilesController.java +++ /dev/null @@ -1,83 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.files; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import dev.fyloz.trial.colorrecipesexplorer.web.response.JSONResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.service.files.ImagesService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.servlet.ModelAndView; - -import java.io.IOException; -import java.util.Map; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class ImageFilesController { - - private RecipeJavaService recipeService; - private ImagesService imagesService; - - @Autowired - public ImageFilesController(RecipeJavaService recipeService, ImagesService imagesService) { - this.recipeService = recipeService; - this.imagesService = imagesService; - } - - @GetMapping(IMAGES_FILES) - public ResponseEntity getImage(@PathVariable String image) { - HttpHeaders headers = new HttpHeaders(); - headers.setContentType(MediaType.IMAGE_JPEG); - return new ResponseEntity<>(imagesService.read(image), headers, HttpStatus.OK); - } - - @GetMapping(ADD_IMAGE_SPECIFIC) - public ModelAndView getPage(ModelAndView model, @PathVariable Long id) { - return new ModelResponseBuilder(model) - .withView(ADD_IMAGE) - .addResponseData(ResponseDataType.RECIPE_ID, id) - .build(); - } - - @PostMapping(ADD_IMAGE) - public ModelAndView addImage(Long id, MultipartFile image) throws IOException { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder().withRedirect(EDITOR_RECIPE_SPECIFIC, id); - - try { - if (!imagesService.isImage(image.getInputStream())) { - modelResponseBuilder.addResponseCode(ResponseCode.FILE_NOT_IMAGE); - } else { - Recipe recipe = recipeService.getById(id); - - if (imagesService.write(image, recipeService.getImageFileNameWithIndex(recipe))) - return modelResponseBuilder.build(); - else modelResponseBuilder.addResponseCode(ResponseCode.ERROR_SAVING_IMAGE); - } - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.RECIPE_NOT_FOUND, id); - } - - return getPage(modelResponseBuilder.build(), id); - } - - @GetMapping(value = DELETE_IMAGE, produces = MediaType.APPLICATION_JSON_VALUE) - @ResponseBody - public Map deleteImage(@PathVariable String image) { - imagesService.delete(image); - - return new JSONResponseBuilder().build(); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/SimdutFilesController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/SimdutFilesController.java deleted file mode 100644 index 271757b..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/SimdutFilesController.java +++ /dev/null @@ -1,59 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.files; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.service.files.SimdutService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; - -import javax.servlet.http.HttpServletRequest; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.CLOSE_TAB; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.SIMDUT_FILES; - -@Controller -@Profile("thymeleaf") -public class SimdutFilesController { - - private SimdutService simdutService; - - @Autowired - public SimdutFilesController(SimdutService simdutService) { - this.simdutService = simdutService; - } - - @GetMapping(SIMDUT_FILES) - public ResponseEntity getFile(HttpServletRequest request, @PathVariable Long id) { - HttpHeaders headers = new HttpHeaders(); - - try { - if (simdutService.exists(id)) { - byte[] simdutContent = simdutService.read(id); - headers.setContentType(MediaType.APPLICATION_PDF); - return new ResponseEntity<>(simdutContent, headers, HttpStatus.OK); - } else { - headers.add("Location", "/" + CLOSE_TAB); - } - } catch (EntityNotFoundException ex) { - headers.add("Location", request.getHeader("referer")); - } - - return new ResponseEntity<>(headers, HttpStatus.FOUND); - } - - @PostMapping(SIMDUT_FILES) - public ResponseEntity getFile(@PathVariable Long id) { - try { - return ResponseEntity.status(simdutService.exists(id) ? HttpStatus.OK : HttpStatus.NOT_FOUND).build(); - } catch (EntityNotFoundException ex) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST).build(); - } - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/TouchUpKitController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/TouchUpKitController.java deleted file mode 100644 index 651b829..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/TouchUpKitController.java +++ /dev/null @@ -1,52 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.files; - -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.service.files.TouchUpKitService; -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class TouchUpKitController { - - private TouchUpKitService touchUpKitService; - private RecipeJavaService recipeService; - - @Autowired - public TouchUpKitController(TouchUpKitService touchUpKitService, RecipeJavaService recipeService) { - this.touchUpKitService = touchUpKitService; - this.recipeService = recipeService; - } - - @GetMapping(TOUCHUP) - public ModelAndView getPage(ModelAndView model) { - return new ModelResponseBuilder(model) - .withView(TOUCHUP) - .addResponseData(ResponseDataType.RECIPE_MAP, recipeService.getAllMappedByCompany()) - .build(); - } - - @PostMapping(value = TOUCHUP_PDF, produces = MediaType.APPLICATION_PDF_VALUE) - public ResponseEntity getTouchUpKitPdf(String jobNumber) { - return new ResponseEntity<>(touchUpKitService.generatePdfForJobNumber(jobNumber), HttpStatus.FOUND); - } - - @PostMapping(value = TOUCHUP_PTOUCH) - public ModelAndView getTouchUpKitPtouch(String jobNumber) { - return new ModelResponseBuilder(TOUCHUP_PTOUCH_PAGE) - .addAttribute("jobNumber", jobNumber) - .build(); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/XlsExporterController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/XlsExporterController.java deleted file mode 100644 index db097d7..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/files/XlsExporterController.java +++ /dev/null @@ -1,63 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.files; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.service.files.XlsService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.ALL_RECIPES_XLS; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.RECIPE_XLS; - -@Controller -@Profile("thymeleaf") -public class XlsExporterController { - - private XlsService xlsService; - - @Autowired - public XlsExporterController(XlsService xlsService) { - this.xlsService = xlsService; - } - - @GetMapping(RECIPE_XLS) - public ResponseEntity getXlsForRecipe(HttpServletRequest request, @PathVariable Long id) { - HttpHeaders headers = new HttpHeaders(); - - try { - byte[] xlsContent = xlsService.generate(id); - - return ResponseEntity.ok() - .headers(headers) - .contentLength(xlsContent.length) - .contentType(MediaType.parseMediaType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")) - .body(xlsContent); - } catch (EntityNotFoundException ex) { - headers.add(HttpHeaders.LOCATION, request.getHeader("referer")); - return new ResponseEntity<>(headers, HttpStatus.FOUND); - } - } - - @GetMapping(value = ALL_RECIPES_XLS, produces = "application/zip") - public ResponseEntity getAllXls() throws IOException { - HttpHeaders headers = new HttpHeaders(); - - byte[] allXlsContent = xlsService.generateForAll(); - - return ResponseEntity.ok() - .headers(headers) - .contentLength(allXlsContent.length) - .contentType(MediaType.parseMediaType("application/zip")) - .body(allXlsContent); - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/CompanyRemoverController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/CompanyRemoverController.java deleted file mode 100644 index d1aee67..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/CompanyRemoverController.java +++ /dev/null @@ -1,56 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers; - -import dev.fyloz.trial.colorrecipesexplorer.exception.model.EntityLinkedException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.model.Company; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.service.model.CompanyJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_COMPANY; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_COMPANY_SPECIFIC; - -@Controller -@Profile("thymeleaf") -public class CompanyRemoverController { - - private CompanyJavaService companyService; - - @Autowired - public CompanyRemoverController(CompanyJavaService companyService) { - this.companyService = companyService; - } - - @GetMapping(REMOVER_COMPANY) - public ModelAndView getPage(ModelAndView model) { - return new ModelResponseBuilder(model) - .withView(REMOVER_COMPANY) - .addResponseData(ResponseDataType.COMPANIES, companyService.getAll()) - .build(); - } - - @PostMapping(REMOVER_COMPANY_SPECIFIC) - public ModelAndView removeCompany(@PathVariable Long id) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(""); - - try { - Company company = companyService.getById(id); - companyService.delete(company); - modelResponseBuilder.addResponseCode(ResponseCode.SUCCESS_DELETING_COMPANY, company.getName()); - } catch (EntityLinkedException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.COMPANY_LINKED, companyService.getById(id).getName()); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.COMPANY_NOT_FOUND, id); - } - - return getPage(modelResponseBuilder.build()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MaterialRemoverController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MaterialRemoverController.java deleted file mode 100644 index 6aec3e6..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MaterialRemoverController.java +++ /dev/null @@ -1,58 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers; - -import dev.fyloz.trial.colorrecipesexplorer.exception.model.EntityLinkedException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.Material; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import java.util.stream.Collectors; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_MATERIAL; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_MATERIAL_SPECIFIC; - -@Controller -@Profile("thymeleaf") -public class MaterialRemoverController { - - private MaterialJavaService materialService; - - @Autowired - public MaterialRemoverController(MaterialJavaService materialService) { - this.materialService = materialService; - } - - @GetMapping(REMOVER_MATERIAL) - public ModelAndView getPage(ModelAndView model) { - return new ModelResponseBuilder(model) - .withView(REMOVER_MATERIAL) - .addResponseData(ResponseDataType.MATERIALS, materialService.getAll().stream().filter(m -> !m.isMixType()).collect(Collectors.toList())) - .build(); - } - - @PostMapping(REMOVER_MATERIAL_SPECIFIC) - public ModelAndView removeMaterial(@PathVariable Long id) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); - - try { - Material material = materialService.getById(id); - materialService.delete(material); - modelResponseBuilder.addResponseCode(ResponseCode.SUCCESS_DELETING_MATERIAL, material.getName()); - } catch (EntityLinkedException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_LINKED, materialService.getById(id).getName()); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_NOT_FOUND, id); - } - - return getPage(modelResponseBuilder.build()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MaterialTypeRemoverController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MaterialTypeRemoverController.java deleted file mode 100644 index b7e6b1a..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MaterialTypeRemoverController.java +++ /dev/null @@ -1,60 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers; - -import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteDefaultMaterialTypeException; -import dev.fyloz.trial.colorrecipesexplorer.exception.model.EntityLinkedException; -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MaterialTypeJavaService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_MATERIAL_TYPE; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_MATERIAL_TYPE_SPECIFIC; - -@Controller -@Profile("thymeleaf") -public class MaterialTypeRemoverController { - - private MaterialTypeJavaService materialTypeService; - - @Autowired - - public MaterialTypeRemoverController(MaterialTypeJavaService materialTypeService) { - this.materialTypeService = materialTypeService; - } - - @GetMapping(REMOVER_MATERIAL_TYPE) - public ModelAndView getPage(ModelAndView model) { - return new ModelResponseBuilder(model) - .withView(REMOVER_MATERIAL_TYPE) - .addResponseData(ResponseDataType.MATERIAL_TYPES, materialTypeService.getAllNotDefault()) - .build(); - } - - @PostMapping(REMOVER_MATERIAL_TYPE_SPECIFIC) - public ModelAndView removeMaterialType(@PathVariable Long id) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); - - try { - MaterialType materialType = materialTypeService.getById(id); - materialTypeService.delete(materialType); - modelResponseBuilder.addResponseCode(ResponseCode.SUCCESS_DELETING_MATERIAL_TYPE, materialType.getName()); - } catch (EntityLinkedException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_TYPE_LINKED, materialTypeService.getById(id).getName()); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MATERIAL_TYPE_NOT_FOUND, id); - } catch (CannotDeleteDefaultMaterialTypeException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.CANNOT_REMOVE_DEFAULT_MATERIAL_TYPE); - } - - return getPage(modelResponseBuilder.build()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MixRemoverController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MixRemoverController.java deleted file mode 100644 index b99d58b..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/MixRemoverController.java +++ /dev/null @@ -1,44 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.model.Mix; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.service.model.MixJavaService; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.servlet.ModelAndView; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.*; - -@Controller -@Profile("thymeleaf") -public class MixRemoverController { - - private MixJavaService mixService; - - public MixRemoverController(MixJavaService mixService) { - this.mixService = mixService; - } - - @GetMapping(REMOVER_MIX_SPECIFIC) - public ModelAndView removeMix(@PathVariable Long id) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); - - try { - Mix mix = mixService.getById(id); - mixService.delete(mix); - return modelResponseBuilder - .withRedirect(EDITOR_RECIPE_SPECIFIC, mix.getRecipe().getId()) - .build(); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.MIX_NOT_FOUND, id); - } - - return modelResponseBuilder - .withRedirect(EDITOR_MIX_SPECIFIC, id) - .build(); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/RecipeRemoverController.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/RecipeRemoverController.java deleted file mode 100644 index 3cff967..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/controller/thymeleaf/removers/RecipeRemoverController.java +++ /dev/null @@ -1,51 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.controller.thymeleaf.removers; - -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException; -import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ModelResponseBuilder; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseCode; -import dev.fyloz.trial.colorrecipesexplorer.web.response.ResponseDataType; -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService; -import org.springframework.context.annotation.Profile; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.servlet.ModelAndView; - -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_RECIPE; -import static dev.fyloz.trial.colorrecipesexplorer.web.WebsitePaths.REMOVER_RECIPE_SPECIFIC; - -@Controller -@Profile("thymeleaf") -public class RecipeRemoverController { - - private RecipeJavaService recipeService; - - public RecipeRemoverController(RecipeJavaService recipeService) { - this.recipeService = recipeService; - } - - @GetMapping(REMOVER_RECIPE) - public ModelAndView getPage(ModelAndView model) { - return new ModelResponseBuilder(model) - .withView(REMOVER_RECIPE) - .addResponseData(ResponseDataType.RECIPE_MAP, recipeService.getAllMappedByCompany()) - .build(); - } - - @PostMapping(REMOVER_RECIPE_SPECIFIC) - public ModelAndView removeRecipe(@PathVariable Long id) { - ModelResponseBuilder modelResponseBuilder = new ModelResponseBuilder(); - - try { - Recipe recipe = recipeService.getById(id); - recipeService.delete(recipe); - modelResponseBuilder.addResponseCode(ResponseCode.SUCCESS_DELETING_RECIPE, recipe.getName()); - } catch (EntityNotFoundException ex) { - modelResponseBuilder.addResponseCode(ResponseCode.RECIPE_NOT_FOUND, id); - } - - return getPage(modelResponseBuilder.build()); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/JSONResponseBuilder.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/JSONResponseBuilder.java deleted file mode 100644 index 9ed2bd5..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/JSONResponseBuilder.java +++ /dev/null @@ -1,25 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.response; - -import dev.fyloz.trial.colorrecipesexplorer.config.Preferences; -import org.springframework.context.i18n.LocaleContextHolder; - -import java.util.HashMap; -import java.util.Map; - -public class JSONResponseBuilder extends ResponseBuilder> { - - @Override - protected void addResponseCodeToAttribute(String responseCodeType, String responseMessagePath, String[] parameters) { - Map attributeContent = new HashMap<>(); - - // Récupère le message depuis le fichier des messages de la bonne language et rajoute ces paramètres. - String message = Preferences.messageSource.getMessage(responseMessagePath, parameters, LocaleContextHolder.getLocale()); - attributeContent.put("message", message); - - addAttribute(responseCodeType, attributeContent); - } - - public Map build() { - return attributes; - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ModelResponseBuilder.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ModelResponseBuilder.java deleted file mode 100644 index cfcef7f..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ModelResponseBuilder.java +++ /dev/null @@ -1,63 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.response; - -import org.springframework.web.servlet.ModelAndView; - -public class ModelResponseBuilder extends ResponseBuilder { - - private static final String PATH_PARAMETER_PATTERN = "(\\{\\w+\\})"; - private static final String REDIRECT_PATH_PREFIX = "redirect:/"; - - private ModelAndView model; - - public ModelResponseBuilder() { - this.model = new ModelAndView(); - } - - public ModelResponseBuilder(String view) { - this(new ModelAndView(view)); - } - - public ModelResponseBuilder(ModelAndView model) { - this.model = model == null ? new ModelAndView() : model; - } - - public ModelResponseBuilder withView(String path) { - model.setViewName(path); - - return this; - } - - public ModelResponseBuilder withView(String path, Object... parameters) { - path = replaceInPath(path, parameters); - model.setViewName(path); - - return this; - } - - public ModelResponseBuilder withRedirect(String path, Object... parameters) { - return withView(REDIRECT_PATH_PREFIX + path, parameters); - } - - @Override - protected void addResponseCodeToAttribute(String responseCodeType, String responseMessagePath, String[] parameters) { - addAttribute(responseCodeType, responseMessagePath); - - for (int i = 0; i < parameters.length; i++) { - addAttribute(String.format("responseArg%s", i + 1), parameters[i]); - } - } - - public ModelAndView build() { - model.addAllObjects(attributes); - - return model; - } - - private String replaceInPath(String path, Object... parameters) { - for (Object parameter : parameters) { - path = path.replaceFirst(PATH_PARAMETER_PATTERN, parameter.toString()); - } - - return path; - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseBuilder.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseBuilder.java deleted file mode 100644 index 1ce9970..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseBuilder.java +++ /dev/null @@ -1,113 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.response; - -import dev.fyloz.trial.colorrecipesexplorer.config.Preferences; -import dev.fyloz.trial.colorrecipesexplorer.utils.ControllerUtils; -import org.springframework.lang.Nullable; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public abstract class ResponseBuilder { - - protected static final String RESPONSE_PREFIX = "response."; - protected static final String ERROR_ATTRIBUTE_NAME = "error"; - protected static final String SUCCESS_ATTRIBUTE_NAME = "success"; - - protected Map attributes; - - private boolean containsErrors = false; - - public ResponseBuilder() { - attributes = new HashMap<>(); - - // Ajoute l'URL de base à toutes les réponses - attributes.put("baseUrl", ControllerUtils.getCurrentBaseUrl()); - attributes.put("referer", ControllerUtils.getLatestUrl()); - } - - protected abstract void addResponseCodeToAttribute(String responseCodeType, String responseMessagePath, String[] parameters); - - protected abstract R build(); - - public T addResponseCode(ResponseCode responseCode, Object... parameters) { - String[] parametersAsStr = new String[parameters.length]; - - for (int i = 0; i < parameters.length; i++) { - parametersAsStr[i] = parameters[i].toString(); - } - - return addResponseCode(responseCode, parametersAsStr); - } - - public T addResponseCode(ResponseCode responseCode, String... parameters) { - int requiredParametersNumber = responseCode.getParametersNumber(); - int givenParametersNumber = parameters.length; - - if (requiredParametersNumber != givenParametersNumber) { - throw new IllegalArgumentException(String.format("Mauvais nombre de paramètre dans une réponse de modèle: %s requis, %s fournis", requiredParametersNumber, givenParametersNumber)); - } - - // Ajoute les paramètres, si nécessaire - if (requiredParametersNumber > 0) { - // Avertit s'il y a plus de paramètres que le nombre de paramètres supporté par le template thymeleaf (aussi MAX_PARAMETERS_NUMBER) - int maxParametersNumber = ResponseCode.MAX_PARAMETERS_NUMBER; - if (givenParametersNumber > maxParametersNumber) { - Preferences.logger.warn(String.format("Trop de paramètres fournis pour le code de réponse %s: %s maximum, %s fournis", responseCode.name(), maxParametersNumber, givenParametersNumber)); - } - } - - String responseCodeType; - if (responseCode.getType() == ResponseCode.ResponseCodeType.ERROR) { - containsErrors = true; - responseCodeType = ERROR_ATTRIBUTE_NAME; - } else { - responseCodeType = SUCCESS_ATTRIBUTE_NAME; - } - - String responseMessagePath = RESPONSE_PREFIX + responseCode.getCode(); - addResponseCodeToAttribute(responseCodeType, responseMessagePath, parameters); - - return (T) this; - } - - public T addResponseData(ResponseDataType responseDataType, Object data) { - Class requiredDataTypeClass = responseDataType.getDataType(); - Class requiredListDataTypeClass = responseDataType.getListDataType(); - Class givenDataTypeClass = data.getClass(); - - // Vérifie le type de l'objet - if (!requiredDataTypeClass.equals(givenDataTypeClass)) { - throw new IllegalArgumentException(String.format("L'objet passé en paramètre n'est pas du bon type. Requis: %s, fournis: %s", requiredDataTypeClass.getName(), givenDataTypeClass.getName())); - } - - // Si l'objet est une liste, vérifie qu'elle n'est pas vide et qu'elle est du bon type - if (requiredDataTypeClass.equals(List.class) && requiredListDataTypeClass != null) { - List listData = (List) data; - - if (listData.size() < 1) { - throw new IllegalArgumentException("La liste passée en paramètre ne contient aucun élément"); - } - - Class givenListDataTypeClass = listData.get(0).getClass(); - if (givenDataTypeClass.equals(requiredListDataTypeClass)) { - throw new IllegalArgumentException(String.format("La liste passée en paramètre contient des éléments du mauvais type. Requis: %s, fournis: %s", requiredListDataTypeClass.getName(), givenListDataTypeClass.getName())); - } - } - - // Ajoute l'attribut dans le Map - addAttribute(responseDataType.getDataTypeName(), data); - - return (T) this; - } - - public T addAttribute(String attributeName, Object content) { - attributes.put(attributeName, content); - - return (T) this; - } - - public boolean containsErrors() { - return containsErrors; - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseCode.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseCode.java deleted file mode 100644 index 8890ca6..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseCode.java +++ /dev/null @@ -1,78 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.response; - -public enum ResponseCode { - SUCCESS_USING_MATERIALS(1, ResponseCodeType.SUCCESS, 0), - SUCCESS_SAVING_RECIPE_INFORMATIONS(2, ResponseCodeType.SUCCESS, 0), - ERROR_SAVING(3, ResponseCodeType.ERROR, 0), - ERROR_SAVING_IMAGE(4, ResponseCodeType.ERROR, 0), - ERROR_SAVING_SIMDUT(5, ResponseCodeType.ERROR, 0), - AUTH_ERROR(6, ResponseCodeType.ERROR, 0), - RECIPE_NOT_FOUND(7, ResponseCodeType.ERROR, 1), - MIX_NOT_FOUND(8, ResponseCodeType.ERROR, 1), - MATERIAL_NOT_FOUND(9, ResponseCodeType.ERROR, 1), - MATERIAL_ALREADY_EXIST(10, ResponseCodeType.ERROR, 1), - MATERIAL_TYPE_ALREADY_EXIST(11, ResponseCodeType.ERROR, 1), - COMPANY_NOT_FOUND(12, ResponseCodeType.ERROR, 1), - COMPANY_ALREADY_EXIST(13, ResponseCodeType.ERROR, 1), - MATERIAL_LINKED(14, ResponseCodeType.ERROR, 1), - COMPANY_LINKED(15, ResponseCodeType.ERROR, 1), - MIX_NOT_ASSOCIATED_WITH_RECIPE(16, ResponseCodeType.ERROR, 2), - NOT_ENOUGH_MATERIAL(17, ResponseCodeType.ERROR, 1), - MIX_TYPE_ALREADY_USED(18, ResponseCodeType.ERROR, 1), - MATERIAL_TYPE_NOT_FOUND(19, ResponseCodeType.ERROR, 1), - MATERIAL_TYPE_ALREADY_EXIST_PREFIX(20, ResponseCodeType.ERROR, 1), - MATERIAL_TYPE_LINKED(21, ResponseCodeType.ERROR, 1), - NO_COMPANY(22, ResponseCodeType.ERROR, 0), - NO_MATERIAL(23, ResponseCodeType.ERROR, 0), - FILE_NOT_IMAGE(24, ResponseCodeType.ERROR, 0), - RECIPE_NOT_FOUND_NO_PARAMS(25, ResponseCodeType.ERROR, 0), - MATERIAL_NOT_FOUND_BY_NAME(26, ResponseCodeType.ERROR, 1), - SUCCESS_DELETING_COMPANY(27, ResponseCodeType.SUCCESS, 1), - SUCCESS_SAVING_MATERIAL(28, ResponseCodeType.SUCCESS, 1), - SUCCESS_SAVING_MATERIAL_TYPE(29, ResponseCodeType.SUCCESS, 1), - SUCCESS_SAVING_RECIPE(30, ResponseCodeType.SUCCESS, 1), - SUCCESS_DELETING_MATERIAL(31, ResponseCodeType.SUCCESS, 1), - SUCCESS_SAVING_COMPANY(32, ResponseCodeType.SUCCESS, 1), - SUCCESS_DELETING_RECIPE(33, ResponseCodeType.SUCCESS, 1), - SUCCESS_DELETING_MATERIAL_TYPE(34, ResponseCodeType.SUCCESS, 1), - RECIPE_ALREADY_EXIST(35, ResponseCodeType.ERROR, 1), - CANNOT_REMOVE_DEFAULT_MATERIAL_TYPE(36, ResponseCodeType.ERROR, 0), - CANNOT_EDIT_DEFAULT_MATERIAL_TYPE(37, ResponseCodeType.ERROR, 0), - MATERIAL_AND_MIX_TYPE_CANNOT_HAVE_SAME_NAME(38, ResponseCodeType.ERROR, 0), - - // HTTP Errors - _500(100, ResponseCodeType.ERROR, 0), - _404(101, ResponseCodeType.ERROR, 0), - _401(102, ResponseCodeType.ERROR, 0), - ; - - public static final int MAX_PARAMETERS_NUMBER = 2; - - private int code; - private ResponseCodeType type; - private int parametersNumber; - - ResponseCode(int code, ResponseCodeType type, int parametersNumber) { - this.code = code; - this.type = type; - this.parametersNumber = parametersNumber; - } - - public int getCode() { - return code; - } - - public ResponseCodeType getType() { - return type; - } - - public int getParametersNumber() { - return parametersNumber; - } - - public enum ResponseCodeType { - ERROR, - SUCCESS - } - -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseDataType.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseDataType.java deleted file mode 100644 index a2223fb..0000000 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/web/response/ResponseDataType.java +++ /dev/null @@ -1,92 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.web.response; - -import dev.fyloz.trial.colorrecipesexplorer.model.*; -import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType; -import dev.fyloz.trial.colorrecipesexplorer.model.dto.MaterialTypeEditorDto; -import dev.fyloz.trial.colorrecipesexplorer.model.Material; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.stream.Stream; - -public enum ResponseDataType { - MATERIAL("material", Material.class), - MATERIALS("materials", ArrayList.class, MATERIAL), - MATERIAL_ID("materialId", Long.class), - MATERIAL_CODE("materialCode", String.class), - MATERIALS_JSON("materialsJson", String.class), - - MATERIAL_TYPE("materialType", MaterialType.class), - MATERIAL_TYPES("materialTypes", ArrayList.class, MATERIAL_TYPE), - MATERIAL_TYPE_NAME("materialTypeName", String.class), - MATERIAL_TYPE_DTO("materialTypeDto", MaterialTypeEditorDto.class), - - RECIPE("recipe", Recipe.class), - RECIPES("recipes", ArrayList.class, RECIPE), - RECIPE_ID("recipeId", Long.class), - RECIPE_CODE("recipeCode", String.class), - RECIPE_MAP("recipeMap", HashMap.class), - RECIPE_JSON("recipeJson", String.class), - - RECIPE_STEP("recipeStep", RecipeStep.class), - RECIPE_STEPS("recipeSteps", ArrayList.class, RECIPE_STEP), - - MIX("mix", Mix.class), - MIXES("mixes", ArrayList.class, MIX), - MIX_ID("mixId", Long.class), - MIX_JSON("mixJson", String.class), - - MIX_TYPE("mixType", MixType.class), - MIX_TYPES("mixTypes", ArrayList.class, MIX_TYPE), - - MIX_QUANTITY("mixQuantity", MixMaterial.class), - MIX_QUANTITIES("mixQuantities", ArrayList.class, MIX_QUANTITY), - - COMPANY("company", Company.class), - COMPANIES("companies", ArrayList.class, COMPANY), - COMPANY_ID("companyId", Long.class), - COMPANY_NAME("companyName", String.class), - - IMAGE("image", String.class), - IMAGES("images", ArrayList.class, IMAGE), - - BLOCK_BUTTON("blockButton", boolean.class); - - private String dataTypeName; - private Class dataType; - private Class listDataType; - - ResponseDataType(String dataTypeName, Class dataType) { - this(dataTypeName, dataType, null); - } - - ResponseDataType(String dataTypeName, Class dataType, ResponseDataType listDataType) { - this.dataTypeName = dataTypeName; - this.dataType = dataType; - - if (listDataType != null) { - this.listDataType = listDataType.getDataType(); - } - } - - public String getDataTypeName() { - return dataTypeName; - } - - public Class getDataType() { - return dataType; - } - - public Class getListDataType() { - return listDataType; - } - - @Override - public String toString() { - return getDataTypeName(); - } - - public static ResponseDataType getModelDataTypeFromDataType(Class dataType) { - return Stream.of(values()).filter(r -> r.getDataType().equals(dataType)).findFirst().orElse(null); - } -} diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/xlsx/XlsxExporter.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/xlsx/XlsxExporter.java index 4513ea2..5e18eab 100644 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/xlsx/XlsxExporter.java +++ b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/xlsx/XlsxExporter.java @@ -1,6 +1,5 @@ package dev.fyloz.trial.colorrecipesexplorer.xlsx; -import dev.fyloz.trial.colorrecipesexplorer.config.Preferences; import dev.fyloz.trial.colorrecipesexplorer.model.Mix; import dev.fyloz.trial.colorrecipesexplorer.model.MixMaterial; import dev.fyloz.trial.colorrecipesexplorer.model.Recipe; @@ -14,17 +13,23 @@ import dev.fyloz.trial.colorrecipesexplorer.xlsx.component.cells.NoteCell; import dev.fyloz.trial.colorrecipesexplorer.xlsx.component.cells.SectionTitleCell; import dev.fyloz.trial.colorrecipesexplorer.xlsx.component.cells.TitleCell; import dev.fyloz.trial.colorrecipesexplorer.xlsx.util.Position; +import org.slf4j.Logger; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.Collection; public class XlsxExporter { + private Logger logger; + + public XlsxExporter(Logger logger) { + this.logger = logger; + } public byte[] generate(Recipe recipe) { - Preferences.logger.info(String.format("Génération du XLS de la couleur %s (%s)", recipe.getName(), recipe.getId())); + logger.info(String.format("Génération du XLS de la couleur %s (%s)", recipe.getName(), recipe.getId())); - Document document = new Document(recipe.getName()); + Document document = new Document(recipe.getName(), logger); Sheet sheet = document.getSheet(); registerCells(recipe, sheet); diff --git a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/xlsx/component/Document.java b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/xlsx/component/Document.java index 1256648..07157e5 100644 --- a/src/main/java/dev/fyloz/trial/colorrecipesexplorer/xlsx/component/Document.java +++ b/src/main/java/dev/fyloz/trial/colorrecipesexplorer/xlsx/component/Document.java @@ -1,10 +1,10 @@ package dev.fyloz.trial.colorrecipesexplorer.xlsx.component; -import dev.fyloz.trial.colorrecipesexplorer.config.Preferences; import dev.fyloz.trial.colorrecipesexplorer.xlsx.builder.SheetBuilder; import dev.fyloz.trial.colorrecipesexplorer.xlsx.exception.InvalidCellTypeException; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.apache.poi.xssf.usermodel.XSSFWorkbookType; +import org.slf4j.Logger; public class Document extends XSSFWorkbook { @@ -12,9 +12,11 @@ public class Document extends XSSFWorkbook { private static final XSSFWorkbookType WORKBOOK_TYPE = XSSFWorkbookType.XLSX; private Sheet sheet; + private Logger logger; - public Document(String name) { + public Document(String name, Logger logger) { super(WORKBOOK_TYPE); + this.logger = logger; sheet = new Sheet(this, createSheet(name)); } @@ -23,7 +25,7 @@ public class Document extends XSSFWorkbook { try { new SheetBuilder(sheet).build(); } catch (InvalidCellTypeException e) { - Preferences.logger.error("Une erreur est survenue lors de la génération du document: " + e.getLocalizedMessage()); + logger.error("Une erreur est survenue lors de la génération du document: " + e.getLocalizedMessage()); } } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/ColorRecipesExplorerApplication.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/ColorRecipesExplorerApplication.kt index 4828d02..11fbaa3 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/ColorRecipesExplorerApplication.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/ColorRecipesExplorerApplication.kt @@ -1,6 +1,6 @@ package dev.fyloz.trial.colorrecipesexplorer -import dev.fyloz.trial.colorrecipesexplorer.config.properties.CREProperties +import dev.fyloz.trial.colorrecipesexplorer.config.properties.CreProperties import dev.fyloz.trial.colorrecipesexplorer.config.properties.MaterialTypeProperties import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.autoconfigure.liquibase.LiquibaseAutoConfiguration @@ -8,7 +8,11 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties import org.springframework.boot.runApplication @SpringBootApplication(exclude = [LiquibaseAutoConfiguration::class]) -@EnableConfigurationProperties(MaterialTypeProperties::class, CREProperties::class, DatabaseUpdaterProperties::class) +@EnableConfigurationProperties( + MaterialTypeProperties::class, + CreProperties::class, + DatabaseUpdaterProperties::class +) class ColorRecipesExplorerApplication fun main() { diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/InitialDataLoader.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/InitialDataLoader.kt new file mode 100644 index 0000000..f02952e --- /dev/null +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/InitialDataLoader.kt @@ -0,0 +1,19 @@ +package dev.fyloz.trial.colorrecipesexplorer.config + +import dev.fyloz.trial.colorrecipesexplorer.config.properties.MaterialTypeProperties +import dev.fyloz.trial.colorrecipesexplorer.service.MaterialTypeService +import org.springframework.boot.context.event.ApplicationReadyEvent +import org.springframework.context.ApplicationListener +import org.springframework.context.annotation.Configuration +import org.springframework.core.Ordered +import org.springframework.core.annotation.Order + +@Configuration +@Order(Ordered.HIGHEST_PRECEDENCE) +class InitialDataLoader( + private val materialTypeService: MaterialTypeService, + private val materialTypeProperties: MaterialTypeProperties +) : ApplicationListener { + override fun onApplicationEvent(event: ApplicationReadyEvent) = + materialTypeService.saveSystemTypes(materialTypeProperties.systemTypes) +} diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/SpringConfiguration.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/SpringConfiguration.kt new file mode 100644 index 0000000..1fa10f7 --- /dev/null +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/SpringConfiguration.kt @@ -0,0 +1,13 @@ +package dev.fyloz.trial.colorrecipesexplorer.config + +import dev.fyloz.trial.colorrecipesexplorer.ColorRecipesExplorerApplication +import org.slf4j.Logger +import org.slf4j.LoggerFactory +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration + +@Configuration +class SpringConfiguration { + @Bean + fun logger(): Logger = LoggerFactory.getLogger(ColorRecipesExplorerApplication::class.java) +} diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/WebSecurityConfig.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/WebSecurityConfig.kt index 8e08a7f..dd7add0 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/WebSecurityConfig.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/WebSecurityConfig.kt @@ -1,7 +1,7 @@ package dev.fyloz.trial.colorrecipesexplorer.config import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException import dev.fyloz.trial.colorrecipesexplorer.model.Employee import dev.fyloz.trial.colorrecipesexplorer.model.EmployeeLoginRequest import dev.fyloz.trial.colorrecipesexplorer.model.EmployeePermission @@ -291,7 +291,7 @@ class JwtAuthorizationFilter( private fun getAuthenticationToken(employeeId: String): UsernamePasswordAuthenticationToken? = try { val employeeDetails = userDetailsService.loadUserByEmployeeId(employeeId.toLong(), false) UsernamePasswordAuthenticationToken(employeeDetails.username, null, employeeDetails.authorities) - } catch (_: EntityNotFoundRestException) { + } catch (_: EntityNotFoundException) { null } } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/properties/CreProperties.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/properties/CreProperties.kt new file mode 100644 index 0000000..5b141e7 --- /dev/null +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/config/properties/CreProperties.kt @@ -0,0 +1,8 @@ +package dev.fyloz.trial.colorrecipesexplorer.config.properties + +import org.springframework.boot.context.properties.ConfigurationProperties + +@ConfigurationProperties(prefix = "cre.server") +class CreProperties { + var workingDirectory: String = "data" +} diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/exception/Exception.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/exception/Exception.kt deleted file mode 100644 index 1be48d6..0000000 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/exception/Exception.kt +++ /dev/null @@ -1,31 +0,0 @@ -package dev.fyloz.trial.colorrecipesexplorer.exception - -import dev.fyloz.trial.colorrecipesexplorer.exception.model.ModelException -import dev.fyloz.trial.colorrecipesexplorer.model.Model - -class EntityAlreadyExistsException( - modelType: Class, - val identifierType: IdentifierType, - val identifierName: String?, - val requestedId: Any -) : ModelException(modelType) { - constructor(modelType: Class, identifierType: IdentifierType, requestedId: Any) : this( - modelType, - identifierType, - identifierType.name, - requestedId - ) - - constructor(exception: EntityAlreadyExistsException) : this( - exception.type, - exception.identifierType, - exception.identifierName, - exception.requestedId - ) -} - -class EntityNotFoundException( - modelType: Class, - val identifierType: IdentifierType, - val requestedId: Any -) : ModelException(modelType) diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/exception/RestException.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/exception/RestException.kt index 6ac470e..5c32f4b 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/exception/RestException.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/exception/RestException.kt @@ -1,8 +1,7 @@ package dev.fyloz.trial.colorrecipesexplorer.exception import com.fasterxml.jackson.annotation.JsonProperty -import dev.fyloz.trial.colorrecipesexplorer.exception.model.* -import dev.fyloz.trial.colorrecipesexplorer.model.Model +import dev.fyloz.trial.colorrecipesexplorer.model.Material import org.springframework.context.annotation.Profile import org.springframework.http.HttpHeaders import org.springframework.http.HttpStatus @@ -26,7 +25,7 @@ abstract class RestException(val exceptionMessage: String, val httpStatus: HttpS } @ResponseStatus(HttpStatus.CONFLICT) -class EntityAlreadyExistsRestException(val value: Any) : +class EntityAlreadyExistsException(val value: Any) : RestException("An entity with the given identifier already exists", HttpStatus.CONFLICT) { @Suppress("unused") override fun buildBody(): RestExceptionBody = object : RestExceptionBody() { @@ -35,7 +34,7 @@ class EntityAlreadyExistsRestException(val value: Any) : } @ResponseStatus(HttpStatus.NOT_FOUND) -class EntityNotFoundRestException(val value: Any) : +class EntityNotFoundException(val value: Any) : RestException("An entity could not be found with the given identifier", HttpStatus.NOT_FOUND) { @Suppress("unused") override fun buildBody(): RestExceptionBody = object : RestExceptionBody() { @@ -44,7 +43,7 @@ class EntityNotFoundRestException(val value: Any) : } @ResponseStatus(HttpStatus.CONFLICT) -class CannotDeleteEntityRestException(val value: Long) : +class CannotDeleteEntityException(val value: Long) : RestException( "The entity with the given identifier could not be deleted because it is required by other entities", HttpStatus.CONFLICT @@ -55,15 +54,22 @@ class CannotDeleteEntityRestException(val value: Long) : } } +@ResponseStatus +class SimdutWriteException(val material: Material) : + RestException( + "Could not write the SIMDUT file to disk", + HttpStatus.INTERNAL_SERVER_ERROR + ) { + @Suppress("unused") + override fun buildBody(): RestExceptionBody = object : RestExceptionBody() { + val materialId = material.id + } +} + @ControllerAdvice @Profile("rest") class RestResponseEntityExceptionHandler : ResponseEntityExceptionHandler() { - @ExceptionHandler(ModelException::class) - fun handleModelExceptions(exception: ModelException, request: WebRequest): ResponseEntity { - return handleRestExceptions(exception.toRestException(), request) - } - @ExceptionHandler(RestException::class) fun handleRestExceptions(exception: RestException, request: WebRequest): ResponseEntity { return handleExceptionInternal(exception, exception.buildBody(), HttpHeaders(), exception.httpStatus, request) @@ -84,11 +90,3 @@ class RestResponseEntityExceptionHandler : ResponseEntityExceptionHandler() { return ResponseEntity(errors, headers, status) } } - -fun ModelException.toRestException(): RestException { - return when (this) { - is EntityAlreadyExistsException -> EntityAlreadyExistsRestException(requestedId) - is EntityNotFoundException -> EntityNotFoundRestException(requestedId) - else -> throw UnsupportedOperationException("Cannot convert ${this::class.simpleName} to REST exception") - } -} diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/AccountService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/AccountService.kt index d8aea18..bfe8f91 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/AccountService.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/AccountService.kt @@ -2,9 +2,8 @@ package dev.fyloz.trial.colorrecipesexplorer.service import dev.fyloz.trial.colorrecipesexplorer.config.blacklistedJwtTokens import dev.fyloz.trial.colorrecipesexplorer.config.defaultGroupCookieName -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundRestException import dev.fyloz.trial.colorrecipesexplorer.model.* import dev.fyloz.trial.colorrecipesexplorer.model.validation.or import dev.fyloz.trial.colorrecipesexplorer.repository.EmployeeGroupRepository @@ -109,7 +108,7 @@ class EmployeeServiceImpl(employeeRepository: EmployeeRepository, val passwordEn override fun getById(id: Long, ignoreDefaultGroupUsers: Boolean, ignoreSystemUsers: Boolean): Employee = super.getById(id).apply { - if (ignoreSystemUsers && isSystemUser || ignoreDefaultGroupUsers && isDefaultGroupUser) throw EntityNotFoundRestException( + if (ignoreSystemUsers && isSystemUser || ignoreDefaultGroupUsers && isDefaultGroupUser) throw EntityNotFoundException( id ) } @@ -138,7 +137,7 @@ class EmployeeServiceImpl(employeeRepository: EmployeeRepository, val passwordEn override fun save(entity: Employee): Employee { if (existsByFirstNameAndLastName(entity.firstName, entity.lastName)) - throw EntityAlreadyExistsRestException("${entity.firstName} ${entity.lastName}") + throw EntityAlreadyExistsException("${entity.firstName} ${entity.lastName}") return super.save(entity) } @@ -188,7 +187,7 @@ class EmployeeServiceImpl(employeeRepository: EmployeeRepository, val passwordEn override fun update(entity: Employee, ignoreDefaultGroupUsers: Boolean, ignoreSystemUsers: Boolean): Employee { with(repository.findByFirstNameAndLastName(entity.firstName, entity.lastName)) { if (this != null && id != entity.id) - throw EntityAlreadyExistsRestException("${entity.firstName} ${entity.lastName}") + throw EntityAlreadyExistsException("${entity.firstName} ${entity.lastName}") } return super.update(entity) @@ -270,7 +269,7 @@ class EmployeeGroupServiceImpl( override fun getRequestDefaultGroup(request: HttpServletRequest): EmployeeGroup { val defaultGroupCookie = WebUtils.getCookie(request, defaultGroupCookieName) - ?: throw EntityNotFoundRestException("defaultGroup") + ?: throw EntityNotFoundException("defaultGroup") val defaultGroupUser = employeeService.getById( defaultGroupCookie.value.toLong(), ignoreDefaultGroupUsers = false, @@ -327,7 +326,7 @@ class EmployeeUserDetailsServiceImpl( return loadUserByEmployeeId(username.toLong(), true) } catch (ex: EntityNotFoundException) { throw UsernameNotFoundException(username) - } catch (ex: EntityNotFoundRestException) { + } catch (ex: EntityNotFoundException) { throw UsernameNotFoundException(username) } } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/CompanyService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/CompanyService.kt index 80b5129..b72f1ac 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/CompanyService.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/CompanyService.kt @@ -1,12 +1,12 @@ package dev.fyloz.trial.colorrecipesexplorer.service -import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityException import dev.fyloz.trial.colorrecipesexplorer.model.Company import dev.fyloz.trial.colorrecipesexplorer.model.CompanySaveDto import dev.fyloz.trial.colorrecipesexplorer.model.CompanyUpdateDto import dev.fyloz.trial.colorrecipesexplorer.model.company import dev.fyloz.trial.colorrecipesexplorer.repository.CompanyRepository -import dev.fyloz.trial.colorrecipesexplorer.service.model.RecipeJavaService +import org.springframework.context.annotation.Lazy import org.springframework.stereotype.Service interface CompanyService : ExternalNamedModelService { @@ -15,7 +15,10 @@ interface CompanyService : ExternalNamedModelService(companyRepository), CompanyService { override fun isLinkedToRecipes(company: Company): Boolean = recipeService.existsByCompany(company) @@ -33,7 +36,7 @@ class CompanyServiceImpl(companyRepository: CompanyRepository, val recipeService } override fun deleteById(id: Long) { - if (!repository.canBeDeleted(id)) throw CannotDeleteEntityRestException(id) + if (!repository.canBeDeleted(id)) throw CannotDeleteEntityException(id) super.deleteById(id) } } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/InventoryService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/InventoryService.kt index 28c8888..c77b94f 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/InventoryService.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/InventoryService.kt @@ -1,44 +1,6 @@ package dev.fyloz.trial.colorrecipesexplorer.service -import dev.fyloz.trial.colorrecipesexplorer.exception.TooLowQuantityException -import dev.fyloz.trial.colorrecipesexplorer.model.Material -import dev.fyloz.trial.colorrecipesexplorer.model.dto.InventoryDto -import org.springframework.stereotype.Service - -@Service -class InventoryService(val materialService: MaterialService) { - /** - * Use all materials in the given [mixes]. - * @throws TooLowQuantityException When there is not enough stock for a material - */ - fun use(mixes: List) { - mixes.forEach { mix -> - val materials = mix.materialIds.toMaterials() - - materials.forEachIndexed { index, material -> - val quantity = mix.quantities[index] - - if (!material.hasEnoughStock(quantity)) - throw TooLowQuantityException(mix.mixId, material, material.inventoryQuantity, quantity) - - material.use(quantity) - } - } - } - - /** Convert material ids to [Material]s. */ - private fun List.toMaterials(): List { - return map { materialService.getById(it) } - } - - /** Check if there is at least the given [quantity] in stock for a [Material]. */ - private fun Material.hasEnoughStock(quantity: Float): Boolean { - return inventoryQuantity >= quantity - } - - /** Use a given [Material], for the given [quantity]. */ - private fun Material.use(quantity: Float) { - inventoryQuantity -= quantity - materialService.update(this) - } -} +//interface InventoryService { +// fun deduct(quantities: InventoryDeductDto) +// fun deduct(material: Material, quantity: Float) +//} diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialService.kt index c72536d..3eb6583 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialService.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialService.kt @@ -1,6 +1,6 @@ package dev.fyloz.trial.colorrecipesexplorer.service -import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityException import dev.fyloz.trial.colorrecipesexplorer.model.* import dev.fyloz.trial.colorrecipesexplorer.repository.MaterialRepository import dev.fyloz.trial.colorrecipesexplorer.service.files.SimdutService @@ -93,7 +93,7 @@ class MaterialServiceImpl( } override fun deleteById(id: Long) { - if (!repository.canBeDeleted(id)) throw CannotDeleteEntityRestException(id) + if (!repository.canBeDeleted(id)) throw CannotDeleteEntityException(id) super.deleteById(id) } } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialTypeService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialTypeService.kt index fd6741d..fe22e14 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialTypeService.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MaterialTypeService.kt @@ -1,9 +1,9 @@ package dev.fyloz.trial.colorrecipesexplorer.service import dev.fyloz.trial.colorrecipesexplorer.config.properties.MaterialTypeProperties -import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityException import dev.fyloz.trial.colorrecipesexplorer.exception.RestException -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException import dev.fyloz.trial.colorrecipesexplorer.model.MaterialType import dev.fyloz.trial.colorrecipesexplorer.model.MaterialTypeSaveDto import dev.fyloz.trial.colorrecipesexplorer.model.MaterialTypeUpdateDto @@ -47,7 +47,7 @@ class MaterialTypeServiceImpl(repository: MaterialTypeRepository, private val ma override fun save(entity: MaterialType): MaterialType { if (existsByPrefix(entity.prefix)) - throw EntityAlreadyExistsRestException(entity.prefix) + throw EntityAlreadyExistsException(entity.prefix) return super.save(entity) } @@ -68,14 +68,14 @@ class MaterialTypeServiceImpl(repository: MaterialTypeRepository, private val ma override fun update(entity: MaterialType): MaterialType { with(repository.findByPrefix(entity.prefix)) { if (this != null && id != entity.id) - throw EntityAlreadyExistsRestException(entity.prefix) + throw EntityAlreadyExistsException(entity.prefix) } return super.update(entity) } override fun deleteById(id: Long) { - if (!repository.canBeDeleted(id)) throw CannotDeleteEntityRestException(id) + if (!repository.canBeDeleted(id)) throw CannotDeleteEntityException(id) super.deleteById(id) } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MixService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MixService.kt index 4745815..6869a37 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MixService.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MixService.kt @@ -1,6 +1,6 @@ package dev.fyloz.trial.colorrecipesexplorer.service -import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityException import dev.fyloz.trial.colorrecipesexplorer.model.* import dev.fyloz.trial.colorrecipesexplorer.repository.MixRepository import org.springframework.context.annotation.Lazy @@ -113,7 +113,7 @@ class MixServiceImpl( } override fun deleteById(id: Long) { - if (!repository.canBeDeleted(id)) throw CannotDeleteEntityRestException(id) + if (!repository.canBeDeleted(id)) throw CannotDeleteEntityException(id) super.deleteById(id) } } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MixTypeService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MixTypeService.kt index f9890a5..80c5eb8 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MixTypeService.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/MixTypeService.kt @@ -1,8 +1,8 @@ package dev.fyloz.trial.colorrecipesexplorer.service -import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityRestException -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsRestException -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.CannotDeleteEntityException +import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException +import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException import dev.fyloz.trial.colorrecipesexplorer.model.* import dev.fyloz.trial.colorrecipesexplorer.repository.MixTypeRepository import org.springframework.context.annotation.Lazy @@ -39,11 +39,11 @@ class MixTypeServiceImpl( repository.existsByNameAndMaterialType(name, materialType) override fun getByMaterial(material: Material): MixType = - repository.findByMaterial(material) ?: throw EntityNotFoundRestException(material.name) + repository.findByMaterial(material) ?: throw EntityNotFoundException(material.name) override fun getByNameAndMaterialType(name: String, materialType: MaterialType): MixType = repository.findByNameAndMaterialType(name, materialType) - ?: throw EntityNotFoundRestException("$name/${materialType.name}") + ?: throw EntityNotFoundException("$name/${materialType.name}") override fun getOrCreateForNameAndMaterialType(name: String, materialType: MaterialType): MixType = if (existsByNameAndMaterialType(name, materialType)) @@ -53,7 +53,7 @@ class MixTypeServiceImpl( override fun save(entity: MixType): MixType { if (materialService.existsByName(entity.name)) - throw EntityAlreadyExistsRestException(entity.name) + throw EntityAlreadyExistsException(entity.name) return super.save(entity) } @@ -78,7 +78,7 @@ class MixTypeServiceImpl( }) override fun deleteById(id: Long) { - if (!repository.canBeDeleted(id)) throw CannotDeleteEntityRestException(id) + if (!repository.canBeDeleted(id)) throw CannotDeleteEntityException(id) super.deleteById(id) } } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/RecipeService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/RecipeService.kt index 4d3cb7f..21aaa2a 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/RecipeService.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/RecipeService.kt @@ -1,11 +1,11 @@ package dev.fyloz.trial.colorrecipesexplorer.service -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException import dev.fyloz.trial.colorrecipesexplorer.model.* import dev.fyloz.trial.colorrecipesexplorer.model.validation.isNotNullAndNotBlank import dev.fyloz.trial.colorrecipesexplorer.model.validation.or import dev.fyloz.trial.colorrecipesexplorer.repository.RecipeRepository -import dev.fyloz.trial.colorrecipesexplorer.service.files.FilesService +import dev.fyloz.trial.colorrecipesexplorer.service.files.FileService import org.springframework.stereotype.Service import org.springframework.web.multipart.MultipartFile import java.io.File @@ -134,12 +134,12 @@ interface RecipeImageService { } @Service -class RecipeImageServiceImpl(val recipeService: RecipeService, val filesService: FilesService) : RecipeImageService { +class RecipeImageServiceImpl(val recipeService: RecipeService, val fileService: FileService) : RecipeImageService { override fun getByIdForRecipe(id: Long, recipeId: Long): ByteArray = try { - filesService.readAsBytes(getPath(id, recipeId)) + fileService.readAsBytes(getPath(id, recipeId)) } catch (ex: NoSuchFileException) { - throw EntityNotFoundRestException("$recipeId/$id") + throw EntityNotFoundException("$recipeId/$id") } override fun getAllIdsForRecipe(recipeId: Long): Collection { @@ -164,16 +164,16 @@ class RecipeImageServiceImpl(val recipeService: RecipeService, val filesService: } val nextAvailableId = getNextAvailableId() - filesService.write(image, getPath(nextAvailableId, recipeId)) + fileService.write(image, getPath(nextAvailableId, recipeId)) return nextAvailableId } override fun delete(id: Long, recipeId: Long) = - filesService.delete(getPath(id, recipeId)) + fileService.delete(getPath(id, recipeId)) /** Gets the images directory of the recipe with the given [recipeId]. */ - fun getRecipeDirectory(recipeId: Long) = File(filesService.getPath("$RECIPE_IMAGES_DIRECTORY/$recipeId")) + fun getRecipeDirectory(recipeId: Long) = File(fileService.getPath("$RECIPE_IMAGES_DIRECTORY/$recipeId")) /** Gets the file of the image with the given [recipeId] and [id]. */ - fun getPath(id: Long, recipeId: Long): String = filesService.getPath("$RECIPE_IMAGES_DIRECTORY/$recipeId/$id") + fun getPath(id: Long, recipeId: Long): String = fileService.getPath("$RECIPE_IMAGES_DIRECTORY/$recipeId/$id") } diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/Service.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/Service.kt index 8e90de3..85c9c0b 100644 --- a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/Service.kt +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/Service.kt @@ -1,8 +1,8 @@ package dev.fyloz.trial.colorrecipesexplorer.service import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsRestException -import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundRestException +import dev.fyloz.trial.colorrecipesexplorer.exception.EntityAlreadyExistsException +import dev.fyloz.trial.colorrecipesexplorer.exception.EntityNotFoundException import dev.fyloz.trial.colorrecipesexplorer.model.EntityDto import dev.fyloz.trial.colorrecipesexplorer.model.Model import dev.fyloz.trial.colorrecipesexplorer.model.NamedModel @@ -69,18 +69,18 @@ abstract class AbstractService>(override val reposito abstract class AbstractModelService>(repository: R) : AbstractService(repository), ModelService { override fun existsById(id: Long): Boolean = repository.existsById(id) - override fun getById(id: Long): E = repository.findByIdOrNull(id) ?: throw EntityNotFoundRestException(id) + override fun getById(id: Long): E = repository.findByIdOrNull(id) ?: throw EntityNotFoundException(id) override fun save(entity: E): E { if (entity.id != null && existsById(entity.id!!)) - throw EntityAlreadyExistsRestException(entity.id!!) + throw EntityAlreadyExistsException(entity.id!!) return super.save(entity) } override fun update(entity: E): E { assertId(entity.id) if (!existsById(entity.id!!)) - throw EntityNotFoundRestException(entity.id!!) + throw EntityNotFoundException(entity.id!!) return super.update(entity) } @@ -95,12 +95,12 @@ abstract class AbstractModelService>(repos abstract class AbstractNamedModelService>(repository: R) : AbstractModelService(repository), NamedModelService { override fun existsByName(name: String): Boolean = repository.existsByName(name) - override fun getByName(name: String): E = repository.findByName(name) ?: throw EntityNotFoundRestException(name) + override fun getByName(name: String): E = repository.findByName(name) ?: throw EntityNotFoundException(name) override fun deleteByName(name: String) = repository.deleteByName(name) override fun save(entity: E): E { if (existsByName(entity.name)) - throw EntityAlreadyExistsRestException(entity.name) + throw EntityAlreadyExistsException(entity.name) return super.save(entity) } @@ -109,7 +109,7 @@ abstract class AbstractNamedModelService withFileAt(path: String, block: File.() -> T) = + with(File(path)) { block() } + + fun getPath(fileName: String): String = + "${creProperties.workingDirectory}/$fileName" +} diff --git a/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/files/SimdutService.kt b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/files/SimdutService.kt new file mode 100644 index 0000000..bd3e0a8 --- /dev/null +++ b/src/main/kotlin/dev/fyloz/trial/colorrecipesexplorer/service/files/SimdutService.kt @@ -0,0 +1,64 @@ +package dev.fyloz.trial.colorrecipesexplorer.service.files + +import dev.fyloz.trial.colorrecipesexplorer.exception.SimdutWriteException +import dev.fyloz.trial.colorrecipesexplorer.model.Material +import dev.fyloz.trial.colorrecipesexplorer.service.MaterialService +import org.slf4j.Logger +import org.springframework.context.annotation.Lazy +import org.springframework.stereotype.Service +import org.springframework.web.multipart.MultipartFile +import java.io.IOException + +private const val SIMDUT_DIRECTORY = "simdut" + +@Service +class SimdutService( + private val fileService: FileService, + @Lazy private val materialService: MaterialService, + private val logger: Logger +) { + /** Checks if the given [material] has a SIMDUT file. */ + fun exists(material: Material) = + fileService.exists(getPath(material)) + + /** Reads the SIMDUT file of the given [material]. */ + fun read(material: Material): ByteArray { + val path = getPath(material) + if (fileService.exists(path)) return ByteArray(0) + + return try { + fileService.readAsBytes(path) + } catch (ex: IOException) { + logger.error("Could not read SIMDUT file", ex) + ByteArray(0) + } + } + + /** Reads the SIMDUT file of the material with the given [id]. */ + fun read(id: Long) = + read(materialService.getById(id)) + + /** Writes the given [simdut] file for the given [material] to the disk. */ + fun write(material: Material, simdut: MultipartFile) { + if (!fileService.write(simdut, getPath(material))) + throw SimdutWriteException(material) + } + + /** Updates the SIMDUT file of the given [material] with the given [simdut]. */ + fun update(simdut: MultipartFile, material: Material) { + delete(material) + write(material, simdut) + } + + /** Deletes the SIMDUT file of the given [material]. */ + fun delete(material: Material) = + fileService.delete(getPath(material)) + + /** Gets the path of the SIMDUT file of the given [material]. */ + fun getPath(material: Material) = + fileService.getPath("$SIMDUT_DIRECTORY/${getSimdutFileName(material)}") + + /** Gets the name of the SIMDUT file of the given [material]. */ + fun getSimdutFileName(material: Material) = + material.id.toString() +} diff --git a/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/src/main/resources/META-INF/additional-spring-configuration-metadata.json deleted file mode 100644 index 6af452d..0000000 --- a/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "properties": [ - { - "name": "http.port", - "type": "java.lang.String", - "description": "Port HTTP." - } - ] -} \ No newline at end of file diff --git a/src/main/resources/application-rest.properties b/src/main/resources/application-rest.properties deleted file mode 100644 index fe895e2..0000000 --- a/src/main/resources/application-rest.properties +++ /dev/null @@ -1 +0,0 @@ -spring.autoconfigure.exclude=org.springframework.boot.autoconfigure.thymeleaf.ThymeleafAutoConfiguration diff --git a/src/main/resources/application-thymeleaf.properties b/src/main/resources/application-thymeleaf.properties deleted file mode 100644 index 16d7877..0000000 --- a/src/main/resources/application-thymeleaf.properties +++ /dev/null @@ -1,3 +0,0 @@ -spring.resources.static-locations=classpath:/thymeleaf/static/ -spring.thymeleaf.prefix=classpath:/thymeleaf/templates/ -spring.thymeleaf.suffix=.html diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index d9b3b49..f58528d 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -1,10 +1,7 @@ # PORT server.port=9090 # CRE -cre.server.upload-directory=data -cre.server.password-file=passwords.txt -cre.server.url-use-port=true -cre.server.url-use-https=false +cre.server.working-directory=data cre.security.jwt-secret=CtnvGQjgZ44A1fh295gE cre.security.jwt-duration=18000000 # Root user diff --git a/src/main/resources/lang/messages_en.properties b/src/main/resources/lang/messages_en.properties deleted file mode 100644 index 7e6c412..0000000 --- a/src/main/resources/lang/messages_en.properties +++ /dev/null @@ -1,118 +0,0 @@ -app.title=Color recipes explorer -company.add.title=Add a banner -company.delete.title=Delete banners -company.error.anyFound=No banners were found. -company.form.companyName=Banner name -company.success.created=The banner {0} has been saved. -company.success.deleted=The banner {0} has been deleted. -error.serverError=An error occurred while sending data to the server. -footer.lang=Voir en français -image.add.title=Add an image -inventory.askUseMix=Do you really want to deduct this mix from the inventory? -inventory.askUseRecipe=Do you really want to deduct this recipe from the inventory? -inventory.hideOthers=Hide other materials -inventory.lowQuantity=Low quantity -inventory.showOnly=Show only -keyword.back=Back -keyword.calculation=Calculation -keyword.cancel=Cancel -keyword.characters=characters -keyword.company=Banner -keyword.continue=Continue -keyword.delete=Delete -keyword.edit=Edit -keyword.id=ID -keyword.images=Images -keyword.material=Material -keyword.pdf=PDF -keyword.print=Print -keyword.ptouch=P-touch -keyword.ptouchTemplate=P-touch templates -keyword.quantity=Quantity -keyword.recipe=Recipe -keyword.remove=Remove -keyword.save=Save -keyword.search=Search -keyword.see=See -keyword.type=Type -keyword.units=Units -keyword.updates=Updates history -keyword.use=Use -material.add.title=Add a material -material.code=Code -material.delete.title=Delete materials -material.edit.title=Edit materials -material.editing.title=Editing {0} -material.error.anyFound=No materials were found. -material.inventoryQuantity=Inventory quantity -material.simdut.choose=Choose material's SIMDUT file -material.simdut.error.notFound=No SIMDUT file found -material.simdut=SIMDUT File -material.success.created=The material {0} has been saved. -material.success.deleted=The material {0} has been deleted. -material.success.saved=The material {0} has been saved. -material.type=Material type -materialType.add.title=Add a material type -materialType.delete.title=Delete material types -materialType.editing.title=Editing {0} -materialType.editor.title=Edit material types -materialType.error.anyFound=Any material type has been found. -materialType.name=Name -materialType.prefix=Prefix -materialType.success.deleted=The material type {0} has been deleted. -materialType.success.saved=The material type {0} has been saved. -materialType.usePercents=Use percentages -menu.add=Add -menu.delete=Delete -menu.edit=Edit -menu.explore=Explore -menu.inventory=Inventory -menu.others=Others -mix.add.subtitle=Add a mix for the recipe {0} -mix.add.title=Add a banner -mix.edit.subtitle=Editing a mix for the recipe {0} ({1}) -mix.edit.title=Editing a mix -mix.location=Location -mix.mixType=Mix type -password.ask=What is your password? -password.notValid=Your password is not valid -recipe.add.title=Add a recipe -recipe.approbationDate=Approbation date -recipe.color=Color -recipe.delete.title=Delete recipes -recipe.description=Description -recipe.edit.addImage=Add an image -recipe.edit.addMix=Add a mix -recipe.edit.title=Edit a recipe -recipe.editing.title=Editing {0} -recipe.error.anyFound=No recipes were found. -recipe.explore.title={0} color -recipe.exportAllXLS=Export all colors (XLSX) -recipe.image.corrupted=Image deleted or corrupted -recipe.notice=Notice -recipe.print.confirm=Are you sure you want to print this mix? -recipe.print.error.bpacNotInstalled=BPac is not installed -recipe.print.error.noBase=There is no base in this mix -recipe.print.error=An error occurred while printing -recipe.print.printing=Printing in progress. This may take a few seconds. -recipe.print.status.error=The b-Pac extension is not installed -recipe.print.status.ok=The b-Pac extension is installed -recipe.remark=Remark -recipe.sample=Sample -recipe.steps=Steps -recipe.success.deleted=The recipe {0} has been deleted. -recipe.success.edit=The recipe {0} has been saved. -recipe.sucess.saved=The recipe {0} has been saved. You can now add ingredients. -recipe.touchup.title=Touch-up kit labels -recipe.touchup=Touch-up kit labels -recipe.warning.changesNotSaved=Changes are not saved -recipe.warning.exportAll=Do you really want to export all the colors? This can take some times and slow down the application. -recipe.warning.notApproved.short=Not approved -recipe.warning.notApproved=This recipe is not approved -recipe.xlsVersion=XLSX version -units.gallons=Gallons -units.liters=Liters -units.milliliters=Milliliters -warning.askChangePage=Are you sure you want to continue? Unsaved changes will be lost. -warning.noResult=Search returned no results -keyword.jobNumber=Job number diff --git a/src/main/resources/lang/messages_fr.properties b/src/main/resources/lang/messages_fr.properties deleted file mode 100644 index 48680ef..0000000 --- a/src/main/resources/lang/messages_fr.properties +++ /dev/null @@ -1,118 +0,0 @@ -app.title=Explorateur de recettes de couleur -company.add.title=Ajout d'une bannière -company.delete.title=Supprimer des bannières -company.error.anyFound=Aucune bannière n'a été trouvée. -company.form.companyName=Nom de la bannière -company.success.created=La bannière {0} à été enregistrée. -company.success.deleted=La bannière {0} a bien été supprimée. -error.serverError=Une erreur est survenue lors de l'envoie des informations vers le serveur. -footer.lang=See in english -image.add.title=Ajout une image -inventory.askUseMix=Êtes-vous certain de vouloir déduire ce mélange de l'inventaire? -inventory.askUseRecipe=Êtes-vous certain de vouloir déduire cette recette de l'inventaire? -inventory.hideOthers=Cacher les autres produits -inventory.lowQuantity=Quantité faible -inventory.showOnly=Voir seulement -keyword.back=Retour -keyword.calculation=Calcul -keyword.cancel=Annuler -keyword.characters=caractères -keyword.company=Bannière -keyword.continue=Continuer -keyword.delete=Supprimer -keyword.edit=Modifier -keyword.id=Identifiant -keyword.images=Images -keyword.material=Produit -keyword.pdf=PDF -keyword.print=Imprimer -keyword.ptouch=P-touch -keyword.ptouchTemplate=Modèles P-touch -keyword.quantity=Quantité -keyword.recipe=Recette -keyword.remove=Retirer -keyword.save=Enregistrer -keyword.search=Rechercher -keyword.see=Voir -keyword.type=Type -keyword.units=Unités -keyword.updates=Historique des mises à jour -keyword.use=Utiliser -material.add.title=Ajout d'un produit -material.code=Code -material.delete.title=Supprimer des produits -material.edit.title=Modifer des produits -material.editing.title=Modification de {0} -material.error.anyFound=Aucun produit n'a été trouvé. -material.inventoryQuantity=Quantité en inventaire -material.simdut.choose=Choisissez le fichier SIMDUT du produit -material.simdut.error.notFound=Aucun fichier SIMDUT trouvé -material.simdut=Fichier SIMDUT -material.success.created=Le produit {0} a été enregistré. -material.success.deleted=Le produit {0} a bien été supprimée. -material.success.saved=Le produit {0} a bien été sauvegardé. -material.type=Type de produit -materialType.add.title=Ajout d'un type de produit -materialType.delete.title=Supprimer des types de produit -materialType.editing.title=Modification de {0} -materialType.editor.title=Modifier un type de produit -materialType.error.anyFound=Aucun type de produit n'a été trouvé. -materialType.name=Nom -materialType.prefix=Préfix -materialType.success.deleted=Le type de produit {0} a bien été supprimé. -materialType.success.saved=Le type de produit {0} a bien été sauvegardé. -materialType.usePercents=Utiliser les pourcentages -menu.add=Ajouter -menu.delete=Supprimer -menu.edit=Modifier -menu.explore=Explorer -menu.inventory=Inventaire -menu.others=Autres -mix.add.subtitle=Ajout d''un mélange pour la recette {0} -mix.add.title=Ajout d'un mélange -mix.edit.subtitle=Modifier un mélange pour la recette {0} ({1}) -mix.edit.title=Modifier un mélange -mix.location=Position -mix.mixType=Type de mélange -password.ask=Quel est votre mot de passe? -password.notValid=Votre mot de passe n'est pas valide -recipe.add.title=Ajout d'une recette -recipe.approbationDate=Date d'approbation -recipe.color=Couleur -recipe.delete.title=Supprimer des recettes -recipe.description=Description -recipe.edit.addImage=Ajouter une image -recipe.edit.addMix=Ajouter un mélange -recipe.edit.title=Modifier une recette -recipe.editing.title=Modification de {0} -recipe.error.anyFound=Aucune recette n'a été trouvée. -recipe.explore.title=Couleur {0} -recipe.exportAllXLS=Exporter toutes les couleurs (XLSX) -recipe.image.corrupted=Image supprimée ou corrompue -recipe.notice=Note -recipe.print.confirm=Voulez-vous vraiment imprimer ce mélange? -recipe.print.error.bpacNotInstalled=BPac n'est pas installé -recipe.print.error.noBase=Il n'y a pas de base dans ce mélange -recipe.print.error=Une erreur est survenue pendant l'impression -recipe.print.printing=Impression en cours. Cette opération peut prendre quelques secondes. -recipe.print.status.error=L'extension b-Pac n'est pas installée -recipe.print.status.ok=L'extension b-Pac est installée -recipe.remark=Remarque -recipe.sample=Échantillon -recipe.steps=Étapes -recipe.success.deleted=La recette {0} a bien été supprimée. -recipe.success.edit=La recette {0} a bien été sauvegardée. -recipe.sucess.saved=La recette {0} à été enregistrée. Vous pouvez maintenant ajouter les ingrédients. -recipe.touchup.title=Étiquettes de kit de retouche -recipe.touchup=Étiquettes de kit de retouche -recipe.warning.changesNotSaved=Des modifications ne sont pas sauvegardées -recipe.warning.exportAll=Voulez-vous vraiment exporter toutes les couleurs? Cela peut prendre un certain temps et ralentir l'application. -recipe.warning.notApproved.short=Non approuvée -recipe.warning.notApproved=Cette recette n'est pas approuvée -recipe.xlsVersion=Version XLSX -units.gallons=Gallons -units.liters=Litres -units.milliliters=Millilitres -warning.askChangePage=Êtes-vous sûr de vouloir continuer? Les modifications non enregistrées seront perdues. -warning.noResult=La recherche n'a donné aucun résultat -keyword.jobNumber=Numéro de job diff --git a/src/main/resources/lang/responses_en.properties b/src/main/resources/lang/responses_en.properties deleted file mode 100644 index ef6c90d..0000000 --- a/src/main/resources/lang/responses_en.properties +++ /dev/null @@ -1,41 +0,0 @@ -response.1=The quantities of used materials have been deducted from the inventory -response.10=There is already a material with the code {0} -response.11=There is already a material type named {0} -response.12=No banner with the ID {0} has been found -response.13=There is already a banner named {0} -response.14=The material {0} is linked to one or more recipes, edit them first -response.15=The banner {0} is linked to one or more recipes, delete them first -response.16=The mix with the ID {0} is not linked to the recipe with the ID {1} -response.17=There is not enough {0} in inventory -response.18=This recipe already contains a mix of the type {0} -response.19=No material type with the name {0} has been found -response.2=The recipe's informations have been saved -response.3=An error has occurred while saving -response.4=An error has occurred while saving the image -response.5=An error has occurred while saving the SIMDUT file -response.6=Your password is not valid -response.7=No recipe with the ID {0} has been found -response.8=No mix with the ID {0} has been found -response.9=No material with the ID {0} has been found -response.20=There is already a material type with the prefix {0} -response.21=The material type {0} is linked to one or more materials, delete them first. -response.101=The requested page could not be found -response.100=An internal error as happened -response.102=You do not have autorization to see this page -response.22=No companies were found -response.23=No materials were found. -response.24=This file need to be an image -response.25=The recipe was not found -response.26=The material with the code {0} was not found -response.27=The banner {0} has been delete -response.28=The material {0} has been saved -response.29=The material type {0} has been saved -response.30=The recipe for the color {0} has been saved -response.31=The material {0} has been deleted -response.32=The banner {0} has been saved -response.33=The recipe {0} has been deleted -response.34=The material type {0} has been deleted -response.35=There is already a recipe with the ID {0} -response.36=You can't remove a default material type -response.37=You can't edit a default material type -response.38=A mix can't have the same name as a material diff --git a/src/main/resources/lang/responses_fr.properties b/src/main/resources/lang/responses_fr.properties deleted file mode 100644 index c247ab6..0000000 --- a/src/main/resources/lang/responses_fr.properties +++ /dev/null @@ -1,41 +0,0 @@ -response.1=Les quantités des produits utilisés ont été déduites de l'inventaire -response.10=Il y a déjà un produit ayant le code {0} -response.11=Il y a déjà un type de produit s''appellant {0} -response.12=Aucune bannière ayant l''identifiant {0} n''a été trouvée -response.13=Il y a déjà une bannière s''appellant {0} -response.14=Le produit {0} est lié à une ou plusieurs recettes, veuillez les modifier d'abord -response.15=La bannière {0} est liée à une ou plusieurs recettes, veuillez les supprimer d'abord -response.16=Le mélange ayant l''identifiant {0} n''est pas associé à la recette ayant l''identifiant {1} -response.17=Il n''y a pas assez de {0} en inventaire -response.18=Cette recette contient déjà un mélange de type {0} -response.19=Aucun type de produit ayant le nom {0} n''a été trouvée -response.2=Les informations de la recette ont été sauvegardées -response.3=Une erreur est survenue lors de l''enregistrement -response.4=Une erreur est survenue lors de l'enregistrement de l'image -response.5=Une erreur est survenue lors de l'enregistrement du fichier SIMDUT -response.6=Votre mot de passe n'est pas valide -response.7=Aucune recette ayant l''identifiant {0} n''a été trouvée -response.8=Aucun mélange ayant l''identifiant {0} n''a été trouvé -response.9=Aucun produit ayant l''identifiant {0} n''a été trouvé -response.20=Il y a déjà un type de produit ayant le préfix {0} -response.21=Le type de produit {0} est lié à un ou plusieurs produits, veuillez les supprimer d'abord. -response.101=La page demandée n'a pas été trouvée -response.100=Une erreur interne est survenue -response.102=Vous n'avez pas l'autorisation de consulter cette page -response.22=Aucune compagnie n'a été trouvée -response.23=Aucun produit n'a été trouvée. -response.24=Ce fichier doit être une image -response.25=La recette n'a pas été trouvée -response.26=Le produit ayant le code {0} n''a pas été trouvé -response.27=La bannière {0} a bien été supprimée -response.28=Le produit {0} a bien été sauvegardé -response.29=Le type de produit {0} a bien été sauvegardé -response.30=La recette pour la couleur {0} a bien été sauvegardée -response.31=Le produit {0} a bien été supprimée -response.32=La bannière {0} a bien été sauvegardée -response.33=La recette {0} a bien été supprimée -response.34=Le type de produit {0} a bien été supprimé -response.35=Il y a déjà une recette avec l''ID {0} -response.37=Vous ne pouvez pas modifier un type de produit par défaut -response.36=Vous ne pouvez pas supprimer un type de produit par défaut -response.38=Un mélange ne peut pas avoir le même nom qu''un produit diff --git a/src/main/resources/thymeleaf/static/bpac.xpi b/src/main/resources/thymeleaf/static/bpac.xpi deleted file mode 100644 index 1941857590165d8df079cae510fda7a3aaa018cc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 18204 zcma*P19)Z4vOm0IV`4j*WWtGU+Y{TiZF{1LZQHh;iEZ0o-g~}tU;OVq&#j%#etNIn z)vK$!R#*MHYRgK1fT92(KVSbO_|FgcY;45zt*x{fS!ryni~-%?+)tsh(jsusSkRwW z;lxA*(pZ|XVKLvljf!gznDMEgd2c$s=008bHCdj8~;ya(LDXD&dJK%j$ z?b+4sL6#R$1R6*toc9u9b0k=kFIMmL^EYn^z?W3uXN{Ap$q(h?**vM^IK!OGTx(EJBi)|B=s(U{AY=l*X_Ox!bx#jtCuQWL}20OR7h)-Qu zB;Eth369h1a&T(xDXbG_bh*}8-A9wxG25eA_NW{bP$-j$r>vv|1`jY})3*)-Qc`kn z*SZ*PXlNkYgwk;Mo@~t6)wi5G$ryMKV$R*kxT6>A(-0B;td^UI+@8#pwj<=|Za1n|g!2IV< z6&D4MZR9vU1+#Fszl-{0O7n94I{LG>L;eKzT=?D_FmMA@px9#g4RXI?E&)hI^%L=# z_Q%yrB(BW;`s*US%*Q5m#YcNnco5SD&(wm4_A8oSwq6P0^--Pk>YBmg-YmDdPv+|K&jChMh70Pmo5NE;K#wQssj33epW|OOrjyvfZ)pp8VO#5CV z83~zr;Sg0zr*jS5en#Z4`wz9Q;WFK#Z&CqIuemTL=IfET!WP1Z`isdg#Tv2nSdSwQ zTq~NiSoc^(rgvQ3>h*`xHT z4WkhznV=syU`1!czbk;`{C;cWJsqJw;-RZ4o8-=n?&#na?zqt`agLs0VjNH0ui)?T zo}I6;`CZmM=My{EsVRDE(d6-D*R9GjpJy(U%EiKj7%A+GK2`c!LB+k1=86=b;>S`)I!80q7TDIn7~{+ppdWzn%M1MC

mxhMUZP!5`d-tM7OVILVX``p}9NMBB1 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 USONe5;qx{42}AJ+{89V=09fIfDgXcg diff --git a/src/main/resources/thymeleaf/static/css/explore.css b/src/main/resources/thymeleaf/static/css/explore.css deleted file mode 100644 index b2821f1..0000000 --- a/src/main/resources/thymeleaf/static/css/explore.css +++ /dev/null @@ -1,168 +0,0 @@ -.mix { - width: 600px; -} - -p { - display: inline; -} - -.mixContainer { - display: flex; - padding: 20px 0; - border-style: solid; - border-width: 1px 0; - border-color: #555555; -} - -.mixContainer:first-child { - border-top-color: white; -} - -.mixContainer:last-child { - border-bottom-color: white; -} - -.mixContainer .mixInfo { - width: 130px; - text-align: left; -} - -.mixContainer .mix { - max-width: 600px; -} - -.mixContainer .mixActionsContainer { - margin-left: 15px; - display: flex; - flex-direction: column; -} - -.mix td, .mix th { - padding: 0 5px; -} - -.notEnough td { - background-color: #ffb3b3; -} - -.quantityColumn, .mix input { - width: 50px; -} - -.totalQuantityLabel { - padding-right: 10px; - text-align: right; - vertical-align: middle; -} - -.inventoryQuantity { - display: none; -} - -.inventoryQuantityColumn { - min-width: auto !important; - width: auto !important; -} - -.unitsColumn { - width: 25px !important; - min-width: 0 !important; - max-width: 25px !important; -} - -.calculationColumn { - max-width: 125px !important; - min-width: 100px; -} - -.calculation { - color: dimgrey; -} - -.calculation span { - color: darkgreen; -} - -.materialCodeColumn { - min-width: 100px; -} - -.recipeLocation { - width: 55px; -} - -.recipeDescription { - display: flex; - flex-direction: column; - text-align: left; -} - -.recipeDescription div { - border-color: #555555; - border-width: 1px 0; - border-style: solid; - padding: 10px 0; -} - -.recipeDescription div:first-child { - border-top-color: white; -} - -.recipeDescription div:nth-last-child(2) { - border-bottom-color: white; -} - -.recipeDescription div b { - float: left; -} - -.recipeDescription div :not(b) { - float: right; - margin: 0 0 0 20px; - max-width: 350px; -} - -.steps { - text-align: left; -} - -.steps li { - padding: 5px; -} - -.steps li:nth-child(even) { - background-color: #f5f5f5; - margin: 0; -} - -.steps li:nth-child(odd) { - background-color: #fafafa; -} - -.imagesContainer { - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: center; - padding: 20px; -} - -.imagesContainer img { - margin: 10px; - border: 1px solid #7a7a7a; - transition: all 0.5s; -} - -.imagesContainer .recipeImage:hover { - width: 420px; -} - -.imagesContainer.hovering .recipeImage:not(:hover) { - opacity: 0.5; -} - -@media only screen and (max-width: 1900px) { - .imagesContainer { - width: 50%; - } -} diff --git a/src/main/resources/thymeleaf/static/css/flex.css b/src/main/resources/thymeleaf/static/css/flex.css deleted file mode 100644 index 5626e63..0000000 --- a/src/main/resources/thymeleaf/static/css/flex.css +++ /dev/null @@ -1,14 +0,0 @@ -.content { - display: flex; - flex-direction: row; - flex-wrap: wrap; - justify-content: center; - margin-left: 50px; - margin-right: 50px; -} - -.content .flexContent { - padding: 20px; -} - - diff --git a/src/main/resources/thymeleaf/static/css/form.css b/src/main/resources/thymeleaf/static/css/form.css deleted file mode 100644 index dff7ea2..0000000 --- a/src/main/resources/thymeleaf/static/css/form.css +++ /dev/null @@ -1,57 +0,0 @@ -label { - font-weight: bold; -} - -.content { - flex-direction: column; -} - -.formWrap, .formEndButtons { - display: flex; - flex-direction: row; - justify-content: center; -} - -.formEndButtons button[type="button"] { - margin-right: 75px; -} - -.formEndButtons button[type="submit"] { - margin-left: 75px; -} - -.formColumn { - display: flex; - flex-direction: column; - text-align: left; -} - -.formColumn div { - min-height: 25px; - line-height: 25px; -} - -.formColumn select, .formColumn input, .formColumn button { - float: right; -} - -.formColumn input[type="text"], .formColumn input[type="number"], .formColumn input[type="date"], .formColumn select { - width: 145px; -} - -.formColumn:first-child { - margin-right: 20px; -} - -.formColumn:last-child { - margin-left: 20px; -} - -.rawInput:not(textarea):not(.noStyle) { - border-bottom-color: #7a7a7a; - color: #454545; -} - -.rawInput:hover:not(textarea):not(.noStyle) { - border-bottom-color: #7a7a7a; -} diff --git a/src/main/resources/thymeleaf/static/css/main.css b/src/main/resources/thymeleaf/static/css/main.css deleted file mode 100644 index 20a564d..0000000 --- a/src/main/resources/thymeleaf/static/css/main.css +++ /dev/null @@ -1,242 +0,0 @@ -body { - margin: 0; - font-family: 'Open Sans', sans-serif; - overflow-x: hidden; -} - -* { - transition: all .1s; -} - -h1 { - text-decoration: underline; -} - -section { - text-align: center; - margin-bottom: 50px; -} - -footer a { - color: white; - text-decoration: none; -} - -button, -select { - background-color: #d7dedc; - border-style: solid; - border-color: #d7dedc; - border-width: 1px; - padding: 2px 4px; - margin: 2px; -} - -select { - padding: 1px 0; -} - -select:after { - background-color: red; -} - -button:hover { - background-color: #bec4c3; -} - -input { - background-color: rgba(0, 0, 0, 0); - border-style: solid; - border-width: 1px; - border-color: #7a7a7a; -} - -input[type=file] { - border-style: none; -} - -input[readonly] { - border-style: none; - color: black; -} - -input::-webkit-outer-spin-button, -input::-webkit-inner-spin-button { - -webkit-appearance: none; - margin: 0; -} - -input[type=number] { - -moz-appearance: textfield; -} - -textarea { - font-family: inherit; - border: 1px solid #7a7a7a; - margin-left: 20px; - padding: 10px; -} - -table { - border-collapse: collapse; -} - -table:not(.noStyle) { - background-color: #f5f5f5; - border: 1px solid #7a7a7a; - text-align: left; -} - -table:not(.noStyle) th { - background-color: black; - color: white; - font-weight: normal; - font-size: large; -} - -table:not(.noStyle) tr:nth-child(odd) { - background-color: #fafafa; -} - -.nosimdut td { - background-color: #ffc299; -} - -.nosimdut input:not(:readonly) { - background-color: #fafafa; -} - -.unapproved { - background-color: #fff0b3 !important; -} - -#researchBoxContainer { - float: right; -} - -#researchBox { - margin-top: 10px; - margin-right: 50px; - margin-left: -200px; - width: 150px; -} - -.messageBox { - display: none; - position: fixed; - top: -20px; - left: 50%; - transform: translateX(-50%); -} - -.messageBox .messageBoxContainer { - display: inline-block; - padding: 16px; -} - -.messageBox .messageBoxMessageContainer { - display: flex; - flex-direction: row; - position: relative; - vertical-align: center; - align-items: center; - text-align: center; -} - -.messageBox img { - width: 24px; - height: 24px; -} - -.messageBox p { - font-weight: bold; - margin: 0 0 0 20px; - width: 100%; -} - -#errorBox { - background-color: #ef9a9a; - color: #e53935; -} - -#successBox { - background-color: #a5d6a7; - color: #4caf50; -} - -#warningBox { - background-color: #fff59d; - color: #fdd835; -} - -#confirmBox, #promptBox { - background-color: #90caf9; - color: #1e88e5; - z-index: 60; -} - -#promptBox { - height: 110px; -} - -.confirmButtonsContainer button { - margin: 0 60px; -} - -.confirmButtonsContainer { - display: flex; - flex-direction: row; - margin: 5px 0; - justify-content: center; -} - -.confirmInputContainer input { - width: 90%; - background-color: white; - padding: 2px 0; - margin: 10px 5% 2px; - text-align: left !important; -} - -.subtitle { - padding: 0 !important; - text-align: center; -} - -.rawInput:not(.noStyle) { - border-color: white; - color: #7a7a7a; - text-align: right; -} - -.rawInput:hover:not(.noStyle) { - border-color: #e6e6e6; -} - -.rawInput:focus:not(.noStyle) { - border-color: #7a7a7a; - color: black; -} - -.formEndButtons { - margin-top: 10px; -} - -.returnButton { - float: left; -} - -.submitButton { - float: right; -} - -#filter { - display: none; - background-color: black; - width: 100%; - height: 100%; - position: fixed; - top: 0; - opacity: 0; - z-index: 50; -} diff --git a/src/main/resources/thymeleaf/static/css/menu.css b/src/main/resources/thymeleaf/static/css/menu.css deleted file mode 100644 index 43de52d..0000000 --- a/src/main/resources/thymeleaf/static/css/menu.css +++ /dev/null @@ -1,106 +0,0 @@ -header, footer { - background-color: black; - height: 70px; - text-align: center; - width: 100%; - color: white; - position: fixed; - z-index: 99; -} - -header { - top: 0; - display: flex; - background-color: black; -} - -header .spacer { - width: 100%; -} - -header a:hover, .dropdown:hover .dropbtn { - background-color: #0d0d0d; -} - -header .header-right { - display: flex; - flex-direction: row; -} - -header #printStatusIcon { - margin-right: 20px; -} - -nav { - display: flex; - flex-direction: row; -} - -footer { - height: 5%; - bottom: 0; - padding-top: 10px; -} - -section { - margin-top: 100px; -} - -nav a { - float: left; - font-size: 18px; - color: white; - text-align: center; - padding: 14px 16px; - text-decoration: none; -} - -.dropdown { - margin-top: 22px; - float: left; - overflow: hidden; - background-color: inherit; -} - -.dropdown .dropbtn { - font-size: 16px; - border: none; - color: white; - outline: none; - padding: 14px 16px; - background-color: inherit; - margin: 0; -} - -.dropdown-content { - display: none; - position: absolute; - top: 70px; - background-color: #0d0d0d; - min-width: 160px; - box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2); - z-index: 1; -} - -.dropdown-content a { - float: none; - color: white; - padding: 12px 16px; - text-decoration: none; - display: block; - text-align: left; -} - -.dropdown-content a:hover { - background-color: #1a1a1a; -} - -.dropdown:hover .dropdown-content { - display: block; -} - -@media only screen and (max-width: 702px) { - header img { - display: none; - } -} diff --git a/src/main/resources/thymeleaf/static/css/mix.css b/src/main/resources/thymeleaf/static/css/mix.css deleted file mode 100644 index 84bb0f2..0000000 --- a/src/main/resources/thymeleaf/static/css/mix.css +++ /dev/null @@ -1,114 +0,0 @@ -#materials input { - height: 20px; - padding: 5px; - width: 150px; -} - -.materialSelector { - position: relative; -} - -.materialSelector .materialList { - border-color: #7a7a7a; - border-width: 1px; - border-style: solid; - display: none; - max-height: 300px; - overflow: auto; - overflow-x: hidden; - position: absolute; - top: 100%; - width: 200px; - z-index: 10; -} - -.materialSelector .materialList.show { - display: block; -} - -.materialSelector p { - background-color: #fafafa; - margin: 0; - padding: 5px; - text-align: left; -} - -.materialSelector p:nth-child(even) { - background-color: #f5f5f5; -} - -.materialSelector p:hover { - background-color: #e6e6e6; -} - -.materialListWrap { - display: flex; - flex-direction: column; -} - -.mixMaterialListTitle { - background-color: black; - color: white; -} - -.mixMaterialListTitle div { - display: block !important; - margin: auto; -} - -.materialListWrap div { - display: flex; - flex-direction: row; -} - -.mixMaterialList { - flex-direction: column !important; - background-color: #f5f5f5; - border-style: solid; - border-width: 1px; - border-color: #7a7a7a; -} - -.materialListRow:nth-child(odd) { - background-color: #fafafa; -} - -.material, .quantity { - width: 200px; -} - -.material *, .quantity * { - width: 180px; -} - -.material input { - text-align: left; - padding: 0 10px; -} - -.quantity input { - text-align: right; - padding: 0 10px; -} - -.units, .units * { - width: 40px; -} - -.removeButton, .removeButton * { - width: 100px; -} - -.positionButtons { - display: flex !important; - flex-direction: column !important; - width: 50px; - padding: 1px 3px 1px 1px; - /*border-bottom: solid 1px #7a7a7a;*/ -} - -.positionButtons button { - margin: 1px; - width: inherit; - height: 50%; -} diff --git a/src/main/resources/thymeleaf/static/css/recipesList.css b/src/main/resources/thymeleaf/static/css/recipesList.css deleted file mode 100644 index 3033842..0000000 --- a/src/main/resources/thymeleaf/static/css/recipesList.css +++ /dev/null @@ -1,41 +0,0 @@ -h1 { - margin-bottom: 0; -} - -.content { - flex-direction: column; -} - -.content .recipesList { - border-collapse: collapse; - margin: 0 auto; - text-align: center; -} - -h1, h2 { - margin: 0 0 10px; -} - -h1 { - margin-top: 10px; -} - -.recipesList th { - padding: 0 15px; -} - -.recipesList td { - padding: 0 20px; -} - -.recipeDescription { - max-width: 400px; -} - -.researchEnabled .companyTab:not(.researchResult), .researchEnabled .recipeRow:not(.researchResult) { - display: none; -} - -.iconsColumn img { - margin-top: 5px; -} diff --git a/src/main/resources/thymeleaf/static/favicon.png b/src/main/resources/thymeleaf/static/favicon.png deleted file mode 100644 index 6e8075844dcd8fafc52c31d910da1a33b37e5f07..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 252 zcmVbmahog_()`vZBNFMy&b!hb>o7{CAqFn|FJpbkjWRGf3-oRcie!UKL7 zeL#pkxRwe0P}Bn4!LL*;zyt>4p diff --git a/src/main/resources/thymeleaf/static/icons/bucket.svg b/src/main/resources/thymeleaf/static/icons/bucket.svg deleted file mode 100644 index 7fd119b..0000000 --- a/src/main/resources/thymeleaf/static/icons/bucket.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/main/resources/thymeleaf/static/icons/confirm.svg b/src/main/resources/thymeleaf/static/icons/confirm.svg deleted file mode 100644 index 4afca3c..0000000 --- a/src/main/resources/thymeleaf/static/icons/confirm.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/src/main/resources/thymeleaf/static/icons/error.svg b/src/main/resources/thymeleaf/static/icons/error.svg deleted file mode 100644 index 2047e73..0000000 --- a/src/main/resources/thymeleaf/static/icons/error.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/src/main/resources/thymeleaf/static/icons/printer.svg b/src/main/resources/thymeleaf/static/icons/printer.svg deleted file mode 100644 index 438787e..0000000 --- a/src/main/resources/thymeleaf/static/icons/printer.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/src/main/resources/thymeleaf/static/icons/printerError.svg b/src/main/resources/thymeleaf/static/icons/printerError.svg deleted file mode 100644 index 3d4c025..0000000 --- a/src/main/resources/thymeleaf/static/icons/printerError.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - diff --git a/src/main/resources/thymeleaf/static/icons/success.svg b/src/main/resources/thymeleaf/static/icons/success.svg deleted file mode 100644 index 5894558..0000000 --- a/src/main/resources/thymeleaf/static/icons/success.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/main/resources/thymeleaf/static/icons/warning.svg b/src/main/resources/thymeleaf/static/icons/warning.svg deleted file mode 100644 index 0065683..0000000 --- a/src/main/resources/thymeleaf/static/icons/warning.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/src/main/resources/thymeleaf/static/js/libs/axios.min.js b/src/main/resources/thymeleaf/static/js/libs/axios.min.js deleted file mode 100644 index b927503..0000000 --- a/src/main/resources/thymeleaf/static/js/libs/axios.min.js +++ /dev/null @@ -1,9 +0,0 @@ -/* axios v0.19.0 | (c) 2019 by Matt Zabriskie */ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.axios=t():e.axios=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){"use strict";function r(e){var t=new i(e),n=s(i.prototype.request,t);return o.extend(n,i.prototype,t),o.extend(n,t),n}var o=n(2),s=n(3),i=n(5),a=n(22),u=n(11),c=r(u);c.Axios=i,c.create=function(e){return r(a(c.defaults,e))},c.Cancel=n(23),c.CancelToken=n(24),c.isCancel=n(10),c.all=function(e){return Promise.all(e)},c.spread=n(25),e.exports=c,e.exports.default=c},function(e,t,n){"use strict";function r(e){return"[object Array]"===j.call(e)}function o(e){return"[object ArrayBuffer]"===j.call(e)}function s(e){return"undefined"!=typeof FormData&&e instanceof FormData}function i(e){var t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer}function a(e){return"string"==typeof e}function u(e){return"number"==typeof e}function c(e){return"undefined"==typeof e}function f(e){return null!==e&&"object"==typeof e}function p(e){return"[object Date]"===j.call(e)}function d(e){return"[object File]"===j.call(e)}function l(e){return"[object Blob]"===j.call(e)}function h(e){return"[object Function]"===j.call(e)}function m(e){return f(e)&&h(e.pipe)}function y(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams}function g(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function x(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)}function v(e,t){if(null!==e&&"undefined"!=typeof e)if("object"!=typeof e&&(e=[e]),r(e))for(var n=0,o=e.length;n - * @license MIT - */ - e.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},function(e,t,n){"use strict";function r(e){this.defaults=e,this.interceptors={request:new i,response:new i}}var o=n(2),s=n(6),i=n(7),a=n(8),u=n(22);r.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=u(this.defaults,e),e.method=e.method?e.method.toLowerCase():"get";var t=[a,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach(function(e){t.unshift(e.fulfilled,e.rejected)}),this.interceptors.response.forEach(function(e){t.push(e.fulfilled,e.rejected)});t.length;)n=n.then(t.shift(),t.shift());return n},r.prototype.getUri=function(e){return e=u(this.defaults,e),s(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},o.forEach(["delete","get","head","options"],function(e){r.prototype[e]=function(t,n){return this.request(o.merge(n||{},{method:e,url:t}))}}),o.forEach(["post","put","patch"],function(e){r.prototype[e]=function(t,n,r){return this.request(o.merge(r||{},{method:e,url:t,data:n}))}}),e.exports=r},function(e,t,n){"use strict";function r(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var o=n(2);e.exports=function(e,t,n){if(!t)return e;var s;if(n)s=n(t);else if(o.isURLSearchParams(t))s=t.toString();else{var i=[];o.forEach(t,function(e,t){null!==e&&"undefined"!=typeof e&&(o.isArray(e)?t+="[]":e=[e],o.forEach(e,function(e){o.isDate(e)?e=e.toISOString():o.isObject(e)&&(e=JSON.stringify(e)),i.push(r(t)+"="+r(e))}))}),s=i.join("&")}if(s){var a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+s}return e}},function(e,t,n){"use strict";function r(){this.handlers=[]}var o=n(2);r.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},r.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},r.prototype.forEach=function(e){o.forEach(this.handlers,function(t){null!==t&&e(t)})},e.exports=r},function(e,t,n){"use strict";function r(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var o=n(2),s=n(9),i=n(10),a=n(11),u=n(20),c=n(21);e.exports=function(e){r(e),e.baseURL&&!u(e.url)&&(e.url=c(e.baseURL,e.url)),e.headers=e.headers||{},e.data=s(e.data,e.headers,e.transformRequest),e.headers=o.merge(e.headers.common||{},e.headers[e.method]||{},e.headers||{}),o.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]});var t=e.adapter||a.adapter;return t(e).then(function(t){return r(e),t.data=s(t.data,t.headers,e.transformResponse),t},function(t){return i(t)||(r(e),t&&t.response&&(t.response.data=s(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t,n){return r.forEach(n,function(n){e=n(e,t)}),e}},function(e,t){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},function(e,t,n){"use strict";function r(e,t){!s.isUndefined(e)&&s.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function o(){var e;return"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process)?e=n(13):"undefined"!=typeof XMLHttpRequest&&(e=n(13)),e}var s=n(2),i=n(12),a={"Content-Type":"application/x-www-form-urlencoded"},u={adapter:o(),transformRequest:[function(e,t){return i(t,"Accept"),i(t,"Content-Type"),s.isFormData(e)||s.isArrayBuffer(e)||s.isBuffer(e)||s.isStream(e)||s.isFile(e)||s.isBlob(e)?e:s.isArrayBufferView(e)?e.buffer:s.isURLSearchParams(e)?(r(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):s.isObject(e)?(r(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};u.headers={common:{Accept:"application/json, text/plain, */*"}},s.forEach(["delete","get","head"],function(e){u.headers[e]={}}),s.forEach(["post","put","patch"],function(e){u.headers[e]=s.merge(a)}),e.exports=u},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){r.forEach(e,function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])})}},function(e,t,n){"use strict";var r=n(2),o=n(14),s=n(6),i=n(17),a=n(18),u=n(15);e.exports=function(e){return new Promise(function(t,c){var f=e.data,p=e.headers;r.isFormData(f)&&delete p["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var l=e.auth.username||"",h=e.auth.password||"";p.Authorization="Basic "+btoa(l+":"+h)}if(d.open(e.method.toUpperCase(),s(e.url,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?i(d.getAllResponseHeaders()):null,r=e.responseType&&"text"!==e.responseType?d.response:d.responseText,s={data:r,status:d.status,statusText:d.statusText,headers:n,config:e,request:d};o(t,c,s),d=null}},d.onabort=function(){d&&(c(u("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){c(u("Network Error",e,null,d)),d=null},d.ontimeout=function(){c(u("timeout of "+e.timeout+"ms exceeded",e,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var m=n(19),y=(e.withCredentials||a(e.url))&&e.xsrfCookieName?m.read(e.xsrfCookieName):void 0;y&&(p[e.xsrfHeaderName]=y)}if("setRequestHeader"in d&&r.forEach(p,function(e,t){"undefined"==typeof f&&"content-type"===t.toLowerCase()?delete p[t]:d.setRequestHeader(t,e)}),e.withCredentials&&(d.withCredentials=!0),e.responseType)try{d.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then(function(e){d&&(d.abort(),c(e),d=null)}),void 0===f&&(f=null),d.send(f)})}},function(e,t,n){"use strict";var r=n(15);e.exports=function(e,t,n){var o=n.config.validateStatus;!o||o(n.status)?e(n):t(r("Request failed with status code "+n.status,n.config,null,n.request,n))}},function(e,t,n){"use strict";var r=n(16);e.exports=function(e,t,n,o,s){var i=new Error(e);return r(i,t,n,o,s)}},function(e,t){"use strict";e.exports=function(e,t,n,r,o){return e.config=t,n&&(e.code=n),e.request=r,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},function(e,t,n){"use strict";var r=n(2),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];e.exports=function(e){var t,n,s,i={};return e?(r.forEach(e.split("\n"),function(e){if(s=e.indexOf(":"),t=r.trim(e.substr(0,s)).toLowerCase(),n=r.trim(e.substr(s+1)),t){if(i[t]&&o.indexOf(t)>=0)return;"set-cookie"===t?i[t]=(i[t]?i[t]:[]).concat([n]):i[t]=i[t]?i[t]+", "+n:n}}),i):i}},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){function e(e){var t=e;return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}var t,n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a");return t=e(window.location.href),function(n){var o=r.isString(n)?e(n):n;return o.protocol===t.protocol&&o.host===t.host}}():function(){return function(){return!0}}()},function(e,t,n){"use strict";var r=n(2);e.exports=r.isStandardBrowserEnv()?function(){return{write:function(e,t,n,o,s,i){var a=[];a.push(e+"="+encodeURIComponent(t)),r.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),r.isString(o)&&a.push("path="+o),r.isString(s)&&a.push("domain="+s),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},function(e,t){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},function(e,t){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},function(e,t,n){"use strict";var r=n(2);e.exports=function(e,t){t=t||{};var n={};return r.forEach(["url","method","params","data"],function(e){"undefined"!=typeof t[e]&&(n[e]=t[e])}),r.forEach(["headers","auth","proxy"],function(o){r.isObject(t[o])?n[o]=r.deepMerge(e[o],t[o]):"undefined"!=typeof t[o]?n[o]=t[o]:r.isObject(e[o])?n[o]=r.deepMerge(e[o]):"undefined"!=typeof e[o]&&(n[o]=e[o])}),r.forEach(["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"],function(r){"undefined"!=typeof t[r]?n[r]=t[r]:"undefined"!=typeof e[r]&&(n[r]=e[r])}),n}},function(e,t){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},function(e,t,n){"use strict";function r(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise(function(e){t=e});var n=this;e(function(e){n.reason||(n.reason=new o(e),t(n.reason))})}var o=n(23);r.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},r.source=function(){var e,t=new r(function(t){e=t});return{token:t,cancel:e}},e.exports=r},function(e,t){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}}])}); -//# sourceMappingURL=axios.min.map \ No newline at end of file diff --git a/src/main/resources/thymeleaf/static/js/libs/axios.min.map b/src/main/resources/thymeleaf/static/js/libs/axios.min.map deleted file mode 100644 index 9a4bbcc..0000000 --- a/src/main/resources/thymeleaf/static/js/libs/axios.min.map +++ /dev/null @@ -1,336 +0,0 @@ -{ - "version": 3, - "sources": [ - "webpack:///webpack/universalModuleDefinition", - "webpack:///axios.min.js", - "webpack:///webpack/bootstrap 3e317bb69558239a2225", - "webpack:///./index.js", - "webpack:///./lib/axios.js", - "webpack:///./lib/utils.js", - "webpack:///./lib/helpers/bind.js", - "webpack:///./~/is-buffer/index.js", - "webpack:///./lib/core/Axios.js", - "webpack:///./lib/helpers/buildURL.js", - "webpack:///./lib/core/InterceptorManager.js", - "webpack:///./lib/core/dispatchRequest.js", - "webpack:///./lib/core/transformData.js", - "webpack:///./lib/cancel/isCancel.js", - "webpack:///./lib/defaults.js", - "webpack:///./lib/helpers/normalizeHeaderName.js", - "webpack:///./lib/adapters/xhr.js", - "webpack:///./lib/core/settle.js", - "webpack:///./lib/core/createError.js", - "webpack:///./lib/core/enhanceError.js", - "webpack:///./lib/helpers/parseHeaders.js", - "webpack:///./lib/helpers/isURLSameOrigin.js", - "webpack:///./lib/helpers/cookies.js", - "webpack:///./lib/helpers/isAbsoluteURL.js", - "webpack:///./lib/helpers/combineURLs.js", - "webpack:///./lib/core/mergeConfig.js", - "webpack:///./lib/cancel/Cancel.js", - "webpack:///./lib/cancel/CancelToken.js", - "webpack:///./lib/helpers/spread.js" - ], - "names": [ - "root", - "factory", - "exports", - "module", - "define", - "amd", - "this", - "modules", - "__webpack_require__", - "moduleId", - "installedModules", - "id", - "loaded", - "call", - "m", - "c", - "p", - "createInstance", - "defaultConfig", - "context", - "Axios", - "instance", - "bind", - "prototype", - "request", - "utils", - "extend", - "mergeConfig", - "defaults", - "axios", - "create", - "instanceConfig", - "Cancel", - "CancelToken", - "isCancel", - "all", - "promises", - "Promise", - "spread", - "default", - "isArray", - "val", - "toString", - "isArrayBuffer", - "isFormData", - "FormData", - "isArrayBufferView", - "result", - "ArrayBuffer", - "isView", - "buffer", - "isString", - "isNumber", - "isUndefined", - "isObject", - "isDate", - "isFile", - "isBlob", - "isFunction", - "isStream", - "pipe", - "isURLSearchParams", - "URLSearchParams", - "trim", - "str", - "replace", - "isStandardBrowserEnv", - "navigator", - "product", - "window", - "document", - "forEach", - "obj", - "fn", - "i", - "l", - "length", - "key", - "Object", - "hasOwnProperty", - "merge", - "assignValue", - "arguments", - "deepMerge", - "a", - "b", - "thisArg", - "isBuffer", - "args", - "Array", - "apply", - "constructor", - "interceptors", - "InterceptorManager", - "response", - "buildURL", - "dispatchRequest", - "config", - "url", - "method", - "toLowerCase", - "chain", - "undefined", - "promise", - "resolve", - "interceptor", - "unshift", - "fulfilled", - "rejected", - "push", - "then", - "shift", - "getUri", - "params", - "paramsSerializer", - "data", - "encode", - "encodeURIComponent", - "serializedParams", - "parts", - "v", - "toISOString", - "JSON", - "stringify", - "join", - "hashmarkIndex", - "indexOf", - "slice", - "handlers", - "use", - "eject", - "h", - "throwIfCancellationRequested", - "cancelToken", - "throwIfRequested", - "transformData", - "isAbsoluteURL", - "combineURLs", - "baseURL", - "headers", - "transformRequest", - "common", - "adapter", - "transformResponse", - "reason", - "reject", - "fns", - "value", - "__CANCEL__", - "setContentTypeIfUnset", - "getDefaultAdapter", - "process", - "XMLHttpRequest", - "normalizeHeaderName", - "DEFAULT_CONTENT_TYPE", - "Content-Type", - "parse", - "e", - "timeout", - "xsrfCookieName", - "xsrfHeaderName", - "maxContentLength", - "validateStatus", - "status", - "Accept", - "normalizedName", - "name", - "toUpperCase", - "settle", - "parseHeaders", - "isURLSameOrigin", - "createError", - "requestData", - "requestHeaders", - "auth", - "username", - "password", - "Authorization", - "btoa", - "open", - "onreadystatechange", - "readyState", - "responseURL", - "responseHeaders", - "getAllResponseHeaders", - "responseData", - "responseType", - "responseText", - "statusText", - "onabort", - "onerror", - "ontimeout", - "cookies", - "xsrfValue", - "withCredentials", - "read", - "setRequestHeader", - "onDownloadProgress", - "addEventListener", - "onUploadProgress", - "upload", - "cancel", - "abort", - "send", - "enhanceError", - "message", - "code", - "error", - "Error", - "isAxiosError", - "toJSON", - "description", - "number", - "fileName", - "lineNumber", - "columnNumber", - "stack", - "ignoreDuplicateOf", - "parsed", - "split", - "line", - "substr", - "concat", - "resolveURL", - "href", - "msie", - "urlParsingNode", - "setAttribute", - "protocol", - "host", - "search", - "hash", - "hostname", - "port", - "pathname", - "charAt", - "originURL", - "test", - "userAgent", - "createElement", - "location", - "requestURL", - "write", - "expires", - "path", - "domain", - "secure", - "cookie", - "Date", - "toGMTString", - "match", - "RegExp", - "decodeURIComponent", - "remove", - "now", - "relativeURL", - "config1", - "config2", - "prop", - "executor", - "TypeError", - "resolvePromise", - "token", - "source", - "callback", - "arr" - ], - "mappings": "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", - "file": "axios.min.js", - "sourcesContent": [ - "(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition", - "(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"axios\"] = factory();\n\telse\n\t\troot[\"axios\"] = factory();\n})(this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\tmodule.exports = __webpack_require__(1);\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar bind = __webpack_require__(3);\n\tvar Axios = __webpack_require__(5);\n\tvar mergeConfig = __webpack_require__(22);\n\tvar defaults = __webpack_require__(11);\n\t\n\t/**\n\t * Create an instance of Axios\n\t *\n\t * @param {Object} defaultConfig The default config for the instance\n\t * @return {Axios} A new instance of Axios\n\t */\n\tfunction createInstance(defaultConfig) {\n\t var context = new Axios(defaultConfig);\n\t var instance = bind(Axios.prototype.request, context);\n\t\n\t // Copy axios.prototype to instance\n\t utils.extend(instance, Axios.prototype, context);\n\t\n\t // Copy context to instance\n\t utils.extend(instance, context);\n\t\n\t return instance;\n\t}\n\t\n\t// Create the default instance to be exported\n\tvar axios = createInstance(defaults);\n\t\n\t// Expose Axios class to allow class inheritance\n\taxios.Axios = Axios;\n\t\n\t// Factory for creating new instances\n\taxios.create = function create(instanceConfig) {\n\t return createInstance(mergeConfig(axios.defaults, instanceConfig));\n\t};\n\t\n\t// Expose Cancel & CancelToken\n\taxios.Cancel = __webpack_require__(23);\n\taxios.CancelToken = __webpack_require__(24);\n\taxios.isCancel = __webpack_require__(10);\n\t\n\t// Expose all/spread\n\taxios.all = function all(promises) {\n\t return Promise.all(promises);\n\t};\n\taxios.spread = __webpack_require__(25);\n\t\n\tmodule.exports = axios;\n\t\n\t// Allow use of default import syntax in TypeScript\n\tmodule.exports.default = axios;\n\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar bind = __webpack_require__(3);\n\tvar isBuffer = __webpack_require__(4);\n\t\n\t/*global toString:true*/\n\t\n\t// utils is a library of generic helper functions non-specific to axios\n\t\n\tvar toString = Object.prototype.toString;\n\t\n\t/**\n\t * Determine if a value is an Array\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Array, otherwise false\n\t */\n\tfunction isArray(val) {\n\t return toString.call(val) === '[object Array]';\n\t}\n\t\n\t/**\n\t * Determine if a value is an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBuffer(val) {\n\t return toString.call(val) === '[object ArrayBuffer]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a FormData\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an FormData, otherwise false\n\t */\n\tfunction isFormData(val) {\n\t return (typeof FormData !== 'undefined') && (val instanceof FormData);\n\t}\n\t\n\t/**\n\t * Determine if a value is a view on an ArrayBuffer\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n\t */\n\tfunction isArrayBufferView(val) {\n\t var result;\n\t if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n\t result = ArrayBuffer.isView(val);\n\t } else {\n\t result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Determine if a value is a String\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a String, otherwise false\n\t */\n\tfunction isString(val) {\n\t return typeof val === 'string';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Number\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Number, otherwise false\n\t */\n\tfunction isNumber(val) {\n\t return typeof val === 'number';\n\t}\n\t\n\t/**\n\t * Determine if a value is undefined\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if the value is undefined, otherwise false\n\t */\n\tfunction isUndefined(val) {\n\t return typeof val === 'undefined';\n\t}\n\t\n\t/**\n\t * Determine if a value is an Object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is an Object, otherwise false\n\t */\n\tfunction isObject(val) {\n\t return val !== null && typeof val === 'object';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Date\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Date, otherwise false\n\t */\n\tfunction isDate(val) {\n\t return toString.call(val) === '[object Date]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a File\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a File, otherwise false\n\t */\n\tfunction isFile(val) {\n\t return toString.call(val) === '[object File]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Blob\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Blob, otherwise false\n\t */\n\tfunction isBlob(val) {\n\t return toString.call(val) === '[object Blob]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Function\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Function, otherwise false\n\t */\n\tfunction isFunction(val) {\n\t return toString.call(val) === '[object Function]';\n\t}\n\t\n\t/**\n\t * Determine if a value is a Stream\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a Stream, otherwise false\n\t */\n\tfunction isStream(val) {\n\t return isObject(val) && isFunction(val.pipe);\n\t}\n\t\n\t/**\n\t * Determine if a value is a URLSearchParams object\n\t *\n\t * @param {Object} val The value to test\n\t * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n\t */\n\tfunction isURLSearchParams(val) {\n\t return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n\t}\n\t\n\t/**\n\t * Trim excess whitespace off the beginning and end of a string\n\t *\n\t * @param {String} str The String to trim\n\t * @returns {String} The String freed of excess whitespace\n\t */\n\tfunction trim(str) {\n\t return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n\t}\n\t\n\t/**\n\t * Determine if we're running in a standard browser environment\n\t *\n\t * This allows axios to run in a web worker, and react-native.\n\t * Both environments support XMLHttpRequest, but not fully standard globals.\n\t *\n\t * web workers:\n\t * typeof window -> undefined\n\t * typeof document -> undefined\n\t *\n\t * react-native:\n\t * navigator.product -> 'ReactNative'\n\t * nativescript\n\t * navigator.product -> 'NativeScript' or 'NS'\n\t */\n\tfunction isStandardBrowserEnv() {\n\t if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n\t navigator.product === 'NativeScript' ||\n\t navigator.product === 'NS')) {\n\t return false;\n\t }\n\t return (\n\t typeof window !== 'undefined' &&\n\t typeof document !== 'undefined'\n\t );\n\t}\n\t\n\t/**\n\t * Iterate over an Array or an Object invoking a function for each item.\n\t *\n\t * If `obj` is an Array callback will be called passing\n\t * the value, index, and complete array for each item.\n\t *\n\t * If 'obj' is an Object callback will be called passing\n\t * the value, key, and complete object for each property.\n\t *\n\t * @param {Object|Array} obj The object to iterate\n\t * @param {Function} fn The callback to invoke for each item\n\t */\n\tfunction forEach(obj, fn) {\n\t // Don't bother if no value provided\n\t if (obj === null || typeof obj === 'undefined') {\n\t return;\n\t }\n\t\n\t // Force an array if not already something iterable\n\t if (typeof obj !== 'object') {\n\t /*eslint no-param-reassign:0*/\n\t obj = [obj];\n\t }\n\t\n\t if (isArray(obj)) {\n\t // Iterate over array values\n\t for (var i = 0, l = obj.length; i < l; i++) {\n\t fn.call(null, obj[i], i, obj);\n\t }\n\t } else {\n\t // Iterate over object keys\n\t for (var key in obj) {\n\t if (Object.prototype.hasOwnProperty.call(obj, key)) {\n\t fn.call(null, obj[key], key, obj);\n\t }\n\t }\n\t }\n\t}\n\t\n\t/**\n\t * Accepts varargs expecting each argument to be an object, then\n\t * immutably merges the properties of each object and returns result.\n\t *\n\t * When multiple objects contain the same key the later object in\n\t * the arguments list will take precedence.\n\t *\n\t * Example:\n\t *\n\t * ```js\n\t * var result = merge({foo: 123}, {foo: 456});\n\t * console.log(result.foo); // outputs 456\n\t * ```\n\t *\n\t * @param {Object} obj1 Object to merge\n\t * @returns {Object} Result of all merge properties\n\t */\n\tfunction merge(/* obj1, obj2, obj3, ... */) {\n\t var result = {};\n\t function assignValue(val, key) {\n\t if (typeof result[key] === 'object' && typeof val === 'object') {\n\t result[key] = merge(result[key], val);\n\t } else {\n\t result[key] = val;\n\t }\n\t }\n\t\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t forEach(arguments[i], assignValue);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Function equal to merge with the difference being that no reference\n\t * to original objects is kept.\n\t *\n\t * @see merge\n\t * @param {Object} obj1 Object to merge\n\t * @returns {Object} Result of all merge properties\n\t */\n\tfunction deepMerge(/* obj1, obj2, obj3, ... */) {\n\t var result = {};\n\t function assignValue(val, key) {\n\t if (typeof result[key] === 'object' && typeof val === 'object') {\n\t result[key] = deepMerge(result[key], val);\n\t } else if (typeof val === 'object') {\n\t result[key] = deepMerge({}, val);\n\t } else {\n\t result[key] = val;\n\t }\n\t }\n\t\n\t for (var i = 0, l = arguments.length; i < l; i++) {\n\t forEach(arguments[i], assignValue);\n\t }\n\t return result;\n\t}\n\t\n\t/**\n\t * Extends object a by mutably adding to it the properties of object b.\n\t *\n\t * @param {Object} a The object to be extended\n\t * @param {Object} b The object to copy properties from\n\t * @param {Object} thisArg The object to bind function to\n\t * @return {Object} The resulting value of object a\n\t */\n\tfunction extend(a, b, thisArg) {\n\t forEach(b, function assignValue(val, key) {\n\t if (thisArg && typeof val === 'function') {\n\t a[key] = bind(val, thisArg);\n\t } else {\n\t a[key] = val;\n\t }\n\t });\n\t return a;\n\t}\n\t\n\tmodule.exports = {\n\t isArray: isArray,\n\t isArrayBuffer: isArrayBuffer,\n\t isBuffer: isBuffer,\n\t isFormData: isFormData,\n\t isArrayBufferView: isArrayBufferView,\n\t isString: isString,\n\t isNumber: isNumber,\n\t isObject: isObject,\n\t isUndefined: isUndefined,\n\t isDate: isDate,\n\t isFile: isFile,\n\t isBlob: isBlob,\n\t isFunction: isFunction,\n\t isStream: isStream,\n\t isURLSearchParams: isURLSearchParams,\n\t isStandardBrowserEnv: isStandardBrowserEnv,\n\t forEach: forEach,\n\t merge: merge,\n\t deepMerge: deepMerge,\n\t extend: extend,\n\t trim: trim\n\t};\n\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function bind(fn, thisArg) {\n\t return function wrap() {\n\t var args = new Array(arguments.length);\n\t for (var i = 0; i < args.length; i++) {\n\t args[i] = arguments[i];\n\t }\n\t return fn.apply(thisArg, args);\n\t };\n\t};\n\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports) {\n\n\t/*!\n\t * Determine if an object is a Buffer\n\t *\n\t * @author Feross Aboukhadijeh \n\t * @license MIT\n\t */\n\t\n\tmodule.exports = function isBuffer (obj) {\n\t return obj != null && obj.constructor != null &&\n\t typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n\t}\n\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar buildURL = __webpack_require__(6);\n\tvar InterceptorManager = __webpack_require__(7);\n\tvar dispatchRequest = __webpack_require__(8);\n\tvar mergeConfig = __webpack_require__(22);\n\t\n\t/**\n\t * Create a new instance of Axios\n\t *\n\t * @param {Object} instanceConfig The default config for the instance\n\t */\n\tfunction Axios(instanceConfig) {\n\t this.defaults = instanceConfig;\n\t this.interceptors = {\n\t request: new InterceptorManager(),\n\t response: new InterceptorManager()\n\t };\n\t}\n\t\n\t/**\n\t * Dispatch a request\n\t *\n\t * @param {Object} config The config specific for this request (merged with this.defaults)\n\t */\n\tAxios.prototype.request = function request(config) {\n\t /*eslint no-param-reassign:0*/\n\t // Allow for axios('example/url'[, config]) a la fetch API\n\t if (typeof config === 'string') {\n\t config = arguments[1] || {};\n\t config.url = arguments[0];\n\t } else {\n\t config = config || {};\n\t }\n\t\n\t config = mergeConfig(this.defaults, config);\n\t config.method = config.method ? config.method.toLowerCase() : 'get';\n\t\n\t // Hook up interceptors middleware\n\t var chain = [dispatchRequest, undefined];\n\t var promise = Promise.resolve(config);\n\t\n\t this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n\t chain.unshift(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n\t chain.push(interceptor.fulfilled, interceptor.rejected);\n\t });\n\t\n\t while (chain.length) {\n\t promise = promise.then(chain.shift(), chain.shift());\n\t }\n\t\n\t return promise;\n\t};\n\t\n\tAxios.prototype.getUri = function getUri(config) {\n\t config = mergeConfig(this.defaults, config);\n\t return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n\t};\n\t\n\t// Provide aliases for supported request methods\n\tutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, config) {\n\t return this.request(utils.merge(config || {}, {\n\t method: method,\n\t url: url\n\t }));\n\t };\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t /*eslint func-names:0*/\n\t Axios.prototype[method] = function(url, data, config) {\n\t return this.request(utils.merge(config || {}, {\n\t method: method,\n\t url: url,\n\t data: data\n\t }));\n\t };\n\t});\n\t\n\tmodule.exports = Axios;\n\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction encode(val) {\n\t return encodeURIComponent(val).\n\t replace(/%40/gi, '@').\n\t replace(/%3A/gi, ':').\n\t replace(/%24/g, '$').\n\t replace(/%2C/gi, ',').\n\t replace(/%20/g, '+').\n\t replace(/%5B/gi, '[').\n\t replace(/%5D/gi, ']');\n\t}\n\t\n\t/**\n\t * Build a URL by appending params to the end\n\t *\n\t * @param {string} url The base of the url (e.g., http://www.google.com)\n\t * @param {object} [params] The params to be appended\n\t * @returns {string} The formatted url\n\t */\n\tmodule.exports = function buildURL(url, params, paramsSerializer) {\n\t /*eslint no-param-reassign:0*/\n\t if (!params) {\n\t return url;\n\t }\n\t\n\t var serializedParams;\n\t if (paramsSerializer) {\n\t serializedParams = paramsSerializer(params);\n\t } else if (utils.isURLSearchParams(params)) {\n\t serializedParams = params.toString();\n\t } else {\n\t var parts = [];\n\t\n\t utils.forEach(params, function serialize(val, key) {\n\t if (val === null || typeof val === 'undefined') {\n\t return;\n\t }\n\t\n\t if (utils.isArray(val)) {\n\t key = key + '[]';\n\t } else {\n\t val = [val];\n\t }\n\t\n\t utils.forEach(val, function parseValue(v) {\n\t if (utils.isDate(v)) {\n\t v = v.toISOString();\n\t } else if (utils.isObject(v)) {\n\t v = JSON.stringify(v);\n\t }\n\t parts.push(encode(key) + '=' + encode(v));\n\t });\n\t });\n\t\n\t serializedParams = parts.join('&');\n\t }\n\t\n\t if (serializedParams) {\n\t var hashmarkIndex = url.indexOf('#');\n\t if (hashmarkIndex !== -1) {\n\t url = url.slice(0, hashmarkIndex);\n\t }\n\t\n\t url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n\t }\n\t\n\t return url;\n\t};\n\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tfunction InterceptorManager() {\n\t this.handlers = [];\n\t}\n\t\n\t/**\n\t * Add a new interceptor to the stack\n\t *\n\t * @param {Function} fulfilled The function to handle `then` for a `Promise`\n\t * @param {Function} rejected The function to handle `reject` for a `Promise`\n\t *\n\t * @return {Number} An ID used to remove interceptor later\n\t */\n\tInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n\t this.handlers.push({\n\t fulfilled: fulfilled,\n\t rejected: rejected\n\t });\n\t return this.handlers.length - 1;\n\t};\n\t\n\t/**\n\t * Remove an interceptor from the stack\n\t *\n\t * @param {Number} id The ID that was returned by `use`\n\t */\n\tInterceptorManager.prototype.eject = function eject(id) {\n\t if (this.handlers[id]) {\n\t this.handlers[id] = null;\n\t }\n\t};\n\t\n\t/**\n\t * Iterate over all the registered interceptors\n\t *\n\t * This method is particularly useful for skipping over any\n\t * interceptors that may have become `null` calling `eject`.\n\t *\n\t * @param {Function} fn The function to call for each interceptor\n\t */\n\tInterceptorManager.prototype.forEach = function forEach(fn) {\n\t utils.forEach(this.handlers, function forEachHandler(h) {\n\t if (h !== null) {\n\t fn(h);\n\t }\n\t });\n\t};\n\t\n\tmodule.exports = InterceptorManager;\n\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar transformData = __webpack_require__(9);\n\tvar isCancel = __webpack_require__(10);\n\tvar defaults = __webpack_require__(11);\n\tvar isAbsoluteURL = __webpack_require__(20);\n\tvar combineURLs = __webpack_require__(21);\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tfunction throwIfCancellationRequested(config) {\n\t if (config.cancelToken) {\n\t config.cancelToken.throwIfRequested();\n\t }\n\t}\n\t\n\t/**\n\t * Dispatch a request to the server using the configured adapter.\n\t *\n\t * @param {object} config The config that is to be used for the request\n\t * @returns {Promise} The Promise to be fulfilled\n\t */\n\tmodule.exports = function dispatchRequest(config) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Support baseURL config\n\t if (config.baseURL && !isAbsoluteURL(config.url)) {\n\t config.url = combineURLs(config.baseURL, config.url);\n\t }\n\t\n\t // Ensure headers exist\n\t config.headers = config.headers || {};\n\t\n\t // Transform request data\n\t config.data = transformData(\n\t config.data,\n\t config.headers,\n\t config.transformRequest\n\t );\n\t\n\t // Flatten headers\n\t config.headers = utils.merge(\n\t config.headers.common || {},\n\t config.headers[config.method] || {},\n\t config.headers || {}\n\t );\n\t\n\t utils.forEach(\n\t ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n\t function cleanHeaderConfig(method) {\n\t delete config.headers[method];\n\t }\n\t );\n\t\n\t var adapter = config.adapter || defaults.adapter;\n\t\n\t return adapter(config).then(function onAdapterResolution(response) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t response.data = transformData(\n\t response.data,\n\t response.headers,\n\t config.transformResponse\n\t );\n\t\n\t return response;\n\t }, function onAdapterRejection(reason) {\n\t if (!isCancel(reason)) {\n\t throwIfCancellationRequested(config);\n\t\n\t // Transform response data\n\t if (reason && reason.response) {\n\t reason.response.data = transformData(\n\t reason.response.data,\n\t reason.response.headers,\n\t config.transformResponse\n\t );\n\t }\n\t }\n\t\n\t return Promise.reject(reason);\n\t });\n\t};\n\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t/**\n\t * Transform the data for a request or a response\n\t *\n\t * @param {Object|String} data The data to be transformed\n\t * @param {Array} headers The headers for the request or response\n\t * @param {Array|Function} fns A single function or Array of functions\n\t * @returns {*} The resulting transformed data\n\t */\n\tmodule.exports = function transformData(data, headers, fns) {\n\t /*eslint no-param-reassign:0*/\n\t utils.forEach(fns, function transform(fn) {\n\t data = fn(data, headers);\n\t });\n\t\n\t return data;\n\t};\n\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tmodule.exports = function isCancel(value) {\n\t return !!(value && value.__CANCEL__);\n\t};\n\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar normalizeHeaderName = __webpack_require__(12);\n\t\n\tvar DEFAULT_CONTENT_TYPE = {\n\t 'Content-Type': 'application/x-www-form-urlencoded'\n\t};\n\t\n\tfunction setContentTypeIfUnset(headers, value) {\n\t if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n\t headers['Content-Type'] = value;\n\t }\n\t}\n\t\n\tfunction getDefaultAdapter() {\n\t var adapter;\n\t // Only Node.JS has a process variable that is of [[Class]] process\n\t if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n\t // For node use HTTP adapter\n\t adapter = __webpack_require__(13);\n\t } else if (typeof XMLHttpRequest !== 'undefined') {\n\t // For browsers use XHR adapter\n\t adapter = __webpack_require__(13);\n\t }\n\t return adapter;\n\t}\n\t\n\tvar defaults = {\n\t adapter: getDefaultAdapter(),\n\t\n\t transformRequest: [function transformRequest(data, headers) {\n\t normalizeHeaderName(headers, 'Accept');\n\t normalizeHeaderName(headers, 'Content-Type');\n\t if (utils.isFormData(data) ||\n\t utils.isArrayBuffer(data) ||\n\t utils.isBuffer(data) ||\n\t utils.isStream(data) ||\n\t utils.isFile(data) ||\n\t utils.isBlob(data)\n\t ) {\n\t return data;\n\t }\n\t if (utils.isArrayBufferView(data)) {\n\t return data.buffer;\n\t }\n\t if (utils.isURLSearchParams(data)) {\n\t setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n\t return data.toString();\n\t }\n\t if (utils.isObject(data)) {\n\t setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n\t return JSON.stringify(data);\n\t }\n\t return data;\n\t }],\n\t\n\t transformResponse: [function transformResponse(data) {\n\t /*eslint no-param-reassign:0*/\n\t if (typeof data === 'string') {\n\t try {\n\t data = JSON.parse(data);\n\t } catch (e) { /* Ignore */ }\n\t }\n\t return data;\n\t }],\n\t\n\t /**\n\t * A timeout in milliseconds to abort a request. If set to 0 (default) a\n\t * timeout is not created.\n\t */\n\t timeout: 0,\n\t\n\t xsrfCookieName: 'XSRF-TOKEN',\n\t xsrfHeaderName: 'X-XSRF-TOKEN',\n\t\n\t maxContentLength: -1,\n\t\n\t validateStatus: function validateStatus(status) {\n\t return status >= 200 && status < 300;\n\t }\n\t};\n\t\n\tdefaults.headers = {\n\t common: {\n\t 'Accept': 'application/json, text/plain, */*'\n\t }\n\t};\n\t\n\tutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n\t defaults.headers[method] = {};\n\t});\n\t\n\tutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n\t defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n\t});\n\t\n\tmodule.exports = defaults;\n\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n\t utils.forEach(headers, function processHeader(value, name) {\n\t if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n\t headers[normalizedName] = value;\n\t delete headers[name];\n\t }\n\t });\n\t};\n\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\tvar settle = __webpack_require__(14);\n\tvar buildURL = __webpack_require__(6);\n\tvar parseHeaders = __webpack_require__(17);\n\tvar isURLSameOrigin = __webpack_require__(18);\n\tvar createError = __webpack_require__(15);\n\t\n\tmodule.exports = function xhrAdapter(config) {\n\t return new Promise(function dispatchXhrRequest(resolve, reject) {\n\t var requestData = config.data;\n\t var requestHeaders = config.headers;\n\t\n\t if (utils.isFormData(requestData)) {\n\t delete requestHeaders['Content-Type']; // Let the browser set it\n\t }\n\t\n\t var request = new XMLHttpRequest();\n\t\n\t // HTTP basic authentication\n\t if (config.auth) {\n\t var username = config.auth.username || '';\n\t var password = config.auth.password || '';\n\t requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n\t }\n\t\n\t request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\t\n\t // Set the request timeout in MS\n\t request.timeout = config.timeout;\n\t\n\t // Listen for ready state\n\t request.onreadystatechange = function handleLoad() {\n\t if (!request || request.readyState !== 4) {\n\t return;\n\t }\n\t\n\t // The request errored out and we didn't get a response, this will be\n\t // handled by onerror instead\n\t // With one exception: request that using file: protocol, most browsers\n\t // will return status as 0 even though it's a successful request\n\t if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n\t return;\n\t }\n\t\n\t // Prepare the response\n\t var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n\t var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n\t var response = {\n\t data: responseData,\n\t status: request.status,\n\t statusText: request.statusText,\n\t headers: responseHeaders,\n\t config: config,\n\t request: request\n\t };\n\t\n\t settle(resolve, reject, response);\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle browser request cancellation (as opposed to a manual cancellation)\n\t request.onabort = function handleAbort() {\n\t if (!request) {\n\t return;\n\t }\n\t\n\t reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle low level network errors\n\t request.onerror = function handleError() {\n\t // Real errors are hidden from us by the browser\n\t // onerror should only fire if it's a network error\n\t reject(createError('Network Error', config, null, request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Handle timeout\n\t request.ontimeout = function handleTimeout() {\n\t reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n\t request));\n\t\n\t // Clean up request\n\t request = null;\n\t };\n\t\n\t // Add xsrf header\n\t // This is only done if running in a standard browser environment.\n\t // Specifically not if we're in a web worker, or react-native.\n\t if (utils.isStandardBrowserEnv()) {\n\t var cookies = __webpack_require__(19);\n\t\n\t // Add xsrf header\n\t var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n\t cookies.read(config.xsrfCookieName) :\n\t undefined;\n\t\n\t if (xsrfValue) {\n\t requestHeaders[config.xsrfHeaderName] = xsrfValue;\n\t }\n\t }\n\t\n\t // Add headers to the request\n\t if ('setRequestHeader' in request) {\n\t utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n\t if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n\t // Remove Content-Type if data is undefined\n\t delete requestHeaders[key];\n\t } else {\n\t // Otherwise add header to the request\n\t request.setRequestHeader(key, val);\n\t }\n\t });\n\t }\n\t\n\t // Add withCredentials to request if needed\n\t if (config.withCredentials) {\n\t request.withCredentials = true;\n\t }\n\t\n\t // Add responseType to request if needed\n\t if (config.responseType) {\n\t try {\n\t request.responseType = config.responseType;\n\t } catch (e) {\n\t // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n\t // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n\t if (config.responseType !== 'json') {\n\t throw e;\n\t }\n\t }\n\t }\n\t\n\t // Handle progress if needed\n\t if (typeof config.onDownloadProgress === 'function') {\n\t request.addEventListener('progress', config.onDownloadProgress);\n\t }\n\t\n\t // Not all browsers support upload events\n\t if (typeof config.onUploadProgress === 'function' && request.upload) {\n\t request.upload.addEventListener('progress', config.onUploadProgress);\n\t }\n\t\n\t if (config.cancelToken) {\n\t // Handle cancellation\n\t config.cancelToken.promise.then(function onCanceled(cancel) {\n\t if (!request) {\n\t return;\n\t }\n\t\n\t request.abort();\n\t reject(cancel);\n\t // Clean up request\n\t request = null;\n\t });\n\t }\n\t\n\t if (requestData === undefined) {\n\t requestData = null;\n\t }\n\t\n\t // Send the request\n\t request.send(requestData);\n\t });\n\t};\n\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar createError = __webpack_require__(15);\n\t\n\t/**\n\t * Resolve or reject a Promise based on response status.\n\t *\n\t * @param {Function} resolve A function that resolves the promise.\n\t * @param {Function} reject A function that rejects the promise.\n\t * @param {object} response The response.\n\t */\n\tmodule.exports = function settle(resolve, reject, response) {\n\t var validateStatus = response.config.validateStatus;\n\t if (!validateStatus || validateStatus(response.status)) {\n\t resolve(response);\n\t } else {\n\t reject(createError(\n\t 'Request failed with status code ' + response.status,\n\t response.config,\n\t null,\n\t response.request,\n\t response\n\t ));\n\t }\n\t};\n\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar enhanceError = __webpack_require__(16);\n\t\n\t/**\n\t * Create an Error with the specified message, config, error code, request and response.\n\t *\n\t * @param {string} message The error message.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The created error.\n\t */\n\tmodule.exports = function createError(message, config, code, request, response) {\n\t var error = new Error(message);\n\t return enhanceError(error, config, code, request, response);\n\t};\n\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Update an Error with the specified config, error code, and response.\n\t *\n\t * @param {Error} error The error to update.\n\t * @param {Object} config The config.\n\t * @param {string} [code] The error code (for example, 'ECONNABORTED').\n\t * @param {Object} [request] The request.\n\t * @param {Object} [response] The response.\n\t * @returns {Error} The error.\n\t */\n\tmodule.exports = function enhanceError(error, config, code, request, response) {\n\t error.config = config;\n\t if (code) {\n\t error.code = code;\n\t }\n\t\n\t error.request = request;\n\t error.response = response;\n\t error.isAxiosError = true;\n\t\n\t error.toJSON = function() {\n\t return {\n\t // Standard\n\t message: this.message,\n\t name: this.name,\n\t // Microsoft\n\t description: this.description,\n\t number: this.number,\n\t // Mozilla\n\t fileName: this.fileName,\n\t lineNumber: this.lineNumber,\n\t columnNumber: this.columnNumber,\n\t stack: this.stack,\n\t // Axios\n\t config: this.config,\n\t code: this.code\n\t };\n\t };\n\t return error;\n\t};\n\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t// Headers whose duplicates are ignored by node\n\t// c.f. https://nodejs.org/api/http.html#http_message_headers\n\tvar ignoreDuplicateOf = [\n\t 'age', 'authorization', 'content-length', 'content-type', 'etag',\n\t 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n\t 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n\t 'referer', 'retry-after', 'user-agent'\n\t];\n\t\n\t/**\n\t * Parse headers into an object\n\t *\n\t * ```\n\t * Date: Wed, 27 Aug 2014 08:58:49 GMT\n\t * Content-Type: application/json\n\t * Connection: keep-alive\n\t * Transfer-Encoding: chunked\n\t * ```\n\t *\n\t * @param {String} headers Headers needing to be parsed\n\t * @returns {Object} Headers parsed into an object\n\t */\n\tmodule.exports = function parseHeaders(headers) {\n\t var parsed = {};\n\t var key;\n\t var val;\n\t var i;\n\t\n\t if (!headers) { return parsed; }\n\t\n\t utils.forEach(headers.split('\\n'), function parser(line) {\n\t i = line.indexOf(':');\n\t key = utils.trim(line.substr(0, i)).toLowerCase();\n\t val = utils.trim(line.substr(i + 1));\n\t\n\t if (key) {\n\t if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n\t return;\n\t }\n\t if (key === 'set-cookie') {\n\t parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n\t } else {\n\t parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n\t }\n\t }\n\t });\n\t\n\t return parsed;\n\t};\n\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs have full support of the APIs needed to test\n\t // whether the request URL is of the same origin as current location.\n\t (function standardBrowserEnv() {\n\t var msie = /(msie|trident)/i.test(navigator.userAgent);\n\t var urlParsingNode = document.createElement('a');\n\t var originURL;\n\t\n\t /**\n\t * Parse a URL to discover it's components\n\t *\n\t * @param {String} url The URL to be parsed\n\t * @returns {Object}\n\t */\n\t function resolveURL(url) {\n\t var href = url;\n\t\n\t if (msie) {\n\t // IE needs attribute set twice to normalize properties\n\t urlParsingNode.setAttribute('href', href);\n\t href = urlParsingNode.href;\n\t }\n\t\n\t urlParsingNode.setAttribute('href', href);\n\t\n\t // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n\t return {\n\t href: urlParsingNode.href,\n\t protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n\t host: urlParsingNode.host,\n\t search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n\t hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n\t hostname: urlParsingNode.hostname,\n\t port: urlParsingNode.port,\n\t pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n\t urlParsingNode.pathname :\n\t '/' + urlParsingNode.pathname\n\t };\n\t }\n\t\n\t originURL = resolveURL(window.location.href);\n\t\n\t /**\n\t * Determine if a URL shares the same origin as the current location\n\t *\n\t * @param {String} requestURL The URL to test\n\t * @returns {boolean} True if URL shares the same origin, otherwise false\n\t */\n\t return function isURLSameOrigin(requestURL) {\n\t var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n\t return (parsed.protocol === originURL.protocol &&\n\t parsed.host === originURL.host);\n\t };\n\t })() :\n\t\n\t // Non standard browser envs (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return function isURLSameOrigin() {\n\t return true;\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\tmodule.exports = (\n\t utils.isStandardBrowserEnv() ?\n\t\n\t // Standard browser envs support document.cookie\n\t (function standardBrowserEnv() {\n\t return {\n\t write: function write(name, value, expires, path, domain, secure) {\n\t var cookie = [];\n\t cookie.push(name + '=' + encodeURIComponent(value));\n\t\n\t if (utils.isNumber(expires)) {\n\t cookie.push('expires=' + new Date(expires).toGMTString());\n\t }\n\t\n\t if (utils.isString(path)) {\n\t cookie.push('path=' + path);\n\t }\n\t\n\t if (utils.isString(domain)) {\n\t cookie.push('domain=' + domain);\n\t }\n\t\n\t if (secure === true) {\n\t cookie.push('secure');\n\t }\n\t\n\t document.cookie = cookie.join('; ');\n\t },\n\t\n\t read: function read(name) {\n\t var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n\t return (match ? decodeURIComponent(match[3]) : null);\n\t },\n\t\n\t remove: function remove(name) {\n\t this.write(name, '', Date.now() - 86400000);\n\t }\n\t };\n\t })() :\n\t\n\t // Non standard browser env (web workers, react-native) lack needed support.\n\t (function nonStandardBrowserEnv() {\n\t return {\n\t write: function write() {},\n\t read: function read() { return null; },\n\t remove: function remove() {}\n\t };\n\t })()\n\t);\n\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Determines whether the specified URL is absolute\n\t *\n\t * @param {string} url The URL to test\n\t * @returns {boolean} True if the specified URL is absolute, otherwise false\n\t */\n\tmodule.exports = function isAbsoluteURL(url) {\n\t // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n\t // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n\t // by any combination of letters, digits, plus, period, or hyphen.\n\t return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n\t};\n\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Creates a new URL by combining the specified URLs\n\t *\n\t * @param {string} baseURL The base URL\n\t * @param {string} relativeURL The relative URL\n\t * @returns {string} The combined URL\n\t */\n\tmodule.exports = function combineURLs(baseURL, relativeURL) {\n\t return relativeURL\n\t ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n\t : baseURL;\n\t};\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar utils = __webpack_require__(2);\n\t\n\t/**\n\t * Config-specific merge-function which creates a new config-object\n\t * by merging two configuration objects together.\n\t *\n\t * @param {Object} config1\n\t * @param {Object} config2\n\t * @returns {Object} New object resulting from merging config2 to config1\n\t */\n\tmodule.exports = function mergeConfig(config1, config2) {\n\t // eslint-disable-next-line no-param-reassign\n\t config2 = config2 || {};\n\t var config = {};\n\t\n\t utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) {\n\t if (typeof config2[prop] !== 'undefined') {\n\t config[prop] = config2[prop];\n\t }\n\t });\n\t\n\t utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) {\n\t if (utils.isObject(config2[prop])) {\n\t config[prop] = utils.deepMerge(config1[prop], config2[prop]);\n\t } else if (typeof config2[prop] !== 'undefined') {\n\t config[prop] = config2[prop];\n\t } else if (utils.isObject(config1[prop])) {\n\t config[prop] = utils.deepMerge(config1[prop]);\n\t } else if (typeof config1[prop] !== 'undefined') {\n\t config[prop] = config1[prop];\n\t }\n\t });\n\t\n\t utils.forEach([\n\t 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n\t 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n\t 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength',\n\t 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken',\n\t 'socketPath'\n\t ], function defaultToConfig2(prop) {\n\t if (typeof config2[prop] !== 'undefined') {\n\t config[prop] = config2[prop];\n\t } else if (typeof config1[prop] !== 'undefined') {\n\t config[prop] = config1[prop];\n\t }\n\t });\n\t\n\t return config;\n\t};\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * A `Cancel` is an object that is thrown when an operation is canceled.\n\t *\n\t * @class\n\t * @param {string=} message The message.\n\t */\n\tfunction Cancel(message) {\n\t this.message = message;\n\t}\n\t\n\tCancel.prototype.toString = function toString() {\n\t return 'Cancel' + (this.message ? ': ' + this.message : '');\n\t};\n\t\n\tCancel.prototype.__CANCEL__ = true;\n\t\n\tmodule.exports = Cancel;\n\n\n/***/ }),\n/* 24 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar Cancel = __webpack_require__(23);\n\t\n\t/**\n\t * A `CancelToken` is an object that can be used to request cancellation of an operation.\n\t *\n\t * @class\n\t * @param {Function} executor The executor function.\n\t */\n\tfunction CancelToken(executor) {\n\t if (typeof executor !== 'function') {\n\t throw new TypeError('executor must be a function.');\n\t }\n\t\n\t var resolvePromise;\n\t this.promise = new Promise(function promiseExecutor(resolve) {\n\t resolvePromise = resolve;\n\t });\n\t\n\t var token = this;\n\t executor(function cancel(message) {\n\t if (token.reason) {\n\t // Cancellation has already been requested\n\t return;\n\t }\n\t\n\t token.reason = new Cancel(message);\n\t resolvePromise(token.reason);\n\t });\n\t}\n\t\n\t/**\n\t * Throws a `Cancel` if cancellation has been requested.\n\t */\n\tCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n\t if (this.reason) {\n\t throw this.reason;\n\t }\n\t};\n\t\n\t/**\n\t * Returns an object that contains a new `CancelToken` and a function that, when called,\n\t * cancels the `CancelToken`.\n\t */\n\tCancelToken.source = function source() {\n\t var cancel;\n\t var token = new CancelToken(function executor(c) {\n\t cancel = c;\n\t });\n\t return {\n\t token: token,\n\t cancel: cancel\n\t };\n\t};\n\t\n\tmodule.exports = CancelToken;\n\n\n/***/ }),\n/* 25 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Syntactic sugar for invoking a function and expanding an array for arguments.\n\t *\n\t * Common use case would be to use `Function.prototype.apply`.\n\t *\n\t * ```js\n\t * function f(x, y, z) {}\n\t * var args = [1, 2, 3];\n\t * f.apply(null, args);\n\t * ```\n\t *\n\t * With `spread` this example can be re-written.\n\t *\n\t * ```js\n\t * spread(function(x, y, z) {})([1, 2, 3]);\n\t * ```\n\t *\n\t * @param {Function} callback\n\t * @returns {Function}\n\t */\n\tmodule.exports = function spread(callback) {\n\t return function wrap(arr) {\n\t return callback.apply(null, arr);\n\t };\n\t};\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// axios.min.js", - " \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 3e317bb69558239a2225", - "module.exports = require('./lib/axios');\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar mergeConfig = require('./core/mergeConfig');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(mergeConfig(axios.defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/axios.js\n// module id = 1\n// module chunks = 0", - "'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' ||\n navigator.product === 'NativeScript' ||\n navigator.product === 'NS')) {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Function equal to merge with the difference being that no reference\n * to original objects is kept.\n *\n * @see merge\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction deepMerge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = deepMerge(result[key], val);\n } else if (typeof val === 'object') {\n result[key] = deepMerge({}, val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n deepMerge: deepMerge,\n extend: extend,\n trim: trim\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/utils.js\n// module id = 2\n// module chunks = 0", - "'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/bind.js\n// module id = 3\n// module chunks = 0", - "/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/is-buffer/index.js\n// module id = 4\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./../utils');\nvar buildURL = require('../helpers/buildURL');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\nvar mergeConfig = require('./mergeConfig');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = arguments[1] || {};\n config.url = arguments[0];\n } else {\n config = config || {};\n }\n\n config = mergeConfig(this.defaults, config);\n config.method = config.method ? config.method.toLowerCase() : 'get';\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\nAxios.prototype.getUri = function getUri(config) {\n config = mergeConfig(this.defaults, config);\n return buildURL(config.url, config.params, config.paramsSerializer).replace(/^\\?/, '');\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/Axios.js\n// module id = 5\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n var hashmarkIndex = url.indexOf('#');\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/buildURL.js\n// module id = 6\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/InterceptorManager.js\n// module id = 7\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/dispatchRequest.js\n// module id = 8\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/transformData.js\n// module id = 9\n// module chunks = 0", - "'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/isCancel.js\n// module id = 10\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n // Only Node.JS has a process variable that is of [[Class]] process\n if (typeof process !== 'undefined' && Object.prototype.toString.call(process) === '[object process]') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n } else if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Accept');\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/defaults.js\n// module id = 11\n// module chunks = 0", - "'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/normalizeHeaderName.js\n// module id = 12\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(createError('Request aborted', config, 'ECONNABORTED', request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/adapters/xhr.js\n// module id = 13\n// module chunks = 0", - "'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n if (!validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/settle.js\n// module id = 14\n// module chunks = 0", - "'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/createError.js\n// module id = 15\n// module chunks = 0", - "'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n\n error.request = request;\n error.response = response;\n error.isAxiosError = true;\n\n error.toJSON = function() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: this.config,\n code: this.code\n };\n };\n return error;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/enhanceError.js\n// module id = 16\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/parseHeaders.js\n// module id = 17\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isURLSameOrigin.js\n// module id = 18\n// module chunks = 0", - "'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/cookies.js\n// module id = 19\n// module chunks = 0", - "'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/isAbsoluteURL.js\n// module id = 20\n// module chunks = 0", - "'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/combineURLs.js\n// module id = 21\n// module chunks = 0", - "'use strict';\n\nvar utils = require('../utils');\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n * @returns {Object} New object resulting from merging config2 to config1\n */\nmodule.exports = function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n var config = {};\n\n utils.forEach(['url', 'method', 'params', 'data'], function valueFromConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n }\n });\n\n utils.forEach(['headers', 'auth', 'proxy'], function mergeDeepProperties(prop) {\n if (utils.isObject(config2[prop])) {\n config[prop] = utils.deepMerge(config1[prop], config2[prop]);\n } else if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (utils.isObject(config1[prop])) {\n config[prop] = utils.deepMerge(config1[prop]);\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n\n utils.forEach([\n 'baseURL', 'transformRequest', 'transformResponse', 'paramsSerializer',\n 'timeout', 'withCredentials', 'adapter', 'responseType', 'xsrfCookieName',\n 'xsrfHeaderName', 'onUploadProgress', 'onDownloadProgress', 'maxContentLength',\n 'validateStatus', 'maxRedirects', 'httpAgent', 'httpsAgent', 'cancelToken',\n 'socketPath'\n ], function defaultToConfig2(prop) {\n if (typeof config2[prop] !== 'undefined') {\n config[prop] = config2[prop];\n } else if (typeof config1[prop] !== 'undefined') {\n config[prop] = config1[prop];\n }\n });\n\n return config;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/core/mergeConfig.js\n// module id = 22\n// module chunks = 0", - "'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/Cancel.js\n// module id = 23\n// module chunks = 0", - "'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/cancel/CancelToken.js\n// module id = 24\n// module chunks = 0", - "'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./lib/helpers/spread.js\n// module id = 25\n// module chunks = 0" - ], - "sourceRoot": "" -} \ No newline at end of file diff --git a/src/main/resources/thymeleaf/static/js/libs/bpac.js b/src/main/resources/thymeleaf/static/js/libs/bpac.js deleted file mode 100644 index 8d2cbd7..0000000 --- a/src/main/resources/thymeleaf/static/js/libs/bpac.js +++ /dev/null @@ -1,1182 +0,0 @@ -var n = n || {}; -n.appendMessage = n => { - const t = new CustomEvent("bpac_send", {detail: n}); - document.dispatchEvent(t) -}; -const t = "Can't connect to b-PAC"; - -export class IObject { - constructor(n) { - this.p_ = n - } - - GetAttribute(i) { - const r = "IObject::GetAttribute", u = {method: r, p: this.p_, kind: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : f.detail.ret == !1 ? n() : n(f.detail.attribute) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - GetData(i) { - const r = "IObject::GetData", u = {method: r, p: this.p_, kind: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : f.detail.ret == !1 ? n() : n(f.detail.data) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - GetFontBold() { - const i = "IObject::GetFontBold", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.connect == !1 ? r(t) : n(f.detail.ret) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetFontEffect() { - const i = "IObject::GetFontEffect", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.effect) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetFontItalics() { - const i = "IObject::GetFontItalics", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.connect == !1 ? r(t) : n(f.detail.ret) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetFontMaxPoint() { - const i = "IObject::GetFontMaxPoint", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.point) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetFontName() { - const i = "IObject::GetFontName", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.name) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetFontStrikeout() { - const i = "IObject::GetFontStrikeout", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.connect == !1 ? r(t) : n(f.detail.ret) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetFontUnderline() { - const i = "IObject::GetFontUnderline", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.connect == !1 ? r(t) : n(f.detail.ret) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - SetAlign(i, r) { - const u = "IObject::SetAlign", f = {method: u, p: this.p_, horizontal: i, vertical: r}, - e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - SetAttribute(i, r) { - const u = "IObject::SetAttribute", f = {method: u, p: this.p_, kind: i, attribute: r}, - e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - SetData(i, r, u) { - let e; - const o = Object.prototype.toString.call(r).slice(8, -1); - e = o === "Date" ? r.getTime() / 1e3 : r; - const f = "IObject::SetData", s = {method: f, p: this.p_, kind: i, data: e, param: u}, - h = new Promise((n, i) => { - const r = u => { - document.removeEventListener(f, r), u.detail.connect == !1 ? i(t) : n(u.detail.ret) - }; - document.addEventListener(f, r) - }); - return n.appendMessage(s), h - } - - SetFontBold(i) { - const r = "IObject::SetFontBold", u = {method: r, p: this.p_, bold: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - SetFontEffect(i) { - const r = "IObject::SetFontEffect", u = {method: r, p: this.p_, effect: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - SetFontItalics(i) { - const r = "IObject::SetFontItalics", u = {method: r, p: this.p_, italics: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - SetFontMaxPoint(i) { - const r = "IObject::SetFontMaxPoint", u = {method: r, p: this.p_, point: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - SetFontName(i) { - const r = "IObject::SetFontName", u = {method: r, p: this.p_, name: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - SetFontStrikeout(i) { - const r = "IObject::SetFontStrikeout", u = {method: r, p: this.p_, strikeout: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - SetFontUnderline(i) { - const r = "IObject::SetFontUnderline", u = {method: r, p: this.p_, underline: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - SetPosition(i, r, u, f) { - const e = "IObject::SetPosition", o = {method: e, p: this.p_, x: i, y: r, width: u, height: f}, - s = new Promise((n, i) => { - const r = u => { - document.removeEventListener(e, r), u.detail.connect == !1 ? i(t) : n(u.detail.ret) - }; - document.addEventListener(e, r) - }); - return n.appendMessage(o), s - } - - SetSelection(i, r) { - const u = "IObject::SetPosition", f = {method: u, p: this.p_, start: i, end: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - get Height() { - const i = "IObject::GetHeight", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.height) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set Height(t) { - const i = {method: "IObject::SetHeight", p: this.p_, height: t}; - n.appendMessage(i) - } - - get HorizontalAlign() { - const i = "IObject::GetHorizontalAlign", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.align) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set HorizontalAlign(t) { - const i = {method: "IObject::SetHorizontalAlign", p: this.p_, align: t}; - n.appendMessage(i) - } - - get Name() { - const i = "IObject::GetName", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.name) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set Name(t) { - const i = {method: "IObject::SetName", p: this.p_, name: t}; - n.appendMessage(i) - } - - get Orientation() { - const i = "IObject::GetOrientation", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.orientation) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set Orientation(t) { - const i = {method: "IObject::SetOrientation", p: this.p_, orientation: t}; - n.appendMessage(i) - } - - get SelectionEnd() { - const i = "IObject::GetSelectionEnd", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.selection) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set SelectionEnd(t) { - const i = {method: "IObject::SetSelectionEnd", p: this.p_, selection: t}; - n.appendMessage(i) - } - - get SelectionStart() { - const i = "IObject::GetSelectionStart", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.selection) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set SelectionStart(t) { - const i = {method: "IObject::SetSelectionStart", p: this.p_, selection: t}; - n.appendMessage(i) - } - - get Text() { - const i = "IObject::GetText", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.text) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set Text(t) { - const i = {method: "IObject::SetText", p: this.p_, text: t}; - n.appendMessage(i) - } - - get Type() { - const i = "IObject::GetType", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.type) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - get VerticalAlign() { - const i = "IObject::GetVerticalAlign", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.align) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set VerticalAlign(t) { - const i = {method: "IObject::SetVerticalAlign", p: this.p_, align: t}; - n.appendMessage(i) - } - - get Width() { - const i = "IObject::GetWidth", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.width) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set Width(t) { - const i = {method: "IObject::SetWidth", p: this.p_, width: t}; - n.appendMessage(i) - } - - get X() { - const i = "IObject::GetX", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.X) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set X(t) { - const i = {method: "IObject::SetX", p: this.p_, X: t}; - n.appendMessage(i) - } - - get Y() { - const i = "IObject::GetY", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.Y) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - set Y(t) { - const i = {method: "IObject::SetY", p: this.p_, Y: t}; - n.appendMessage(i) - } -} - -export class IObjects { - constructor(n) { - this.p_ = n - } - - GetItem(i) { - const r = "IObjects::GetItem", u = {method: r, p: this.p_, index: i}, f = new Promise((n, i) => { - const u = f => { - if (document.removeEventListener(r, u), f.detail.connect == !1) i(t); else if (f.detail.ret == !1) n(); else if (f.detail.p >= 0) { - const t = new IObject(f.detail.p); - n(t) - } else i() - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - GetCount() { - const i = "IObjects::GetCount", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.count) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetIndex(i) { - const r = "IObjects::GetIndex", u = {method: r, p: this.p_, obj: i.p_}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : f.detail.ret == !1 ? n() : n(f.detail.index) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - GetIndexByName(i, r) { - const u = "IObjects::GetIndexByName", f = {method: u, p: this.p_, name: i, indexBgn: r}, - e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : f.detail.ret == !1 ? n() : n(f.detail.index) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - Insert(i, r, u, f, e, o, s) { - const h = "IObjects::Insert", - c = {method: h, p: this.p_, index: i, type: r, X: u, Y: f, width: e, height: o, option: s}, - l = new Promise((n, i) => { - const r = u => { - if (document.removeEventListener(h, r), u.detail.connect == !1) i(t); else if (u.detail.ret == !1) n(); else if (u.detail.p >= 0) { - const t = new IObject(u.detail.p); - n(t) - } else i() - }; - document.addEventListener(h, r) - }); - return n.appendMessage(c), l - } - - Remove(i) { - const r = "IObjects::Remove", u = {method: r, p: this.p_, index: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - get Count() { - return this.GetCount() - } -} - -export class IPrinter { - constructor(n) { - this.p_ = n - } - - GetInstalledPrinters() { - const i = "IPrinter::GetInstalledPrinters", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.printers) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetMediaId() { - const i = "IPrinter::GetMediaId", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.id) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetMediaName() { - const i = "IPrinter::GetMediaName", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.name) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetPrintedTapeLength() { - const i = "IPrinter::GetPrintedTapeLength", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.length) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetSupportedMediaIds() { - const i = "IPrinter::GetSupportedMediaIds", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.mediaIds) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - GetSupportedMediaNames() { - const i = "IPrinter::GetSupportedMediaNames", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.mediaNames) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - IsMediaIdSupported(i) { - const r = "IPrinter::IsMediaIdSupported", u = {method: r, p: this.p_, id: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - IsMediaNameSupported(i) { - const r = "IPrinter::IsMediaNameSupported", u = {method: r, p: this.p_, name: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - IsPrinterOnline(i) { - const r = "IPrinter::IsPrinterOnline", u = {method: r, p: this.p_, name: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - IsPrinterSupported(i) { - const r = "IPrinter::IsPrinterSupported", u = {method: r, p: this.p_, name: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - get ErrorCode() { - const i = "IPrinter::GetErrorCode", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.errorCode) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - get ErrorString() { - const i = "IPrinter::GetErrorString", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.errorString) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - get Name() { - const i = "IPrinter::GetName", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.name) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - get PortName() { - const i = "IPrinter::GetPortName", r = {method: i, p: this.p_}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.port) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } -} - -export class IDocument { - static get Width() { - return IDocument.GetWidth() - } - - static get Length() { - return IDocument.GetLength() - } - - static set Length(n) { - IDocument.SetLength(n) - } - - static get CurrentSheet() { - return IDocument.GetCurrentSheet() - } - - static set CurrentSheet(n) { - IDocument.SetCurrentSheet(n) - } - - static get CutLineCount() { - return IDocument.GetCutLineCount() - } - - static get CutLines() { - return IDocument.GetCutLines() - } - - static get ErrorCode() { - return IDocument.GetErrorCode() - } - - static get MarginBottom() { - return IDocument.GetMarginBottom() - } - - static set MarginBottom(n) { - return IDocument.SetMarginBottom(n) - } - - static get MarginLeft() { - return IDocument.GetMarginLeft() - } - - static set MarginLeft(n) { - return IDocument.SetMarginLeft(n) - } - - static get MarginRight() { - return IDocument.GetMarginRight() - } - - static set MarginRight(n) { - return IDocument.SetMarginRight(n) - } - - static get MarginTop() { - return IDocument.GetMarginTop() - } - - static set MarginTop(n) { - return IDocument.SetMarginTop(n) - } - - static get Objects() { - return IDocument.GetObjects() - } - - static get Orientation() { - return IDocument.GetOrientation() - } - - static get Printer() { - return IDocument.GetPrinter() - } - - static get SheetNames() { - return IDocument.GetSheetNames() - } - - static Open(i) { - const r = "IDocument::Open", u = {method: r, filePath: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static DoPrint(i, r) { - const u = "IDocument::DoPrint", f = {method: u, dwOption: i, szOption: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static StartPrint(i, r) { - const u = "IDocument::StartPrint", f = {method: u, docName: i, option: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static PrintOut(i, r) { - const u = "IDocument::PrintOut", f = {method: u, copyCount: i, option: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static EndPrint() { - const i = "IDocument::EndPrint", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.connect == !1 ? r(t) : n(f.detail.ret) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetImageData(i, r, u) { - const f = "IDocument::GetImageData", e = {method: f, type: i, width: r, height: u}, o = new Promise((n, i) => { - const r = u => { - document.removeEventListener(f, r), u.detail.ret == !0 && u.detail.connect == !0 ? n(u.detail.image) : i(t) - }; - document.addEventListener(f, r) - }); - return n.appendMessage(e), o - } - - static GetObjectsCount() { - const i = "IDocument::GetObjectsCount", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !0 && f.detail.connect == !0 ? n(f.detail.count) : r(t) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetIndexByName(i, r) { - const u = "IDocument::GetIndexByName", f = {method: u, name: i, indexBgn: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : f.detail.ret == !0 ? n(f.detail.index) : n() - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static GetObject(i) { - const r = "IDocument::GetObject", u = {method: r, name: i}, f = new Promise((n, i) => { - const u = f => { - if (document.removeEventListener(r, u), f.detail.connect == !1) i(t); else if (f.detail.ret == !1) n(); else if (f.detail.p >= 0) { - const t = new IObject(f.detail.p); - n(t) - } else i() - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetObjects(i) { - const r = "IDocument::GetObjects", u = {method: r, name: i}, f = new Promise((n, i) => { - const u = f => { - if (document.removeEventListener(r, u), f.detail.ret == !1 || f.detail.connect == !1) i(t); else if (f.detail.p >= 0) { - const t = new IObjects(f.detail.p); - n(t) - } else i() - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetBarcodeIndex(i) { - const r = "IDocument::GetBarcodeIndex", u = {method: r, name: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : f.detail.ret == !1 ? n() : n(f.detail.index) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetMediaId() { - const i = "IDocument::GetMediaId", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.id) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetMediaName() { - const i = "IDocument::GetMediaName", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.name) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetPrinterName() { - const i = "IDocument::GetPrinterName", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.name) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetText(i) { - const r = "IDocument::GetText", u = {method: r, index: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.ret == !1 || f.detail.connect == !1 ? i(t) : n(f.detail.text) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetTextCount() { - const i = "IDocument::GetTextCount", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.count) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetTextIndex(i) { - const r = "IDocument::GetTextIndex", u = {method: r, name: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : f.detail.ret == !1 ? n() : n(f.detail.index) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetPrinter() { - const i = "IDocument::GetPrinter", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - if (document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1) r(t); else if (f.detail.p >= 0) { - const t = new IPrinter(f.detail.p); - n(t) - } else r() - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static SetText(i, r) { - const u = "IDocument::SetText", f = {method: u, index: i, text: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static SetBarcodeData(i, r) { - const u = "IDocument::SetBarcodeData", f = {method: u, index: i, text: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static SetMarginLeftRight(i, r) { - const u = "IDocument::SetMarginLeftRight", f = {method: u, left: i, right: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static SetMediaById(i, r) { - const u = "IDocument::SetMediaById", f = {method: u, id: i, fit: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static SetMediaByName(i, r) { - const u = "IDocument::SetMediaByName", f = {method: u, name: i, fit: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static SetPrinter(i, r) { - const u = "IDocument::SetPrinter", f = {method: u, name: i, fit: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static GetCurrentSheet() { - const i = "IDocument::GetCurrentSheet", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.name) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static SetCurrentSheet(i) { - const r = "IDocument::SetCurrentSheet", u = {method: r, name: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetCutLineCount() { - const i = "IDocument::GetCutLineCount", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.count) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetCutLines() { - const i = "IDocument::GetCutLines", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.connect == !1 ? r(t) : f.detail.ret == !1 ? n() : n(f.detail.cutlines) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetErrorCode() { - const i = "IDocument::GetErrorCode", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.errorCode) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetMarginBottom() { - const i = "IDocument::GetMarginBottom", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.margin) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static SetMarginBottom(i) { - const r = "IDocument::SetMarginBottom", u = {method: r, margin: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetMarginLeft() { - const i = "IDocument::GetMarginLeft", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.margin) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static SetMarginLeft(i) { - const r = "IDocument::SetMarginLeft", u = {method: r, margin: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetMarginRight() { - const i = "IDocument::GetMarginRight", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.margin) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static SetMarginRight(i) { - const r = "IDocument::SetMarginRight", u = {method: r, margin: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetMarginTop() { - const i = "IDocument::GetMarginTop", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.margin) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static SetMarginTop(i) { - const r = "IDocument::SetMarginTop", u = {method: r, margin: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 || f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static GetOrientation() { - const i = "IDocument::GetOrientation", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.orientation) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetSheetNames() { - const i = "IDocument::GetSheetNames", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.names) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetWidth() { - const i = "IDocument::GetWidth", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.width) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static GetLength() { - const i = "IDocument::GetLength", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.ret == !1 || f.detail.connect == !1 ? r(t) : n(f.detail.length) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static SetLength(i) { - const r = "IDocument::SetLength", u = {method: r, length: i}, f = new Promise((n, i) => { - const u = f => { - document.removeEventListener(r, u), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(r, u) - }); - return n.appendMessage(u), f - } - - static Save() { - const i = "IDocument::Save", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.connect == !1 ? r(t) : n(f.detail.ret) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } - - static SaveAs(i, r) { - const u = "IDocument::SaveAs", f = {method: u, type: i, filePath: r}, e = new Promise((n, i) => { - const r = f => { - document.removeEventListener(u, r), f.detail.connect == !1 ? i(t) : n(f.detail.ret) - }; - document.addEventListener(u, r) - }); - return n.appendMessage(f), e - } - - static Export(i, r, u) { - const f = "IDocument::Export", e = {method: f, type: i, filePath: r, dpi: u}, o = new Promise((n, i) => { - const r = u => { - document.removeEventListener(f, r), u.detail.connect == !1 ? i(t) : n(u.detail.ret) - }; - document.addEventListener(f, r) - }); - return n.appendMessage(e), o - } - - static Close() { - const i = "IDocument::Close", r = {method: i}, u = new Promise((n, r) => { - const u = f => { - document.removeEventListener(i, u), f.detail.connect == !1 ? r(t) : n(f.detail.ret) - }; - document.addEventListener(i, u) - }); - return n.appendMessage(r), u - } -} - -export const IsExtensionInstalled = () => document.body.classList.contains("bpac-extension-installed") ? !0 : !1 diff --git a/src/main/resources/thymeleaf/static/js/libs/jquery-3.4.1.min.js b/src/main/resources/thymeleaf/static/js/libs/jquery-3.4.1.min.js deleted file mode 100644 index a1c07fd..0000000 --- a/src/main/resources/thymeleaf/static/js/libs/jquery-3.4.1.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.4.1 | (c) JS Foundation and other contributors | jquery.org/license */ -!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e}var f="3.4.1",k=function(e,t){return new k.fn.init(e,t)},p=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function d(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp($),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+$),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ne=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"\ufffd":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&((e?e.ownerDocument||e:m)!==C&&T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&U.test(t)){(s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=k),o=(l=h(t)).length;while(o--)l[o]="#"+s+" "+xe(l[o]);c=l.join(","),f=ee.test(t)&&ye(e.parentNode)||e}try{return H.apply(n,f.querySelectorAll(c)),n}catch(e){A(t,!0)}finally{s===k&&e.removeAttribute("id")}}}return g(t.replace(B,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[k]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e.namespaceURI,n=(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=k,!C.getElementsByName||!C.getElementsByName(k).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+k+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+k+"+*").length||v.push(".#.+[+~]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",$)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test(a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},D=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},se.matches=function(e,t){return se(e,null,null,t)},se.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),d.matchesSelector&&E&&!A[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){A(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?k.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?k.grep(e,function(e){return e===n!==r}):"string"!=typeof n?k.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(k.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:L.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof k?t[0]:t,k.merge(this,k.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),D.test(r[1])&&k.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(k):k.makeArray(e,this)}).prototype=k.fn,q=k(E);var H=/^(?:parents|prev(?:Until|All))/,O={children:!0,contents:!0,next:!0,prev:!0};function P(e,t){while((e=e[t])&&1!==e.nodeType);return e}k.fn.extend({has:function(e){var t=k(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i,ge={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n;return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?k.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!me.cloneNode(!0).lastChild.defaultValue;var Te=/^key/,Ce=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Ee=/^([^.]*)(?:\.(.+)|)/;function ke(){return!0}function Se(){return!1}function Ne(e,t){return e===function(){try{return E.activeElement}catch(e){}}()==("focus"===t)}function Ae(e,t,n,r,i,o){var a,s;if("object"==typeof t){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Ae(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Se;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return k().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=k.guid++)),e.each(function(){k.event.add(this,t,i,r,n)})}function De(e,i,o){o?(Q.set(e,i,!1),k.event.add(e,i,{namespace:!1,handler:function(e){var t,n,r=Q.get(this,i);if(1&e.isTrigger&&this[i]){if(r.length)(k.event.special[i]||{}).delegateType&&e.stopPropagation();else if(r=s.call(arguments),Q.set(this,i,r),t=o(this,i),this[i](),r!==(n=Q.get(this,i))||t?Q.set(this,i,!1):n={},r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n.value}else r.length&&(Q.set(this,i,{value:k.event.trigger(k.extend(r[0],k.Event.prototype),r.slice(1),this)}),e.stopImmediatePropagation())}})):void 0===Q.get(e,i)&&k.event.add(e,i,ke)}k.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.get(t);if(v){n.handler&&(n=(o=n).handler,i=o.selector),i&&k.find.matchesSelector(ie,i),n.guid||(n.guid=k.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return"undefined"!=typeof k&&k.event.triggered!==e.type?k.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;while(l--)d=g=(s=Ee.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=k.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=k.event.special[d]||{},c=k.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&k.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),k.event.global[d]=!0)}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Q.hasData(e)&&Q.get(e);if(v&&(u=v.events)){l=(t=(t||"").match(R)||[""]).length;while(l--)if(d=g=(s=Ee.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){f=k.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;while(o--)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||k.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)k.event.remove(e,d+t[l],n,r,!0);k.isEmptyObject(u)&&Q.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=k.event.fix(e),u=new Array(arguments.length),l=(Q.get(this,"events")||{})[s.type]||[],c=k.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,qe=/\s*$/g;function Oe(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&k(e).children("tbody")[0]||e}function Pe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Me(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Q.hasData(e)&&(o=Q.access(e),a=Q.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=oe(e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||k.isXMLDoc(e)))for(a=ve(c),r=0,i=(o=ve(e)).length;r").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Vt,Gt=[],Yt=/(=)\?(?=&|$)|\?\?/;k.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Gt.pop()||k.expando+"_"+kt++;return this[e]=!0,e}}),k.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Yt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Yt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Yt,"$1"+r):!1!==e.jsonp&&(e.url+=(St.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||k.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?k(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Gt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Vt=E.implementation.createHTMLDocument("").body).innerHTML="

",2===Vt.childNodes.length),k.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=D.exec(e))?[t.createElement(i[1])]:(i=we([e],t,o),o&&o.length&&k(o).remove(),k.merge([],i.childNodes)));var r,i,o},k.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(k.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},k.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){k.fn[t]=function(e){return this.on(t,e)}}),k.expr.pseudos.animated=function(t){return k.grep(k.timers,function(e){return t===e.elem}).length},k.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=k.css(e,"position"),c=k(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=k.css(e,"top"),u=k.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,k.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},k.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){k.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===k.css(r,"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===k.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=k(e).offset()).top+=k.css(e,"borderTopWidth",!0),i.left+=k.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-k.css(r,"marginTop",!0),left:t.left-i.left-k.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===k.css(e,"position"))e=e.offsetParent;return e||ie})}}),k.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;k.fn[t]=function(e){return _(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),k.each(["top","left"],function(e,n){k.cssHooks[n]=ze(y.pixelPosition,function(e,t){if(t)return t=_e(e,n),$e.test(t)?k(e).position()[n]+"px":t})}),k.each({Height:"height",Width:"width"},function(a,s){k.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){k.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return _(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?k.css(e,t,i):k.style(e,t,n,i)},s,n?e:void 0,n)}})}),k.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){k.fn[n]=function(e,t){return 0 -Richard Worth -Yehuda Katz -Sean Catchpole -John Resig -Tane Piper -Dmitri Gaskin -Klaus Hartl -Stefan Petre -Gilles van den Hoven -Micheil Bryan Smith -Jörn Zaefferer -Marc Grabanski -Keith Wood -Brandon Aaron -Scott González -Eduardo Lundgren -Aaron Eisenberger -Joan Piedra -Bruno Basto -Remy Sharp -Bohdan Ganicky -David Bolter -Chi Cheng -Ca-Phun Ung -Ariel Flesler -Maggie Wachs -Scott Jehl -Todd Parker -Andrew Powell -Brant Burnett -Douglas Neiner -Paul Irish -Ralph Whitbeck -Thibault Duplessis -Dominique Vincent -Jack Hsu -Adam Sontag -Carl Fürstenberg -Kevin Dalman -Alberto Fernández Capel -Jacek Jędrzejewski (http://jacek.jedrzejewski.name) -Ting Kuei -Samuel Cormier-Iijima -Jon Palmer -Ben Hollis -Justin MacCarthy -Eyal Kobrigo -Tiago Freire -Diego Tres -Holger Rüprich -Ziling Zhao -Mike Alsup -Robson Braga Araujo -Pierre-Henri Ausseil -Christopher McCulloh -Andrew Newcomb -Lim Chee Aun -Jorge Barreiro -Daniel Steigerwald -John Firebaugh -John Enters -Andrey Kapitcyn -Dmitry Petrov -Eric Hynds -Chairat Sunthornwiphat -Josh Varner -Stéphane Raimbault -Jay Merrifield -J. Ryan Stinnett -Peter Heiberg -Alex Dovenmuehle -Jamie Gegerson -Raymond Schwartz -Phillip Barnes -Kyle Wilkinson -Khaled AlHourani -Marian Rudzynski -Jean-Francois Remy -Doug Blood -Filippo Cavallarin -Heiko Henning -Aliaksandr Rahalevich -Mario Visic -Xavi Ramirez -Max Schnur -Saji Nediyanchath -Corey Frang -Aaron Peterson -Ivan Peters -Mohamed Cherif Bouchelaghem -Marcos Sousa -Michael DellaNoce -George Marshall -Tobias Brunner -Martin Solli -David Petersen -Dan Heberden -William Kevin Manire -Gilmore Davidson -Michael Wu -Adam Parod -Guillaume Gautreau -Marcel Toele -Dan Streetman -Matt Hoskins -Giovanni Giacobbi -Kyle Florence -Pavol Hluchý -Hans Hillen -Mark Johnson -Trey Hunner -Shane Whittet -Edward A Faulkner -Adam Baratz -Kato Kazuyoshi -Eike Send -Kris Borchers -Eddie Monge -Israel Tsadok -Carson McDonald -Jason Davies -Garrison Locke -David Murdoch -Benjamin Scott Boyle -Jesse Baird -Jonathan Vingiano -Dylan Just -Hiroshi Tomita -Glenn Goodrich -Tarafder Ashek-E-Elahi -Ryan Neufeld -Marc Neuwirth -Philip Graham -Benjamin Sterling -Wesley Walser -Kouhei Sutou -Karl Kirch -Chris Kelly -Jason Oster -Felix Nagel -Alexander Polomoshnov -David Leal -Igor Milla -Dave Methvin -Florian Gutmann -Marwan Al Jubeh -Milan Broum -Sebastian Sauer -Gaëtan Muller -Michel Weimerskirch -William Griffiths -Stojce Slavkovski -David Soms -David De Sloovere -Michael P. Jung -Shannon Pekary -Dan Wellman -Matthew Edward Hutton -James Khoury -Rob Loach -Alberto Monteiro -Alex Rhea -Krzysztof Rosiński -Ryan Olton -Genie <386@mail.com> -Rick Waldron -Ian Simpson -Lev Kitsis -TJ VanToll -Justin Domnitz -Douglas Cerna -Bert ter Heide -Jasvir Nagra -Yuriy Khabarov <13real008@gmail.com> -Harri Kilpiö -Lado Lomidze -Amir E. Aharoni -Simon Sattes -Jo Liss -Guntupalli Karunakar -Shahyar Ghobadpour -Lukasz Lipinski -Timo Tijhof -Jason Moon -Martin Frost -Eneko Illarramendi -EungJun Yi -Courtland Allen -Viktar Varvanovich -Danny Trunk -Pavel Stetina -Michael Stay -Steven Roussey -Michael Hollis -Lee Rowlands -Timmy Willison -Karl Swedberg -Baoju Yuan -Maciej Mroziński -Luis Dalmolin -Mark Aaron Shirley -Martin Hoch -Jiayi Yang -Philipp Benjamin Köppchen -Sindre Sorhus -Bernhard Sirlinger -Jared A. Scheel -Rafael Xavier de Souza -John Chen -Robert Beuligmann -Dale Kocian -Mike Sherov -Andrew Couch -Marc-Andre Lafortune -Nate Eagle -David Souther -Mathias Stenbom -Sergey Kartashov -Avinash R -Ethan Romba -Cory Gackenheimer -Juan Pablo Kaniefsky -Roman Salnikov -Anika Henke -Samuel Bovée -Fabrício Matté -Viktor Kojouharov -Pawel Maruszczyk (http://hrabstwo.net) -Pavel Selitskas -Bjørn Johansen -Matthieu Penant -Dominic Barnes -David Sullivan -Thomas Jaggi -Vahid Sohrabloo -Travis Carden -Bruno M. Custódio -Nathanael Silverman -Christian Wenz -Steve Urmston -Zaven Muradyan -Woody Gilk -Zbigniew Motyka -Suhail Alkowaileet -Toshi MARUYAMA -David Hansen -Brian Grinstead -Christian Klammer -Steven Luscher -Gan Eng Chin -Gabriel Schulhof -Alexander Schmitz -Vilhjálmur Skúlason -Siebrand Mazeland -Mohsen Ekhtiari -Pere Orga -Jasper de Groot -Stephane Deschamps -Jyoti Deka -Andrei Picus -Ondrej Novy -Jacob McCutcheon -Monika Piotrowicz -Imants Horsts -Eric Dahl -Dave Stein -Dylan Barrell -Daniel DeGroff -Michael Wiencek -Thomas Meyer -Ruslan Yakhyaev -Brian J. Dowling -Ben Higgins -Yermo Lamers -Patrick Stapleton -Trisha Crowley -Usman Akeju -Rodrigo Menezes -Jacques Perrault -Frederik Elvhage -Will Holley -Uri Gilad -Richard Gibson -Simen Bekkhus -Chen Eshchar -Bruno Pérel -Mohammed Alshehri -Lisa Seacat DeLuca -Anne-Gaelle Colom -Adam Foster -Luke Page -Daniel Owens -Michael Orchard -Marcus Warren -Nils Heuermann -Marco Ziech -Patricia Juarez -Ben Mosher -Ablay Keldibek -Thomas Applencourt -Jiabao Wu -Eric Lee Carraway -Victor Homyakov -Myeongjin Lee -Liran Sharir -Weston Ruter -Mani Mishra -Hannah Methvin -Leonardo Balter -Benjamin Albert -Michał Gołębiowski -Alyosha Pushak -Fahad Ahmad -Matt Brundage -Francesc Baeta -Piotr Baran -Mukul Hase -Konstantin Dinev -Rand Scullard -Dan Strohl -Maksim Ryzhikov -Amine HADDAD -Amanpreet Singh -Alexey Balchunas -Peter Kehl -Peter Dave Hello -Johannes Schäfer -Ville Skyttä -Ryan Oriecuia diff --git a/src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/LICENSE.txt b/src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/LICENSE.txt deleted file mode 100644 index 4819e54..0000000 --- a/src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/LICENSE.txt +++ /dev/null @@ -1,43 +0,0 @@ -Copyright jQuery Foundation and other contributors, https://jquery.org/ - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/jquery/jquery-ui - -The following license applies to all parts of this software except as -documented below: - -==== - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code contained within the demos directory. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -All files located in the node_modules and external directories are -externally maintained libraries used by this software which have their -own licenses; we recommend you read them, as their terms may differ from -the terms above. diff --git a/src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/external/jquery/jquery.js b/src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/external/jquery/jquery.js deleted file mode 100644 index 7fc60fc..0000000 --- a/src/main/resources/thymeleaf/static/js/libs/jquery-ui-1.12.1/external/jquery/jquery.js +++ /dev/null @@ -1,11008 +0,0 @@ -/*! - * jQuery JavaScript Library v1.12.4 - * http://jquery.com/ - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2016-05-20T17:17Z - */ - -(function( global, factory ) { - - if ( typeof module === "object" && typeof module.exports === "object" ) { - // For CommonJS and CommonJS-like environments where a proper `window` - // is present, execute the factory and get jQuery. - // For environments that do not have a `window` with a `document` - // (such as Node.js), expose a factory as module.exports. - // This accentuates the need for the creation of a real `window`. - // e.g. var jQuery = require("jquery")(window); - // See ticket #14549 for more info. - module.exports = global.document ? - factory( global, true ) : - function( w ) { - if ( !w.document ) { - throw new Error( "jQuery requires a window with a document" ); - } - return factory( w ); - }; - } else { - factory( global ); - } - -// Pass this if window is not defined yet -}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { - -// Support: Firefox 18+ -// Can't be in strict mode, several libs including ASP.NET trace -// the stack via arguments.caller.callee and Firefox dies if -// you try to trace through "use strict" call chains. (#13335) -//"use strict"; -var deletedIds = []; - -var document = window.document; - -var slice = deletedIds.slice; - -var concat = deletedIds.concat; - -var push = deletedIds.push; - -var indexOf = deletedIds.indexOf; - -var class2type = {}; - -var toString = class2type.toString; - -var hasOwn = class2type.hasOwnProperty; - -var support = {}; - - - -var - version = "1.12.4", - - // 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, IE<9 - // 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, - - toArray: function() { - return slice.call( this ); - }, - - // 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 - slice.call( this ); - }, - - // Take an array of elements and push it onto the stack - // (returning the new matched element set) - pushStack: function( elems ) { - - // Build a new jQuery matched element set - var ret = jQuery.merge( this.constructor(), elems ); - - // 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. - each: function( callback ) { - return jQuery.each( this, callback ); - }, - - map: function( callback ) { - return this.pushStack( jQuery.map( this, function( elem, i ) { - return callback.call( elem, i, elem ); - } ) ); - }, - - slice: function() { - return this.pushStack( slice.apply( this, arguments ) ); - }, - - first: function() { - return this.eq( 0 ); - }, - - last: function() { - return this.eq( -1 ); - }, - - eq: function( i ) { - var len = this.length, - j = +i + ( i < 0 ? len : 0 ); - return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); - }, - - end: function() { - return this.prevObject || this.constructor(); - }, - - // For internal use only. - // Behaves like an Array's method, not like a jQuery method. - push: push, - sort: deletedIds.sort, - splice: deletedIds.splice -}; - -jQuery.extend = jQuery.fn.extend = function() { - var src, copyIsArray, copy, name, options, clone, - target = arguments[ 0 ] || {}, - i = 1, - length = arguments.length, - deep = false; - - // Handle a deep copy situation - if ( typeof target === "boolean" ) { - deep = target; - - // skip the boolean and the target - target = arguments[ i ] || {}; - i++; - } - - // Handle case when target is a string or something (possible in deep copy) - if ( typeof target !== "object" && !jQuery.isFunction( target ) ) { - target = {}; - } - - // extend jQuery itself if only one argument is passed - if ( i === length ) { - target = this; - i--; - } - - for ( ; i < length; i++ ) { - - // Only deal with non-null/undefined values - if ( ( options = arguments[ i ] ) != null ) { - - // Extend the base object - for ( name in options ) { - src = target[ name ]; - copy = options[ name ]; - - // Prevent never-ending loop - if ( 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 : []; - - } else { - clone = src && jQuery.isPlainObject( src ) ? src : {}; - } - - // Never move original objects, clone them - target[ name ] = jQuery.extend( deep, clone, copy ); - - // Don't bring in undefined values - } else if ( copy !== undefined ) { - target[ name ] = copy; - } - } - } - } - - // Return the modified object - return target; -}; - -jQuery.extend( { - - // Unique for each copy of jQuery on the page - expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), - - // Assume jQuery is ready without the ready module - isReady: true, - - error: function( msg ) { - throw new Error( msg ); - }, - - noop: function() {}, - - // See test/unit/core.js for details concerning isFunction. - // Since version 1.3, DOM methods and functions like alert - // aren't supported. They return false on IE (#2968). - isFunction: function( obj ) { - return jQuery.type( obj ) === "function"; - }, - - isArray: Array.isArray || function( obj ) { - return jQuery.type( obj ) === "array"; - }, - - isWindow: function( obj ) { - /* jshint eqeqeq: false */ - 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) - var realStringObj = obj && obj.toString(); - return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0; - }, - - isEmptyObject: function( obj ) { - var name; - for ( name in obj ) { - return false; - } - return true; - }, - - isPlainObject: function( obj ) { - var key; - - // Must be an Object. - // Because of IE, we also have to check the presence of the constructor property. - // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { - return false; - } - - try { - - // Not own constructor property must be Object - if ( obj.constructor && - !hasOwn.call( obj, "constructor" ) && - !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { - return false; - } - } catch ( e ) { - - // IE8,9 Will throw exceptions on certain host objects #9897 - return false; - } - - // Support: IE<9 - // Handle iteration over inherited properties before own properties. - if ( !support.ownFirst ) { - for ( key in obj ) { - return hasOwn.call( obj, key ); - } - } - - // Own properties are enumerated firstly, so to speed up, - // if last one is own, then all properties are own. - for ( key in obj ) {} - - return key === undefined || hasOwn.call( obj, key ); - }, - - type: function( obj ) { - if ( obj == null ) { - return obj + ""; - } - return typeof obj === "object" || typeof obj === "function" ? - class2type[ toString.call( obj ) ] || "object" : - typeof obj; - }, - - // Workarounds based on findings by Jim Driscoll - // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context - globalEval: function( data ) { - if ( data && jQuery.trim( data ) ) { - - // We use execScript on Internet Explorer - // We use an anonymous function so that context is window - // rather than jQuery in Firefox - ( window.execScript || function( data ) { - window[ "eval" ].call( window, data ); // jscs:ignore requireDotNotation - } )( data ); - } - }, - - // Convert dashed to camelCase; used by the css and data modules - // 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(); - }, - - each: function( obj, callback ) { - var length, i = 0; - - if ( isArrayLike( obj ) ) { - length = obj.length; - for ( ; i < length; i++ ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } else { - for ( i in obj ) { - if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { - break; - } - } - } - - return obj; - }, - - // Support: Android<4.1, IE<9 - trim: function( text ) { - return text == null ? - "" : - ( text + "" ).replace( rtrim, "" ); - }, - - // results is for internal usage only - makeArray: function( arr, results ) { - var ret = results || []; - - if ( arr != null ) { - if ( isArrayLike( Object( arr ) ) ) { - jQuery.merge( ret, - typeof arr === "string" ? - [ arr ] : arr - ); - } else { - push.call( ret, arr ); - } - } - - return ret; - }, - - inArray: function( elem, arr, i ) { - var len; - - if ( arr ) { - if ( indexOf ) { - return indexOf.call( arr, elem, i ); - } - - len = arr.length; - i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; - - for ( ; i < len; i++ ) { - - // Skip accessing in sparse arrays - if ( i in arr && arr[ i ] === elem ) { - return i; - } - } - } - - return -1; - }, - - merge: function( first, second ) { - var len = +second.length, - j = 0, - i = first.length; - - while ( j < len ) { - first[ i++ ] = second[ j++ ]; - } - - // Support: IE<9 - // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) - if ( len !== len ) { - while ( second[ j ] !== undefined ) { - first[ i++ ] = second[ j++ ]; - } - } - - first.length = i; - - return first; - }, - - grep: function( elems, callback, invert ) { - var callbackInverse, - matches = [], - i = 0, - length = elems.length, - callbackExpect = !invert; - - // Go through the array, only saving the items - // that pass the validator function - for ( ; i < length; i++ ) { - callbackInverse = !callback( elems[ i ], i ); - if ( callbackInverse !== callbackExpect ) { - matches.push( elems[ i ] ); - } - } - - return matches; - }, - - // arg is for internal usage only - map: function( elems, callback, arg ) { - var length, value, - i = 0, - ret = []; - - // Go through the array, translating each of the items to their new values - if ( isArrayLike( elems ) ) { - length = elems.length; - for ( ; i < length; i++ ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - - // Go through every key on the object, - } else { - for ( i in elems ) { - value = callback( elems[ i ], i, arg ); - - if ( value != null ) { - ret.push( value ); - } - } - } - - // Flatten any nested arrays - return concat.apply( [], 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 args, proxy, tmp; - - 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: function() { - return +( new Date() ); - }, - - // jQuery.support is not used in Core but other projects attach their - // properties to it so it needs to exist. - support: support -} ); - -// JSHint would error on this code due to the Symbol not being defined in ES5. -// Defining this global in .jshintrc would create a danger of using the global -// unguarded in another place, it seems safer to just disable JSHint for these -// three lines. -/* jshint ignore: start */ -if ( typeof Symbol === "function" ) { - jQuery.fn[ Symbol.iterator ] = deletedIds[ Symbol.iterator ]; -} -/* jshint ignore: end */ - -// 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 isArrayLike( obj ) { - - // Support: iOS 8.2 (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 = !!obj && "length" in obj && obj.length, - type = jQuery.type( obj ); - - if ( type === "function" || jQuery.isWindow( obj ) ) { - return false; - } - - return type === "array" || length === 0 || - typeof length === "number" && length > 0 && ( length - 1 ) in obj; -} -var Sizzle = -/*! - * Sizzle CSS Selector Engine v2.2.1 - * http://sizzlejs.com/ - * - * Copyright jQuery Foundation and other contributors - * Released under the MIT license - * http://jquery.org/license - * - * Date: 2015-10-17 - */ -(function( window ) { - -var i, - support, - Expr, - getText, - isXML, - tokenize, - compile, - select, - outermostContext, - sortInput, - hasDuplicate, - - // Local document vars - setDocument, - document, - docElem, - documentIsHTML, - rbuggyQSA, - rbuggyMatches, - matches, - contains, - - // Instance-specific data - expando = "sizzle" + 1 * new Date(), - preferredDoc = window.document, - dirruns = 0, - done = 0, - classCache = createCache(), - tokenCache = createCache(), - compilerCache = createCache(), - sortOrder = function( a, b ) { - if ( a === b ) { - hasDuplicate = true; - } - 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", - - // Regular expressions - - // http://www.w3.org/TR/css3-selectors/#whitespace - whitespace = "[\\x20\\t\\r\\n\\f]", - - // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier - identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", - - // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors - attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + - // Operator (capture 2) - "*([*^$|!~]?=)" + whitespace + - // "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" ), - - rpseudo = new RegExp( pseudos ), - ridentifier = new RegExp( "^" + identifier + "$" ), - - matchExpr = { - "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" ) - }, - - 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 ); - }, - - // Used for iframes - // See setDocument() - // Removing the function wrapper causes a "Permission Denied" - // error in IE - unloadHandler = function() { - setDocument(); - }; - -// Optimize for push.apply( _, NodeList ) -try { - push.apply( - (arr = slice.call( preferredDoc.childNodes )), - preferredDoc.childNodes - ); - // Support: Android<4.0 - // Detect silently failing push.apply - 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; - } - }; -} - -function Sizzle( selector, context, results, seed ) { - var m, i, elem, nid, nidselect, match, groups, newSelector, - newContext = context && context.ownerDocument, - - // nodeType defaults to 9, since context defaults to document - nodeType = context ? context.nodeType : 9; - - results = results || []; - - // Return early from calls with invalid selector or context - if ( typeof selector !== "string" || !selector || - nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { - - return results; - } - - // Try to shortcut find operations (as opposed to filters) in HTML documents - if ( !seed ) { - - if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { - setDocument( context ); - } - context = context || document; - - 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, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( elem.id === m ) { - results.push( elem ); - return results; - } - } else { - return results; - } - - // Element context - } else { - - // Support: IE, Opera, Webkit - // TODO: identify versions - // getElementById can match elements by name instead of ID - if ( newContext && (elem = newContext.getElementById( m )) && - contains( context, elem ) && - elem.id === m ) { - - results.push( elem ); - return results; - } - } - - // Type selector - } else if ( match[2] ) { - push.apply( results, context.getElementsByTagName( selector ) ); - return results; - - // Class selector - } else if ( (m = match[3]) && support.getElementsByClassName && - context.getElementsByClassName ) { - - push.apply( results, context.getElementsByClassName( m ) ); - return results; - } - } - - // Take advantage of querySelectorAll - if ( support.qsa && - !compilerCache[ selector + " " ] && - (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { - - if ( nodeType !== 1 ) { - newContext = context; - newSelector = selector; - - // qSA looks outside Element context, which is not what we want - // Thanks to Andrew Dupont for this workaround technique - // Support: IE <=8 - // Exclude object elements - } else if ( context.nodeName.toLowerCase() !== "object" ) { - - // Capture the context ID, setting it first if necessary - if ( (nid = context.getAttribute( "id" )) ) { - nid = nid.replace( rescape, "\\$&" ); - } else { - context.setAttribute( "id", (nid = expando) ); - } - - // Prefix every selector in the list - groups = tokenize( selector ); - i = groups.length; - nidselect = ridentifier.test( nid ) ? "#" + nid : "[id='" + nid + "']"; - while ( i-- ) { - groups[i] = nidselect + " " + toSelector( groups[i] ); - } - newSelector = groups.join( "," ); - - // Expand context for sibling selectors - newContext = rsibling.test( selector ) && testContext( context.parentNode ) || - context; - } - - if ( newSelector ) { - try { - push.apply( results, - newContext.querySelectorAll( newSelector ) - ); - return results; - } catch ( qsaError ) { - } finally { - if ( nid === expando ) { - context.removeAttribute( "id" ); - } - } - } - } - } - } - - // All others - return select( selector.replace( rtrim, "$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 - * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) - * deleting the oldest entry - */ -function createCache() { - var keys = []; - - function cache( key, value ) { - // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) - if ( keys.push( key + " " ) > Expr.cacheLength ) { - // Only keep the most recent entries - delete cache[ keys.shift() ]; - } - return (cache[ key + " " ] = value); - } - return cache; -} - -/** - * Mark a function for special use by Sizzle - * @param {Function} fn The function to mark - */ -function markFunction( fn ) { - fn[ expando ] = true; - return fn; -} - -/** - * Support testing using an element - * @param {Function} fn Passed the created div and expects a boolean result - */ -function assert( fn ) { - var div = document.createElement("div"); - - try { - return !!fn( div ); - } catch (e) { - return false; - } finally { - // Remove from its parent by default - if ( div.parentNode ) { - div.parentNode.removeChild( div ); - } - // release memory in IE - div = 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 = arr.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; - }; -} - -/** - * Returns a function to use in pseudos for buttons - * @param {String} type - */ -function createButtonPseudo( type ) { - return function( elem ) { - var name = elem.nodeName.toLowerCase(); - return (name === "input" || name === "button") && elem.type === type; - }; -} - -/** - * Returns a function to use in pseudos for positionals - * @param {Function} fn - */ -function createPositionalPseudo( fn ) { - return markFunction(function( argument ) { - argument = +argument; - 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]); - } - } - }); - }); -} - -/** - * Checks a node for validity as a Sizzle context - * @param {Element|Object=} context - * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value - */ -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 - * @returns {Object} Returns the current document - */ -setDocument = Sizzle.setDocument = function( node ) { - var hasCompare, parent, - doc = node ? node.ownerDocument || node : preferredDoc; - - // Return early if doc is invalid or already selected - if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { - return document; - } - - // Update global variables - document = doc; - docElem = document.documentElement; - documentIsHTML = !isXML( document ); - - // Support: IE 9-11, Edge - // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) - if ( (parent = document.defaultView) && parent.top !== parent ) { - // Support: IE 11 - if ( parent.addEventListener ) { - parent.addEventListener( "unload", unloadHandler, false ); - - // Support: IE 9 - 10 only - } else if ( parent.attachEvent ) { - parent.attachEvent( "onunload", unloadHandler ); - } - } - - /* 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( document.createComment("") ); - return !div.getElementsByTagName("*").length; - }); - - // Support: IE<9 - support.getElementsByClassName = rnative.test( document.getElementsByClassName ); - - // Support: IE<10 - // Check if getElementById returns elements by name - // The broken getElementById methods don't pick up programatically-set names, - // so use a roundabout getElementsByName test - support.getById = assert(function( div ) { - docElem.appendChild( div ).id = expando; - return !document.getElementsByName || !document.getElementsByName( expando ).length; - }); - - // ID find and filter - if ( support.getById ) { - Expr.find["ID"] = function( id, context ) { - if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { - var m = context.getElementById( id ); - return m ? [ m ] : []; - } - }; - 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 ) { - var attrId = id.replace( runescape, funescape ); - return function( elem ) { - var node = typeof elem.getAttributeNode !== "undefined" && - elem.getAttributeNode("id"); - return node && node.value === attrId; - }; - }; - } - - // Tag - Expr.find["TAG"] = support.getElementsByTagName ? - 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; - }; - - // Class - Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { - if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { - return context.getElementsByClassName( className ); - } - }; - - /* QSA/matchesSelector - ---------------------------------------------------------------------- */ - - // 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( document.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 = "" + - ""; - - // 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 + "*(?:''|\"\")" ); - } - - // Support: IE8 - // Boolean attributes and "value" are not treated correctly - if ( !div.querySelectorAll("[selected]").length ) { - rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); - } - - // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ - if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { - rbuggyQSA.push("~="); - } - - // 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: 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(".#.+[+~]"); - } - }); - - assert(function( div ) { - // Support: Windows 8 Native Apps - // The type and name attributes are restricted during .innerHTML assignment - var input = document.createElement("input"); - input.setAttribute( "type", "hidden" ); - div.appendChild( input ).setAttribute( "name", "D" ); - - // Support: IE8 - // Enforce case-sensitivity of name attribute - if ( div.querySelectorAll("[name=d]").length ) { - rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); - } - - // 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" ); - } - - // Opera 10-11 does not throw on post-comma invalid pseudos - div.querySelectorAll("*,:x"); - rbuggyQSA.push(",.*:"); - }); - } - - 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 self-exclusive - // 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; - }; - - /* Sorting - ---------------------------------------------------------------------- */ - - // Document order sorting - sortOrder = hasCompare ? - function( a, b ) { - - // Flag for duplicate removal - if ( a === b ) { - hasDuplicate = true; - return 0; - } - - // Sort on method existence if only one input has compareDocumentPosition - var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; - if ( compare ) { - return compare; - } - - // Calculate position if both inputs belong to the same document - compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? - a.compareDocumentPosition( b ) : - - // Otherwise we know they are disconnected - 1; - - // Disconnected nodes - if ( compare & 1 || - (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { - - // Choose the first element that is related to our preferred document - if ( a === document || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { - return -1; - } - if ( b === document || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { - return 1; - } - - // Maintain original order - return sortInput ? - ( indexOf( sortInput, a ) - indexOf( 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 === document ? -1 : - b === document ? 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 document; -}; - -Sizzle.matches = function( expr, elements ) { - return Sizzle( expr, null, null, elements ); -}; - -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 && - !compilerCache[ expr + " " ] && - ( !rbuggyMatches || !rbuggyMatches.test( 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) {} - } - - return Sizzle( expr, document, null, [ elem ] ).length > 0; -}; - -Sizzle.contains = function( context, elem ) { - // Set document vars if needed - if ( ( context.ownerDocument || context ) !== document ) { - setDocument( context ); - } - return contains( context, elem ); -}; - -Sizzle.attr = function( elem, name ) { - // Set document vars if needed - if ( ( elem.ownerDocument || elem ) !== document ) { - setDocument( elem ); - } - - var fn = Expr.attrHandle[ name.toLowerCase() ], - // Don't get fooled by Object.prototype properties (jQuery #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; -}; - -Sizzle.error = function( msg ) { - throw new Error( "Syntax error, unrecognized expression: " + msg ); -}; - -/** - * Document sorting and removing duplicates - * @param {ArrayLike} results - */ -Sizzle.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 ); - - if ( hasDuplicate ) { - while ( (elem = results[i++]) ) { - if ( elem === results[ i ] ) { - j = duplicates.push( i ); - } - } - while ( j-- ) { - results.splice( duplicates[ j ], 1 ); - } - } - - // Clear input after sorting to release objects - // See https://github.com/jquery/sizzle/pull/225 - sortInput = null; - - 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; -}; - -Expr = Sizzle.selectors = { - - // Can be adjusted by the user - cacheLength: 50, - - createPseudo: markFunction, - - match: matchExpr, - - attrHandle: {}, - - find: {}, - - relative: { - ">": { dir: "parentNode", first: true }, - " ": { dir: "parentNode" }, - "+": { dir: "previousSibling", first: true }, - "~": { dir: "previousSibling" } - }, - - preFilter: { - "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 ); - - if ( match[2] === "~=" ) { - match[3] = " " + match[3] + " "; - } - - return match.slice( 0, 4 ); - }, - - "CHILD": function( match ) { - /* matches from matchExpr["CHILD"] - 1 type (only|nth|...) - 2 what (child|of-type) - 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) - 4 xn-component of xn+y argument ([+-]?\d*n|) - 5 sign of xn-component - 6 x of xn-component - 7 sign of y-component - 8 y of y-component - */ - match[1] = match[1].toLowerCase(); - - if ( match[1].slice( 0, 3 ) === "nth" ) { - // nth-* requires argument - if ( !match[3] ) { - Sizzle.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" ); - - // other types prohibit arguments - } else if ( match[3] ) { - Sizzle.error( match[0] ); - } - - return match; - }, - - "PSEUDO": function( match ) { - var excess, - unquoted = !match[6] && match[2]; - - if ( matchExpr["CHILD"].test( match[0] ) ) { - return null; - } - - // Accept quoted arguments as-is - 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 )) && - // advance to the next closing parenthesis - (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 ); - } - - // Return only captures needed by the pseudo filter method (type and argument) - return match.slice( 0, 3 ); - } - }, - - filter: { - - "TAG": function( nodeNameSelector ) { - var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); - return nodeNameSelector === "*" ? - function() { return true; } : - function( elem ) { - return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; - }; - }, - - "CLASS": function( className ) { - var pattern = classCache[ className + " " ]; - - return pattern || - (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") || "" ); - }); - }, - - "ATTR": function( name, operator, check ) { - return function( elem ) { - var result = Sizzle.attr( elem, name ); - - if ( result == null ) { - return operator === "!="; - } - if ( !operator ) { - return true; - } - - 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; - }; - }, - - "CHILD": function( type, what, argument, first, last ) { - var simple = type.slice( 0, 3 ) !== "nth", - forward = type.slice( -4 ) !== "last", - ofType = what === "of-type"; - - return first === 1 && last === 0 ? - - // Shortcut for :nth-*(n) - function( elem ) { - return !!elem.parentNode; - } : - - function( elem, context, xml ) { - var cache, uniqueCache, outerCache, node, nodeIndex, start, - dir = simple !== forward ? "nextSibling" : "previousSibling", - parent = elem.parentNode, - name = ofType && elem.nodeName.toLowerCase(), - useCache = !xml && !ofType, - diff = false; - - if ( parent ) { - - // :(first|last|only)-(child|of-type) - if ( simple ) { - while ( dir ) { - node = elem; - while ( (node = node[ dir ]) ) { - if ( ofType ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) { - - return false; - } - } - // Reverse direction for :only-* (if we haven't yet done so) - start = dir = type === "only" && !start && "nextSibling"; - } - return true; - } - - start = [ forward ? parent.firstChild : parent.lastChild ]; - - // non-xml :nth-child(...) stores cache data on `parent` - if ( forward && useCache ) { - - // Seek `elem` from a previously-cached index - - // ...in a gzip-friendly way - node = parent; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex && cache[ 2 ]; - node = nodeIndex && parent.childNodes[ nodeIndex ]; - - while ( (node = ++nodeIndex && node && node[ dir ] || - - // Fallback to seeking `elem` from the start - (diff = nodeIndex = 0) || start.pop()) ) { - - // When found, cache indexes on `parent` and break - if ( node.nodeType === 1 && ++diff && node === elem ) { - uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; - break; - } - } - - } else { - // Use previously-cached element index if available - if ( useCache ) { - // ...in a gzip-friendly way - node = elem; - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - cache = uniqueCache[ type ] || []; - nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; - diff = nodeIndex; - } - - // 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 ? - node.nodeName.toLowerCase() === name : - node.nodeType === 1 ) && - ++diff ) { - - // Cache the index of each encountered element - if ( useCache ) { - outerCache = node[ expando ] || (node[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ node.uniqueID ] || - (outerCache[ node.uniqueID ] = {}); - - uniqueCache[ type ] = [ dirruns, diff ]; - } - - if ( node === elem ) { - break; - } - } - } - } - } - - // Incorporate the offset, then check against cycle size - diff -= last; - return diff === first || ( diff % first === 0 && diff / first >= 0 ); - } - }; - }, - - "PSEUDO": function( pseudo, argument ) { - // pseudo-class names are case-insensitive - // http://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 ); - - // The user may use createPseudo to indicate that - // arguments are needed to create the filter function - // just as Sizzle does - if ( fn[ expando ] ) { - return fn( argument ); - } - - // But maintain support for old signatures - if ( fn.length > 1 ) { - args = [ pseudo, pseudo, "", argument ]; - return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? - 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] ); - } - }) : - function( elem ) { - return fn( elem, 0, args ); - }; - } - - return fn; - } - }, - - pseudos: { - // Potentially complex pseudos - "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" ) ); - - return matcher[ expando ] ? - 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); - } - } - }) : - function( elem, context, xml ) { - input[0] = elem; - matcher( input, null, xml, results ); - // Don't keep the element (issue #299) - input[0] = null; - return !results.pop(); - }; - }), - - "has": markFunction(function( selector ) { - return function( elem ) { - return Sizzle( selector, elem ).length > 0; - }; - }), - - "contains": markFunction(function( text ) { - text = text.replace( runescape, funescape ); - return function( elem ) { - return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; - }; - }), - - // "Whether an element is represented by a :lang() selector - // is based solely on the element's language value - // being equal to the identifier C, - // 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 ) { - // lang value must be a valid identifier - if ( !ridentifier.test(lang || "") ) { - Sizzle.error( "unsupported lang: " + lang ); - } - lang = lang.replace( runescape, funescape ).toLowerCase(); - return function( elem ) { - var elemLang; - do { - if ( (elemLang = documentIsHTML ? - elem.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 ); - return false; - }; - }), - - // Miscellaneous - "target": function( elem ) { - var hash = window.location && window.location.hash; - return hash && hash.slice( 1 ) === elem.id; - }, - - "root": function( elem ) { - return elem === docElem; - }, - - "focus": function( elem ) { - return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); - }, - - // Boolean properties - "enabled": function( elem ) { - return elem.disabled === false; - }, - - "disabled": function( elem ) { - return elem.disabled === true; - }, - - "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); - }, - - "selected": function( elem ) { - // Accessing this property makes selected-by-default - // options in Safari work properly - if ( elem.parentNode ) { - elem.parentNode.selectedIndex; - } - - return elem.selected === true; - }, - - // Contents - "empty": function( elem ) { - // http://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 - for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { - if ( elem.nodeType < 6 ) { - return false; - } - } - return true; - }, - - "parent": function( elem ) { - return !Expr.pseudos["empty"]( elem ); - }, - - // Element/input types - "header": function( elem ) { - return rheader.test( elem.nodeName ); - }, - - "input": function( elem ) { - return rinputs.test( elem.nodeName ); - }, - - "button": function( elem ) { - var name = elem.nodeName.toLowerCase(); - return name === "input" && elem.type === "button" || name === "button"; - }, - - "text": function( elem ) { - var attr; - return elem.nodeName.toLowerCase() === "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" ); - }, - - // Position-in-collection - "first": createPositionalPseudo(function() { - return [ 0 ]; - }), - - "last": createPositionalPseudo(function( matchIndexes, length ) { - return [ length - 1 ]; - }), - - "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { - return [ argument < 0 ? argument + length : argument ]; - }), - - "even": createPositionalPseudo(function( matchIndexes, length ) { - var i = 0; - for ( ; i < length; i += 2 ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "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 = argument < 0 ? argument + length : argument; - for ( ; --i >= 0; ) { - matchIndexes.push( i ); - } - return matchIndexes; - }), - - "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"]; - -// Add button/input type pseudos -for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { - Expr.pseudos[ i ] = createInputPseudo( i ); -} -for ( i in { submit: true, reset: true } ) { - Expr.pseudos[ i ] = createButtonPseudo( i ); -} - -// Easy API for creating new setFilters -function setFilters() {} -setFilters.prototype = Expr.filters = Expr.pseudos; -Expr.setFilters = new setFilters(); - -tokenize = Sizzle.tokenize = function( selector, parseOnly ) { - var matched, match, tokens, type, - soFar, groups, preFilters, - cached = tokenCache[ selector + " " ]; - - if ( cached ) { - return parseOnly ? 0 : cached.slice( 0 ); - } - - soFar = selector; - groups = []; - preFilters = Expr.preFilter; - - while ( soFar ) { - - // Comma and first run - if ( !matched || (match = rcomma.exec( soFar )) ) { - if ( match ) { - // Don't consume trailing commas as valid - soFar = soFar.slice( match[0].length ) || soFar; - } - groups.push( (tokens = []) ); - } - - matched = false; - - // Combinators - if ( (match = rcombinators.exec( soFar )) ) { - matched = match.shift(); - tokens.push({ - value: matched, - // Cast descendant combinators to space - type: match[0].replace( rtrim, " " ) - }); - soFar = soFar.slice( matched.length ); - } - - // Filters - for ( type in Expr.filter ) { - if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || - (match = preFilters[ type ]( match ))) ) { - matched = match.shift(); - tokens.push({ - value: matched, - type: type, - matches: match - }); - soFar = soFar.slice( matched.length ); - } - } - - if ( !matched ) { - break; - } - } - - // 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 ); -}; - -function toSelector( tokens ) { - var i = 0, - len = tokens.length, - selector = ""; - for ( ; i < len; i++ ) { - selector += tokens[i].value; - } - return selector; -} - -function addCombinator( matcher, combinator, base ) { - var dir = combinator.dir, - checkNonElements = base && dir === "parentNode", - doneName = done++; - - return combinator.first ? - // Check against closest ancestor/preceding element - function( elem, context, xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - return matcher( elem, context, xml ); - } - } - } : - - // Check against all ancestor/preceding elements - function( elem, context, xml ) { - var oldCache, uniqueCache, outerCache, - newCache = [ dirruns, doneName ]; - - // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching - if ( xml ) { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - if ( matcher( elem, context, xml ) ) { - return true; - } - } - } - } else { - while ( (elem = elem[ dir ]) ) { - if ( elem.nodeType === 1 || checkNonElements ) { - outerCache = elem[ expando ] || (elem[ expando ] = {}); - - // Support: IE <9 only - // Defend against cloned attroperties (jQuery gh-1709) - uniqueCache = outerCache[ elem.uniqueID ] || (outerCache[ elem.uniqueID ] = {}); - - if ( (oldCache = uniqueCache[ dir ]) && - oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { - - // Assign to newCache so results back-propagate to previous elements - return (newCache[ 2 ] = oldCache[ 2 ]); - } else { - // Reuse newcache so results back-propagate to previous elements - uniqueCache[ dir ] = newCache; - - // A match means we're done; a fail means we have to keep checking - if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { - return true; - } - } - } - } - } - }; -} - -function elementMatcher( matchers ) { - return matchers.length > 1 ? - function( elem, context, xml ) { - var i = matchers.length; - while ( i-- ) { - if ( !matchers[i]( elem, context, xml ) ) { - return false; - } - } - return true; - } : - matchers[0]; -} - -function multipleContexts( selector, contexts, results ) { - var i = 0, - len = contexts.length; - for ( ; i < len; i++ ) { - Sizzle( selector, contexts[i], results ); - } - return results; -} - -function condense( unmatched, map, filter, context, xml ) { - var elem, - newUnmatched = [], - i = 0, - len = unmatched.length, - mapped = map != null; - - for ( ; i < len; i++ ) { - if ( (elem = unmatched[i]) ) { - if ( !filter || filter( elem, context, xml ) ) { - newUnmatched.push( elem ); - if ( mapped ) { - map.push( i ); - } - } - } - } - - return newUnmatched; -} - -function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { - if ( postFilter && !postFilter[ expando ] ) { - postFilter = setMatcher( postFilter ); - } - if ( postFinder && !postFinder[ expando ] ) { - postFinder = setMatcher( postFinder, postSelector ); - } - return markFunction(function( seed, results, context, xml ) { - var temp, i, elem, - preMap = [], - postMap = [], - preexisting = results.length, - - // Get initial elements from seed or 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, - - 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 ) { - matcher( matcherIn, matcherOut, context, xml ); - } - - // Apply postFilter - if ( postFilter ) { - temp = condense( matcherOut, postMap ); - postFilter( temp, [], context, xml ); - - // 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 ( 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]) ) { - // Restore matcherIn since elem is not yet a final match - temp.push( (matcherIn[i] = elem) ); - } - } - 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 ) { - - seed[temp] = !(results[temp] = elem); - } - } - } - - // Add elements to results, through postFinder if defined - } else { - matcherOut = condense( - matcherOut === results ? - matcherOut.splice( preexisting, matcherOut.length ) : - matcherOut - ); - if ( postFinder ) { - postFinder( null, results, matcherOut, xml ); - } else { - push.apply( results, matcherOut ); - } - } - }); -} - -function matcherFromTokens( tokens ) { - var checkContext, matcher, j, - len = tokens.length, - 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) - matchContext = addCombinator( function( elem ) { - return elem === checkContext; - }, implicitRelative, true ), - matchAnyContext = addCombinator( function( elem ) { - return indexOf( checkContext, elem ) > -1; - }, implicitRelative, true ), - matchers = [ function( elem, context, xml ) { - var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( - (checkContext = context).nodeType ? - matchContext( elem, context, xml ) : - matchAnyContext( elem, context, xml ) ); - // Avoid hanging onto element (issue #299) - checkContext = null; - return ret; - } ]; - - for ( ; i < len; i++ ) { - if ( (matcher = Expr.relative[ tokens[i].type ]) ) { - matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; - } else { - 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 ] ) { - 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" ), - matcher, - i < j && matcherFromTokens( tokens.slice( i, j ) ), - j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), - j < len && toSelector( tokens ) - ); - } - matchers.push( matcher ); - } - } - - return elementMatcher( matchers ); -} - -function matcherFromGroupMatchers( elementMatchers, setMatchers ) { - var bySet = setMatchers.length > 0, - byElement = elementMatchers.length > 0, - superMatcher = function( seed, context, xml, results, outermost ) { - var elem, j, matcher, - matchedCount = 0, - i = "0", - unmatched = seed && [], - setMatched = [], - contextBackup = outermostContext, - // We must always have either seed elements or outermost context - 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), - len = elems.length; - - if ( outermost ) { - outermostContext = context === document || context || outermost; - } - - // Add elements passing elementMatchers directly to results - // Support: IE<9, Safari - // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id - for ( ; i !== len && (elem = elems[i]) != null; i++ ) { - if ( byElement && elem ) { - j = 0; - if ( !context && elem.ownerDocument !== document ) { - setDocument( elem ); - xml = !documentIsHTML; - } - while ( (matcher = elementMatchers[j++]) ) { - if ( matcher( elem, context || document, xml) ) { - results.push( elem ); - break; - } - } - if ( outermost ) { - dirruns = dirrunsUnique; - } - } - - // Track unmatched elements for set filters - if ( bySet ) { - // They will have gone through all possible matchers - if ( (elem = !matcher && elem) ) { - matchedCount--; - } - - // Lengthen the array for every element, matched or not - if ( seed ) { - unmatched.push( elem ); - } - } - } - - // `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++]) ) { - 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 ); - } - } - } - - // Discard index placeholder values to get only actual matches - setMatched = condense( setMatched ); - } - - // Add matches to results - push.apply( results, setMatched ); - - // Seedless set matches succeeding multiple successful matchers stipulate sorting - if ( outermost && !seed && setMatched.length > 0 && - ( matchedCount + setMatchers.length ) > 1 ) { - - Sizzle.uniqueSort( results ); - } - } - - // Override manipulation of globals by nested matchers - if ( outermost ) { - dirruns = dirrunsUnique; - outermostContext = contextBackup; - } - - return unmatched; - }; - - return bySet ? - markFunction( superMatcher ) : - superMatcher; -} - -compile = Sizzle.compile = function( 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] ); - if ( cached[ expando ] ) { - setMatchers.push( cached ); - } else { - elementMatchers.push( cached ); - } - } - - // Cache the compiled function - 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 - * selector functions - * @param {String|Function} selector A selector or a pre-compiled - * selector function built with Sizzle.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 ) { - var i, tokens, token, type, find, - compiled = typeof selector === "function" && selector, - match = !seed && tokenize( (selector = compiled.selector || selector) ); - - results = results || []; - - // 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 ) { - - // 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" && - support.getById && context.nodeType === 9 && documentIsHTML && - Expr.relative[ tokens[1].type ] ) { - - context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; - if ( !context ) { - return results; - - // Precompiled matchers will still verify ancestry, so step up a level - } else if ( compiled ) { - context = context.parentNode; - } - - selector = selector.slice( tokens.shift().value.length ); - } - - // Fetch a seed set for right-to-left matching - i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; - while ( i-- ) { - token = tokens[i]; - - // Abort if we hit a combinator - if ( Expr.relative[ (type = token.type) ] ) { - break; - } - 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 is empty or no tokens remain, we can return early - tokens.splice( i, 1 ); - selector = seed.length && toSelector( tokens ); - if ( !selector ) { - push.apply( results, seed ); - return results; - } - - break; - } - } - } - } - - // Compile and execute a filtering function if one is not provided - // Provide `match` to avoid retokenization if we modified the selector above - ( compiled || compile( selector, match ) )( - seed, - context, - !documentIsHTML, - results, - !context || rsibling.test( selector ) && testContext( context.parentNode ) || context - ); - return results; -}; - -// One-time assignments - -// 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; - -// Initialize against the default document -setDocument(); - -// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) -// Detached nodes confoundingly follow *each other* -support.sortDetached = assert(function( div1 ) { - // Should return 1, but returns 4 (following) - return div1.compareDocumentPosition( document.createElement("div") ) & 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 ); - } - }); -} - -// 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; - } - }); -} - -// 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.uniqueSort = jQuery.unique = Sizzle.uniqueSort; -jQuery.text = Sizzle.getText; -jQuery.isXMLDoc = Sizzle.isXML; -jQuery.contains = Sizzle.contains; - - - -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; -}; - - -var siblings = function( n, elem ) { - var matched = []; - - for ( ; n; n = n.nextSibling ) { - if ( n.nodeType === 1 && n !== elem ) { - matched.push( n ); - } - } - - return matched; -}; - - -var rneedsContext = jQuery.expr.match.needsContext; - -var rsingleTag = ( /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/ ); - - - -var risSimple = /^.[^:#\[\.,]*$/; - -// Implement the identical functionality for filter and not -function winnow( elements, qualifier, not ) { - if ( jQuery.isFunction( qualifier ) ) { - return jQuery.grep( elements, function( elem, i ) { - /* jshint -W018 */ - return !!qualifier.call( elem, i, elem ) !== not; - } ); - - } - - 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 ); - } - - return jQuery.grep( elements, function( elem ) { - return ( jQuery.inArray( elem, qualifier ) > -1 ) !== not; - } ); -} - -jQuery.filter = function( expr, elems, not ) { - var elem = elems[ 0 ]; - - if ( 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; - } ) ); -}; - -jQuery.fn.extend( { - find: function( selector ) { - var i, - ret = [], - self = this, - len = self.length; - - if ( typeof selector !== "string" ) { - return this.pushStack( jQuery( selector ).filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( self[ i ], this ) ) { - return true; - } - } - } ) ); - } - - 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; - }, - filter: function( selector ) { - return this.pushStack( winnow( this, selector || [], false ) ); - }, - not: function( selector ) { - return this.pushStack( winnow( this, selector || [], true ) ); - }, - is: function( selector ) { - return !!winnow( - this, - - // If this is a positional/relative selector, check membership in the returned set - // so $("p:first").is("p:last") won't return true for a doc with two "p". - typeof selector === "string" && rneedsContext.test( selector ) ? - jQuery( selector ) : - selector || [], - false - ).length; - } -} ); - - -// Initialize a jQuery object - - -// A central reference to the root jQuery(document) -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-]*))$/, - - init = jQuery.fn.init = function( selector, context, root ) { - var match, elem; - - // HANDLE: $(""), $(null), $(undefined), $(false) - if ( !selector ) { - return this; - } - - // 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.charAt( 0 ) === "<" && - selector.charAt( 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 ]; - - } else { - match = rquickExpr.exec( selector ); - } - - // Match html or make sure no context is specified for #id - if ( match && ( match[ 1 ] || !context ) ) { - - // HANDLE: $(html) -> $(array) - if ( match[ 1 ] ) { - context = context instanceof jQuery ? context[ 0 ] : context; - - // scripts is true for back-compat - // Intentionally let the error be thrown if parseHTML is not present - jQuery.merge( this, jQuery.parseHTML( - match[ 1 ], - context && context.nodeType ? context.ownerDocument || context : document, - true - ) ); - - // HANDLE: $(html, props) - 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 ] ) ) { - this[ match ]( context[ match ] ); - - // ...and otherwise set as attributes - } else { - this.attr( match, context[ match ] ); - } - } - } - - return this; - - // HANDLE: $(#id) - } else { - elem = document.getElementById( match[ 2 ] ); - - // Check parentNode to catch when Blackberry 4.6 returns - // nodes that are no longer in the document #6963 - if ( elem && elem.parentNode ) { - - // Handle the case where IE and Opera return items - // by name instead of ID - if ( elem.id !== match[ 2 ] ) { - return rootjQuery.find( selector ); - } - - // Otherwise, we inject the element directly into the jQuery object - this.length = 1; - this[ 0 ] = elem; - } - - this.context = document; - this.selector = selector; - return this; - } - - // HANDLE: $(expr, $(...)) - } else if ( !context || context.jquery ) { - return ( context || root ).find( selector ); - - // HANDLE: $(expr, context) - // (which is just equivalent to: $(context).find(expr) - } else { - return this.constructor( context ).find( selector ); - } - - // HANDLE: $(DOMElement) - } else if ( selector.nodeType ) { - this.context = this[ 0 ] = selector; - this.length = 1; - return this; - - // HANDLE: $(function) - // Shortcut for document ready - } else if ( jQuery.isFunction( selector ) ) { - return typeof 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 ); - }; - -// Give the init function the jQuery prototype for later instantiation -init.prototype = jQuery.fn; - -// Initialize central reference -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, - contents: true, - next: true, - prev: true - }; - -jQuery.fn.extend( { - has: function( target ) { - var i, - targets = jQuery( target, this ), - len = targets.length; - - return this.filter( function() { - for ( i = 0; i < len; i++ ) { - if ( jQuery.contains( this, targets[ i ] ) ) { - return true; - } - } - } ); - }, - - closest: function( selectors, context ) { - var cur, - i = 0, - l = this.length, - matched = [], - pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? - jQuery( selectors, context || this.context ) : - 0; - - 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 : - - // Don't pass non-elements to Sizzle - cur.nodeType === 1 && - jQuery.find.matchesSelector( cur, selectors ) ) ) { - - matched.push( cur ); - break; - } - } - } - - return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); - }, - - // Determine the position of an element within - // the matched set of elements - index: function( elem ) { - - // No argument, return index in parent - if ( !elem ) { - return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; - } - - // index in selector - if ( typeof elem === "string" ) { - return jQuery.inArray( this[ 0 ], jQuery( elem ) ); - } - - // Locate the position of the desired element - return jQuery.inArray( - - // If it receives a jQuery object, the first element is used - elem.jquery ? elem[ 0 ] : elem, this ); - }, - - add: function( selector, context ) { - return this.pushStack( - jQuery.uniqueSort( - jQuery.merge( this.get(), jQuery( selector, context ) ) - ) - ); - }, - - addBack: function( selector ) { - return this.add( selector == null ? - this.prevObject : this.prevObject.filter( selector ) - ); - } -} ); - -function sibling( cur, dir ) { - do { - cur = cur[ dir ]; - } while ( cur && cur.nodeType !== 1 ); - - return cur; -} - -jQuery.each( { - parent: function( elem ) { - var parent = elem.parentNode; - return parent && parent.nodeType !== 11 ? parent : null; - }, - parents: function( elem ) { - return dir( elem, "parentNode" ); - }, - parentsUntil: function( elem, i, until ) { - return dir( elem, "parentNode", until ); - }, - next: function( elem ) { - return sibling( elem, "nextSibling" ); - }, - prev: function( elem ) { - return sibling( elem, "previousSibling" ); - }, - nextAll: function( elem ) { - return dir( elem, "nextSibling" ); - }, - prevAll: function( elem ) { - return dir( elem, "previousSibling" ); - }, - nextUntil: function( elem, i, until ) { - return dir( elem, "nextSibling", until ); - }, - prevUntil: function( elem, i, until ) { - return dir( elem, "previousSibling", until ); - }, - siblings: function( elem ) { - return siblings( ( elem.parentNode || {} ).firstChild, elem ); - }, - children: function( elem ) { - return siblings( elem.firstChild ); - }, - contents: function( elem ) { - return jQuery.nodeName( elem, "iframe" ) ? - elem.contentDocument || elem.contentWindow.document : - jQuery.merge( [], elem.childNodes ); - } -}, function( name, fn ) { - jQuery.fn[ name ] = function( until, selector ) { - var ret = jQuery.map( this, fn, until ); - - if ( name.slice( -5 ) !== "Until" ) { - selector = until; - } - - if ( selector && typeof selector === "string" ) { - ret = jQuery.filter( selector, ret ); - } - - if ( this.length > 1 ) { - - // Remove duplicates - if ( !guaranteedUnique[ name ] ) { - ret = jQuery.uniqueSort( ret ); - } - - // Reverse order for parents* and prev-derivatives - if ( rparentsprev.test( name ) ) { - ret = ret.reverse(); - } - } - - return this.pushStack( ret ); - }; -} ); -var rnotwhite = ( /\S+/g ); - - - -// Convert String-formatted options into Object-formatted ones -function createOptions( options ) { - var object = {}; - jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { - object[ flag ] = true; - } ); - return object; -} - -/* - * Create a callback list using the following parameters: - * - * options: an optional list of space-separated options that will change how - * the callback list behaves or a more traditional option object - * - * By default a callback list will act like an event callback list and can be - * "fired" multiple times. - * - * Possible options: - * - * once: will ensure the callback list can only be fired once (like a Deferred) - * - * memory: will keep track of previous values and will call any callback added - * after the list has been fired right away with the latest "memorized" - * values (like a Deferred) - * - * unique: will ensure a callback can only be added once (no duplicate in the list) - * - * stopOnFalse: interrupt callings when a callback returns false - * - */ -jQuery.Callbacks = function( options ) { - - // Convert options from String-formatted to Object-formatted if needed - // (we check in cache first) - options = typeof options === "string" ? - createOptions( options ) : - jQuery.extend( {}, options ); - - 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 prevent firing - locked, - - // Actual callback list - list = [], - - // 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() { - - // Enforce single-firing - 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; - - // 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 { - list = ""; - } - } - }, - - // Actual Callbacks object - self = { - - // Add a callback or a collection of callbacks to the list - add: function() { - if ( list ) { - - // 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 ) { - if ( jQuery.isFunction( arg ) ) { - if ( !options.unique || !self.has( arg ) ) { - list.push( arg ); - } - } else if ( arg && arg.length && jQuery.type( arg ) !== "string" ) { - - // Inspect recursively - add( arg ); - } - } ); - } )( arguments ); - - if ( memory && !firing ) { - fire(); - } - } - return this; - }, - - // Remove a callback from the list - remove: function() { - 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.length > 0; - }, - - // Remove all callbacks from the list - empty: function() { - if ( list ) { - list = []; - } - return this; - }, - - // 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 = true; - if ( !memory ) { - self.disable(); - } - return this; - }, - locked: function() { - return !!locked; - }, - - // Call all callbacks with the given context and arguments - fireWith: function( context, args ) { - if ( !locked ) { - args = args || []; - args = [ context, args.slice ? args.slice() : 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; - } - }; - - return self; -}; - - -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" ) ] - ], - state = "pending", - promise = { - state: function() { - return state; - }, - always: function() { - 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() - .progress( newDefer.notify ) - .done( newDefer.resolve ) - .fail( newDefer.reject ); - } else { - newDefer[ tuple[ 0 ] + "With" ]( - this === promise ? newDefer.promise() : this, - fn ? [ returned ] : arguments - ); - } - } ); - } ); - fns = null; - } ).promise(); - }, - - // Get a promise for this deferred - // If obj is provided, the promise aspect is added to the object - promise: function( obj ) { - return obj != null ? jQuery.extend( obj, promise ) : promise; - } - }, - 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 ]; - - // promise[ done | fail | progress ] = list.add - promise[ tuple[ 1 ] ] = list.add; - - // Handle state - if ( stateString ) { - list.add( function() { - - // state = [ resolved | rejected ] - state = stateString; - - // [ reject_list | resolve_list ].disable; progress_list.lock - }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); - } - - // deferred[ resolve | reject | notify ] - deferred[ tuple[ 0 ] ] = function() { - deferred[ tuple[ 0 ] + "With" ]( this === deferred ? promise : this, arguments ); - return this; - }; - deferred[ tuple[ 0 ] + "With" ] = list.fireWith; - } ); - - // Make the deferred a promise - promise.promise( deferred ); - - // Call given func if any - if ( func ) { - func.call( deferred, deferred ); - } - - // All done! - return deferred; - }, - - // Deferred helper - when: function( subordinate /* , ..., subordinateN */ ) { - var i = 0, - resolveValues = slice.call( arguments ), - length = resolveValues.length, - - // the count of uncompleted subordinates - remaining = length !== 1 || - ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, - - // 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 ) { - 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 ); - } - }; - }, - - progressValues, progressContexts, resolveContexts; - - // 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() - .progress( updateFunc( i, progressContexts, progressValues ) ) - .done( updateFunc( i, resolveContexts, resolveValues ) ) - .fail( deferred.reject ); - } else { - --remaining; - } - } - } - - // if we're not waiting on anything, resolve the master - if ( !remaining ) { - deferred.resolveWith( resolveContexts, resolveValues ); - } - - return deferred.promise(); - } -} ); - - -// The deferred used on DOM ready -var readyList; - -jQuery.fn.ready = function( fn ) { - - // Add the callback - jQuery.ready.promise().done( fn ); - - return this; -}; - -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 - 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 ) { - - // Abort if there are pending holds or we're already ready - if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { - return; - } - - // Remember that the DOM is ready - jQuery.isReady = true; - - // If a normal DOM Ready event fired, decrement, and wait if need be - if ( wait !== true && --jQuery.readyWait > 0 ) { - return; - } - - // 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" ); - } - } -} ); - -/** - * Clean-up method for dom ready events - */ -function detach() { - if ( document.addEventListener ) { - document.removeEventListener( "DOMContentLoaded", completed ); - window.removeEventListener( "load", completed ); - - } else { - document.detachEvent( "onreadystatechange", completed ); - window.detachEvent( "onload", completed ); - } -} - -/** - * The ready event handler and self cleanup method - */ -function completed() { - - // readyState === "complete" is good enough for us to call the dom ready in oldIE - if ( document.addEventListener || - window.event.type === "load" || - document.readyState === "complete" ) { - - detach(); - jQuery.ready(); - } -} - -jQuery.ready.promise = function( obj ) { - if ( !readyList ) { - - readyList = jQuery.Deferred(); - - // Catch cases where $(document).ready() is called - // after the browser event has already occurred. - // Support: IE6-10 - // Older IE sometimes signals "interactive" too soon - if ( document.readyState === "complete" || - ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { - - // Handle it asynchronously to allow scripts the opportunity to delay ready - window.setTimeout( jQuery.ready ); - - // Standards-based browsers support DOMContentLoaded - } else if ( document.addEventListener ) { - - // Use the handy event callback - document.addEventListener( "DOMContentLoaded", completed ); - - // A fallback to window.onload, that will always work - window.addEventListener( "load", completed ); - - // If IE event model is used - } else { - - // Ensure firing before onload, maybe late but safe also for iframes - document.attachEvent( "onreadystatechange", completed ); - - // A fallback to window.onload, that will always work - window.attachEvent( "onload", completed ); - - // If IE and not a frame - // continually check to see if the document is ready - var top = false; - - try { - top = window.frameElement == null && document.documentElement; - } catch ( e ) {} - - if ( top && top.doScroll ) { - ( function doScrollCheck() { - if ( !jQuery.isReady ) { - - try { - - // Use the trick by Diego Perini - // http://javascript.nwbox.com/IEContentLoaded/ - top.doScroll( "left" ); - } catch ( e ) { - return window.setTimeout( doScrollCheck, 50 ); - } - - // detach all dom ready events - detach(); - - // and execute any waiting functions - jQuery.ready(); - } - } )(); - } - } - } - return readyList.promise( obj ); -}; - -// Kick off the DOM ready check even if the user does not -jQuery.ready.promise(); - - - - -// Support: IE<9 -// Iteration over object's inherited properties before its own -var i; -for ( i in jQuery( support ) ) { - break; -} -support.ownFirst = i === "0"; - -// Note: most support tests are defined in their respective modules. -// false until the test is run -support.inlineBlockNeedsLayout = false; - -// Execute ASAP in case we need to set body.style.zoom -jQuery( function() { - - // Minified: var a,b,c,d - var val, div, body, container; - - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { - - // Return for frameset docs that don't have a body - return; - } - - // Setup - div = document.createElement( "div" ); - container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; - body.appendChild( container ).appendChild( div ); - - if ( typeof div.style.zoom !== "undefined" ) { - - // Support: IE<8 - // Check if natively block-level elements act like inline-block - // elements when setting their display to 'inline' and giving - // them layout - div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1"; - - support.inlineBlockNeedsLayout = val = div.offsetWidth === 3; - if ( val ) { - - // Prevent IE 6 from affecting layout for positioned elements #11048 - // Prevent IE from shrinking the body in IE 7 mode #12869 - // Support: IE<8 - body.style.zoom = 1; - } - } - - body.removeChild( container ); -} ); - - -( function() { - var div = document.createElement( "div" ); - - // Support: IE<9 - support.deleteExpando = true; - try { - delete div.test; - } catch ( e ) { - support.deleteExpando = false; - } - - // Null elements to avoid leaks in IE. - div = null; -} )(); -var acceptData = function( elem ) { - var noData = jQuery.noData[ ( elem.nodeName + " " ).toLowerCase() ], - nodeType = +elem.nodeType || 1; - - // Do not set data on non-element DOM nodes because it will not be cleared (#8335). - return nodeType !== 1 && nodeType !== 9 ? - false : - - // Nodes accept data unless otherwise specified; rejection can be conditional - !noData || noData !== true && elem.getAttribute( "classid" ) === noData; -}; - - - - -var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; - -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 ) { - - var name = "data-" + key.replace( rmultiDash, "-$1" ).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 ) {} - - // Make sure we set the data so it isn't changed later - jQuery.data( elem, key, data ); - - } else { - data = undefined; - } - } - - return data; -} - -// checks a cache object for emptiness -function isEmptyDataObject( obj ) { - var name; - for ( name in obj ) { - - // if the public data object is empty, the private is still empty - if ( name === "data" && jQuery.isEmptyObject( obj[ name ] ) ) { - continue; - } - if ( name !== "toJSON" ) { - return false; - } - } - - return true; -} - -function internalData( elem, name, data, pvt /* Internal Use Only */ ) { - if ( !acceptData( elem ) ) { - return; - } - - var ret, thisCache, - internalKey = jQuery.expando, - - // We have to handle DOM nodes and JS objects differently because IE6-7 - // can't GC object references properly across the DOM-JS boundary - isNode = elem.nodeType, - - // Only DOM nodes need the global jQuery cache; JS object data is - // attached directly to the object so GC can occur automatically - cache = isNode ? jQuery.cache : elem, - - // Only defining an ID for JS objects if its cache already exists allows - // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; - - // Avoid doing any more work than we need to when trying to get data on an - // object that has no data at all - if ( ( !id || !cache[ id ] || ( !pvt && !cache[ id ].data ) ) && - data === undefined && typeof name === "string" ) { - return; - } - - if ( !id ) { - - // Only DOM nodes need a new unique ID for each element since their data - // ends up in the global cache - if ( isNode ) { - id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; - } else { - id = internalKey; - } - } - - if ( !cache[ id ] ) { - - // Avoid exposing jQuery metadata on plain JS objects when the object - // is serialized using JSON.stringify - cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; - } - - // An object can be passed to jQuery.data instead of a key/value pair; this gets - // shallow copied over onto the existing cache - if ( typeof name === "object" || typeof name === "function" ) { - if ( pvt ) { - cache[ id ] = jQuery.extend( cache[ id ], name ); - } else { - cache[ id ].data = jQuery.extend( cache[ id ].data, name ); - } - } - - thisCache = cache[ id ]; - - // jQuery data() is stored in a separate object inside the object's internal data - // cache in order to avoid key collisions between internal data and user-defined - // data. - if ( !pvt ) { - if ( !thisCache.data ) { - thisCache.data = {}; - } - - thisCache = thisCache.data; - } - - if ( data !== undefined ) { - thisCache[ jQuery.camelCase( name ) ] = data; - } - - // Check for both converted-to-camel and non-converted data property names - // If a data property was specified - if ( typeof name === "string" ) { - - // First Try to find as-is property data - ret = thisCache[ name ]; - - // Test for null|undefined property data - if ( ret == null ) { - - // Try to find the camelCased property - ret = thisCache[ jQuery.camelCase( name ) ]; - } - } else { - ret = thisCache; - } - - return ret; -} - -function internalRemoveData( elem, name, pvt ) { - if ( !acceptData( elem ) ) { - return; - } - - var thisCache, i, - isNode = elem.nodeType, - - // See jQuery.data for more information - cache = isNode ? jQuery.cache : elem, - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; - - // If there is already no cache entry for this object, there is no - // purpose in continuing - if ( !cache[ id ] ) { - return; - } - - if ( name ) { - - thisCache = pvt ? cache[ id ] : cache[ id ].data; - - if ( thisCache ) { - - // Support array or space separated string names for data keys - if ( !jQuery.isArray( name ) ) { - - // try the string as a key before any manipulation - if ( name in thisCache ) { - name = [ name ]; - } else { - - // split the camel cased version by spaces unless a key with the spaces exists - name = jQuery.camelCase( name ); - if ( name in thisCache ) { - name = [ name ]; - } else { - name = name.split( " " ); - } - } - } else { - - // 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 = name.concat( jQuery.map( name, jQuery.camelCase ) ); - } - - i = name.length; - while ( i-- ) { - delete thisCache[ name[ i ] ]; - } - - // If there is no data left in the cache, we want to continue - // and let the cache object itself get destroyed - if ( pvt ? !isEmptyDataObject( thisCache ) : !jQuery.isEmptyObject( thisCache ) ) { - return; - } - } - } - - // See jQuery.data for more information - if ( !pvt ) { - delete cache[ id ].data; - - // Don't destroy the parent cache unless the internal data object - // had been the only thing left in it - if ( !isEmptyDataObject( cache[ id ] ) ) { - return; - } - } - - // Destroy the cache - if ( isNode ) { - jQuery.cleanData( [ elem ], true ); - - // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) - /* jshint eqeqeq: false */ - } else if ( support.deleteExpando || cache != cache.window ) { - /* jshint eqeqeq: true */ - delete cache[ id ]; - - // When all else fails, undefined - } else { - cache[ id ] = undefined; - } -} - -jQuery.extend( { - cache: {}, - - // The following elements (space-suffixed to avoid Object.prototype collisions) - // throw uncatchable exceptions if you attempt to set expando properties - noData: { - "applet ": true, - "embed ": true, - - // ...but Flash objects (which have this classid) *can* handle expandos - "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" - }, - - hasData: function( elem ) { - elem = elem.nodeType ? jQuery.cache[ elem[ jQuery.expando ] ] : elem[ jQuery.expando ]; - return !!elem && !isEmptyDataObject( elem ); - }, - - data: function( elem, name, data ) { - return internalData( elem, name, data ); - }, - - removeData: function( elem, name ) { - return internalRemoveData( elem, name ); - }, - - // For internal use only. - _data: function( elem, name, data ) { - return internalData( elem, name, data, true ); - }, - - _removeData: function( elem, name ) { - return internalRemoveData( elem, name, true ); - } -} ); - -jQuery.fn.extend( { - data: function( key, value ) { - var i, name, data, - elem = this[ 0 ], - attrs = elem && elem.attributes; - - // Special expections of .data basically thwart jQuery.access, - // so implement the relevant behavior ourselves - - // Gets all values - if ( key === undefined ) { - if ( this.length ) { - data = jQuery.data( elem ); - - if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { - i = attrs.length; - while ( i-- ) { - - // Support: IE11+ - // The attrs elements can be null (#14894) - if ( attrs[ i ] ) { - name = attrs[ i ].name; - if ( name.indexOf( "data-" ) === 0 ) { - name = jQuery.camelCase( name.slice( 5 ) ); - dataAttr( elem, name, data[ name ] ); - } - } - } - jQuery._data( elem, "parsedAttrs", true ); - } - } - - return data; - } - - // Sets multiple values - if ( typeof key === "object" ) { - return this.each( function() { - jQuery.data( this, key ); - } ); - } - - return arguments.length > 1 ? - - // Sets one value - this.each( function() { - jQuery.data( this, key, value ); - } ) : - - // Gets one value - // Try to fetch any internally stored data first - elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; - }, - - removeData: function( key ) { - return this.each( function() { - jQuery.removeData( this, key ); - } ); - } -} ); - - -jQuery.extend( { - queue: function( elem, type, data ) { - var queue; - - if ( elem ) { - type = ( type || "fx" ) + "queue"; - queue = jQuery._data( elem, type ); - - // Speed up dequeue by getting out quickly if this is just a lookup - if ( data ) { - if ( !queue || jQuery.isArray( data ) ) { - queue = jQuery._data( elem, type, jQuery.makeArray( data ) ); - } else { - queue.push( data ); - } - } - return queue || []; - } - }, - - dequeue: function( elem, type ) { - type = type || "fx"; - - var queue = jQuery.queue( elem, type ), - startLength = queue.length, - fn = queue.shift(), - hooks = jQuery._queueHooks( elem, type ), - next = function() { - jQuery.dequeue( elem, type ); - }; - - // If the fx queue is dequeued, always remove the progress sentinel - if ( fn === "inprogress" ) { - fn = queue.shift(); - startLength--; - } - - if ( fn ) { - - // Add a progress sentinel to prevent the fx queue from being - // automatically dequeued - if ( type === "fx" ) { - queue.unshift( "inprogress" ); - } - - // clear up the last queue stop function - delete hooks.stop; - fn.call( elem, next, hooks ); - } - - if ( !startLength && hooks ) { - hooks.empty.fire(); - } - }, - - // not intended for public consumption - generates a queueHooks object, - // or returns the current one - _queueHooks: function( elem, type ) { - var key = type + "queueHooks"; - return jQuery._data( elem, key ) || jQuery._data( elem, key, { - empty: jQuery.Callbacks( "once memory" ).add( function() { - jQuery._removeData( elem, type + "queue" ); - jQuery._removeData( elem, key ); - } ) - } ); - } -} ); - -jQuery.fn.extend( { - queue: function( type, data ) { - var setter = 2; - - if ( typeof type !== "string" ) { - data = type; - type = "fx"; - setter--; - } - - if ( arguments.length < setter ) { - return jQuery.queue( this[ 0 ], type ); - } - - return data === undefined ? - this : - 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" ) { - jQuery.dequeue( this, type ); - } - } ); - }, - dequeue: function( type ) { - 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 ) { - var tmp, - count = 1, - defer = jQuery.Deferred(), - elements = this, - i = this.length, - resolve = function() { - if ( !( --count ) ) { - defer.resolveWith( elements, [ elements ] ); - } - }; - - if ( typeof type !== "string" ) { - obj = type; - type = undefined; - } - type = type || "fx"; - - while ( i-- ) { - tmp = jQuery._data( elements[ i ], type + "queueHooks" ); - if ( tmp && tmp.empty ) { - count++; - tmp.empty.add( resolve ); - } - } - resolve(); - return defer.promise( obj ); - } -} ); - - -( function() { - var shrinkWrapBlocksVal; - - support.shrinkWrapBlocks = function() { - if ( shrinkWrapBlocksVal != null ) { - return shrinkWrapBlocksVal; - } - - // Will be changed later if needed. - shrinkWrapBlocksVal = false; - - // Minified: var b,c,d - var div, body, container; - - body = document.getElementsByTagName( "body" )[ 0 ]; - if ( !body || !body.style ) { - - // Test fired too early or in an unsupported environment, exit. - return; - } - - // Setup - div = document.createElement( "div" ); - container = document.createElement( "div" ); - container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px"; - body.appendChild( container ).appendChild( div ); - - // Support: IE6 - // Check if elements with layout shrink-wrap their children - if ( typeof div.style.zoom !== "undefined" ) { - - // Reset CSS: box-sizing; display; margin; border - div.style.cssText = - - // Support: Firefox<29, Android 2.3 - // Vendor-prefix box-sizing - "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" + - "box-sizing:content-box;display:block;margin:0;border:0;" + - "padding:1px;width:1px;zoom:1"; - div.appendChild( document.createElement( "div" ) ).style.width = "5px"; - shrinkWrapBlocksVal = div.offsetWidth !== 3; - } - - body.removeChild( container ); - - return shrinkWrapBlocksVal; - }; - -} )(); -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; - // in that case, element will be second argument - elem = el || elem; - return jQuery.css( elem, "display" ) === "none" || - !jQuery.contains( elem.ownerDocument, elem ); - }; - - - -function adjustCSS( elem, prop, valueParts, tween ) { - var adjusted, - scale = 1, - 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 = ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && - rcssNum.exec( jQuery.css( elem, prop ) ); - - if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { - - // Trust units reported by jQuery.css - unit = unit || initialInUnit[ 3 ]; - - // Make sure we update the tween properties later on - valueParts = valueParts || []; - - // Iteratively approximate from a nonzero starting point - initialInUnit = +initial || 1; - - do { - - // If previous iteration zeroed out, double until we get *something*. - // Use string for doubling so we don't accidentally see scale as unchanged below - scale = scale || ".5"; - - // Adjust and apply - initialInUnit = initialInUnit / scale; - jQuery.style( elem, prop, initialInUnit + unit ); - - // Update scale, tolerating zero or NaN from tween.cur() - // Break the loop if scale is unchanged or perfect, or if we've just had enough. - } while ( - scale !== ( scale = currentValue() / initial ) && scale !== 1 && --maxIterations - ); - } - - 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; -} - - -// Multifunctional method to get and set values of a collection -// The value/s can optionally be executed if it's a function -var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { - var i = 0, - length = elems.length, - bulk = key == null; - - // Sets many values - if ( jQuery.type( key ) === "object" ) { - chainable = true; - for ( i in key ) { - access( elems, fn, i, key[ i ], true, emptyGet, raw ); - } - - // Sets one value - } else if ( value !== undefined ) { - chainable = true; - - if ( !jQuery.isFunction( value ) ) { - raw = true; - } - - if ( bulk ) { - - // Bulk operations run against the entire set - if ( raw ) { - fn.call( elems, value ); - fn = null; - - // ...except when executing function values - } else { - bulk = fn; - fn = function( elem, key, value ) { - return bulk.call( jQuery( elem ), value ); - }; - } - } - - if ( fn ) { - for ( ; i < length; i++ ) { - fn( - elems[ i ], - key, - raw ? value : value.call( elems[ i ], i, fn( elems[ i ], key ) ) - ); - } - } - } - - return chainable ? - elems : - - // Gets - bulk ? - fn.call( elems ) : - length ? fn( elems[ 0 ], key ) : emptyGet; -}; -var rcheckableType = ( /^(?:checkbox|radio)$/i ); - -var rtagName = ( /<([\w:-]+)/ ); - -var rscriptType = ( /^$|\/(?:java|ecma)script/i ); - -var rleadingWhitespace = ( /^\s+/ ); - -var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|" + - "details|dialog|figcaption|figure|footer|header|hgroup|main|" + - "mark|meter|nav|output|picture|progress|section|summary|template|time|video"; - - - -function createSafeFragment( document ) { - var list = nodeNames.split( "|" ), - safeFrag = document.createDocumentFragment(); - - if ( safeFrag.createElement ) { - while ( list.length ) { - safeFrag.createElement( - list.pop() - ); - } - } - return safeFrag; -} - - -( function() { - var div = document.createElement( "div" ), - fragment = document.createDocumentFragment(), - input = document.createElement( "input" ); - - // Setup - div.innerHTML = "
a"; - - // IE strips leading whitespace when .innerHTML is used - support.leadingWhitespace = div.firstChild.nodeType === 3; - - // Make sure that tbody elements aren't automatically inserted - // IE will insert them into empty tables - support.tbody = !div.getElementsByTagName( "tbody" ).length; - - // Make sure that link elements get serialized correctly by innerHTML - // This requires a wrapper element in IE - support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; - - // Makes sure cloning an html5 element does not cause problems - // Where outerHTML is undefined, this still works - support.html5Clone = - document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav>"; - - // Check if a disconnected checkbox will retain its checked - // value of true after appended to the DOM (IE6/7) - input.type = "checkbox"; - input.checked = true; - fragment.appendChild( input ); - support.appendChecked = input.checked; - - // Make sure textarea (and checkbox) defaultValue is properly cloned - // Support: IE6-IE11+ - div.innerHTML = ""; - support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; - - // #11217 - WebKit loses check when the name is after the checked attribute - fragment.appendChild( div ); - - // Support: Windows Web Apps (WWA) - // `name` and `type` must use .setAttribute for WWA (#14901) - input = document.createElement( "input" ); - input.setAttribute( "type", "radio" ); - input.setAttribute( "checked", "checked" ); - input.setAttribute( "name", "t" ); - - div.appendChild( input ); - - // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 - // old WebKit doesn't clone checked state correctly in fragments - support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; - - // Support: IE<9 - // Cloned elements keep attachEvent handlers, we use addEventListener on IE9+ - support.noCloneEvent = !!div.addEventListener; - - // Support: IE<9 - // Since attributes and properties are the same in IE, - // cleanData must set properties to undefined rather than use removeAttribute - div[ jQuery.expando ] = 1; - support.attributes = !div.getAttribute( jQuery.expando ); -} )(); - - -// We have to close these tags to support XHTML (#13200) -var wrapMap = { - option: [ 1, "" ], - legend: [ 1, "
", "
" ], - area: [ 1, "", "" ], - - // Support: IE8 - param: [ 1, "", "" ], - thead: [ 1, "", "
" ], - tr: [ 2, "", "
" ], - col: [ 2, "", "
" ], - td: [ 3, "", "
" ], - - // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, - // unless wrapped in a div with non-breaking characters in front of it. - _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X
", "
" ] -}; - -// Support: IE8-IE9 -wrapMap.optgroup = wrapMap.option; - -wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; -wrapMap.th = wrapMap.td; - - -function getAll( context, tag ) { - var elems, elem, - i = 0, - found = typeof context.getElementsByTagName !== "undefined" ? - context.getElementsByTagName( tag || "*" ) : - typeof context.querySelectorAll !== "undefined" ? - context.querySelectorAll( tag || "*" ) : - undefined; - - if ( !found ) { - for ( found = [], elems = context.childNodes || context; - ( elem = elems[ i ] ) != null; - i++ - ) { - if ( !tag || jQuery.nodeName( elem, tag ) ) { - found.push( elem ); - } else { - jQuery.merge( found, getAll( elem, tag ) ); - } - } - } - - return tag === undefined || tag && jQuery.nodeName( context, tag ) ? - jQuery.merge( [ context ], found ) : - found; -} - - -// Mark scripts as having already been evaluated -function setGlobalEval( elems, refElements ) { - var elem, - i = 0; - for ( ; ( elem = elems[ i ] ) != null; i++ ) { - jQuery._data( - elem, - "globalEval", - !refElements || jQuery._data( refElements[ i ], "globalEval" ) - ); - } -} - - -var rhtml = /<|&#?\w+;/, - rtbody = / from table fragments - if ( !support.tbody ) { - - // String was a , *may* have spurious - elem = tag === "table" && !rtbody.test( elem ) ? - tmp.firstChild : - - // String was a bare or - wrap[ 1 ] === "
" && !rtbody.test( elem ) ? - tmp : - 0; - - j = elem && elem.childNodes.length; - while ( j-- ) { - if ( jQuery.nodeName( ( tbody = elem.childNodes[ j ] ), "tbody" ) && - !tbody.childNodes.length ) { - - elem.removeChild( tbody ); - } - } - } - - jQuery.merge( nodes, tmp.childNodes ); - - // Fix #12392 for WebKit and IE > 9 - tmp.textContent = ""; - - // Fix #12392 for oldIE - while ( tmp.firstChild ) { - tmp.removeChild( tmp.firstChild ); - } - - // Remember the top-level container for proper cleanup - tmp = safe.lastChild; - } - } - } - - // Fix #11356: Clear elements from fragment - if ( tmp ) { - safe.removeChild( tmp ); - } - - // Reset defaultChecked for any radios and checkboxes - // about to be appended to the DOM in IE 6/7 (#8060) - if ( !support.appendChecked ) { - jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); - } - - 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; - } - - contains = jQuery.contains( elem.ownerDocument, elem ); - - // Append to fragment - tmp = getAll( safe.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 ); - } - } - } - } - - tmp = null; - - return safe; -} - - -( function() { - var i, eventName, - div = document.createElement( "div" ); - - // Support: IE<9 (lack submit/change bubble), Firefox (lack focus(in | out) events) - for ( i in { submit: true, change: true, focusin: true } ) { - eventName = "on" + i; - - if ( !( support[ i ] = eventName in window ) ) { - - // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) - div.setAttribute( eventName, "t" ); - support[ i ] = div.attributes[ eventName ].expando === false; - } - } - - // Null elements to avoid leaks in IE. - div = null; -} )(); - - -var rformElems = /^(?:input|select|textarea)$/i, - rkeyEvent = /^key/, - rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, - rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, - rtypenamespace = /^([^.]*)(?:\.(.+)|)/; - -function returnTrue() { - return true; -} - -function returnFalse() { - return false; -} - -// Support: IE9 -// See #13393 for more info -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 ); - } ); -} - -/* - * Helper functions for managing events -- not part of the public interface. - * Props to Dean Edwards' addEvent library for many of the ideas. - */ -jQuery.event = { - - global: {}, - - add: function( elem, types, handler, data, selector ) { - var tmp, events, t, handleObjIn, - special, eventHandle, handleObj, - handlers, type, namespaces, origType, - elemData = jQuery._data( elem ); - - // Don't attach events to noData or text/comment nodes (but allow plain objects) - if ( !elemData ) { - return; - } - - // Caller can pass in an object of custom data in lieu of the handler - if ( handler.handler ) { - handleObjIn = handler; - handler = handleObjIn.handler; - selector = handleObjIn.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 ( !( 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 !== "undefined" && - ( !e || jQuery.event.triggered !== e.type ) ? - jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : - undefined; - }; - - // Add elem as a property of the handle fn to prevent a memory leak - // with IE non-native events - eventHandle.elem = elem; - } - - // Handle multiple events separated by a space - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - 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 ) { - continue; - } - - // If event changes its type, use the special event handlers for the changed type - special = jQuery.event.special[ type ] || {}; - - // If selector defined, determine special event api type, otherwise given type - type = ( selector ? special.delegateType : special.bindType ) || type; - - // Update special based on newly reset type - special = jQuery.event.special[ type ] || {}; - - // handleObj is passed to all event handlers - handleObj = jQuery.extend( { - type: type, - origType: origType, - data: data, - handler: handler, - guid: handler.guid, - selector: selector, - needsContext: selector && jQuery.expr.match.needsContext.test( selector ), - namespace: namespaces.join( "." ) - }, handleObjIn ); - - // Init the event handler queue if we're the first - if ( !( handlers = events[ type ] ) ) { - handlers = events[ type ] = []; - handlers.delegateCount = 0; - - // Only use addEventListener/attachEvent if the special events handler returns false - if ( !special.setup || - special.setup.call( elem, data, namespaces, eventHandle ) === false ) { - - // Bind the global event handler to the element - if ( elem.addEventListener ) { - elem.addEventListener( type, eventHandle, false ); - - } else if ( elem.attachEvent ) { - elem.attachEvent( "on" + type, eventHandle ); - } - } - } - - if ( special.add ) { - special.add.call( elem, handleObj ); - - if ( !handleObj.handler.guid ) { - handleObj.handler.guid = handler.guid; - } - } - - // Add to the element's handler list, delegates in front - if ( selector ) { - handlers.splice( handlers.delegateCount++, 0, handleObj ); - } else { - handlers.push( handleObj ); - } - - // Keep track of which events have ever been used, for event optimization - jQuery.event.global[ type ] = true; - } - - // Nullify elem to prevent memory leaks in IE - elem = null; - }, - - // Detach an event or set of events from an element - remove: function( elem, types, handler, selector, mappedTypes ) { - var j, handleObj, tmp, - origCount, t, events, - special, handlers, type, - namespaces, origType, - elemData = jQuery.hasData( elem ) && jQuery._data( elem ); - - if ( !elemData || !( events = elemData.events ) ) { - return; - } - - // Once for each type.namespace in types; type may be omitted - types = ( types || "" ).match( rnotwhite ) || [ "" ]; - t = types.length; - while ( t-- ) { - 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 ) { - for ( type in events ) { - jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); - } - continue; - } - - special = jQuery.event.special[ type ] || {}; - type = ( selector ? special.delegateType : special.bindType ) || type; - handlers = events[ type ] || []; - tmp = tmp[ 2 ] && - new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); - - // Remove matching events - origCount = j = handlers.length; - while ( j-- ) { - handleObj = handlers[ j ]; - - if ( ( mappedTypes || origType === handleObj.origType ) && - ( !handler || handler.guid === handleObj.guid ) && - ( !tmp || tmp.test( handleObj.namespace ) ) && - ( !selector || selector === handleObj.selector || - selector === "**" && handleObj.selector ) ) { - handlers.splice( j, 1 ); - - if ( handleObj.selector ) { - handlers.delegateCount--; - } - if ( special.remove ) { - special.remove.call( elem, handleObj ); - } - } - } - - // 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 ) { - - jQuery.removeEvent( elem, type, elemData.handle ); - } - - delete events[ type ]; - } - } - - // Remove the expando if it's no longer used - if ( jQuery.isEmptyObject( events ) ) { - delete elemData.handle; - - // removeData also checks for emptiness and clears the expando if empty - // so use it instead of delete - jQuery._removeData( elem, "events" ); - } - }, - - trigger: function( event, data, elem, onlyHandlers ) { - var handle, ontype, cur, - bubbleType, special, tmp, i, - eventPath = [ elem || document ], - type = hasOwn.call( event, "type" ) ? event.type : event, - namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; - - cur = tmp = elem = elem || document; - - // 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( "." ) > -1 ) { - - // 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.rnamespace = 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 = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && - jQuery._data( cur, "handle" ); - - if ( handle ) { - handle.apply( cur, data ); - } - - // Native handler - handle = ontype && cur[ ontype ]; - if ( handle && handle.apply && 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 - ) && acceptData( elem ) - ) { - - // Call a native DOM method on the target with the same name name as the event. - // Can't use an .isFunction() check here because IE6/7 fails that test. - // Don't do default actions on window, that's where global variables be (#6170) - if ( ontype && 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; - try { - elem[ type ](); - } catch ( e ) { - - // IE<9 dies on focus/blur to hidden element (#1486,#12518) - // only reproducible on winXP IE8 native, not IE9 in IE8 mode - } - 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 = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], - special = jQuery.event.special[ event.type ] || {}; - - // Use the fix-ed jQuery.Event rather than the (read-only) native event - args[ 0 ] = event; - event.delegateTarget = this; - - // Call the preDispatch hook for the mapped type, and let it bail if desired - if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { - return; - } - - // Determine handlers - handlerQueue = jQuery.event.handlers.call( this, event, handlers ); - - // Run delegates first; they may want to stop propagation beneath us - i = 0; - while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { - event.currentTarget = matched.elem; - - j = 0; - 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.rnamespace || 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 ); - - if ( ret !== undefined ) { - if ( ( event.result = ret ) === false ) { - event.preventDefault(); - event.stopPropagation(); - } - } - } - } - } - - // Call the postDispatch hook for the mapped type - if ( special.postDispatch ) { - special.postDispatch.call( this, event ); - } - - return event.result; - }, - - handlers: function( event, handlers ) { - var i, matches, sel, handleObj, - handlerQueue = [], - delegateCount = handlers.delegateCount, - cur = event.target; - - // Support (at least): Chrome, IE9 - // Find delegate handlers - // Black-hole SVG instance trees (#13180) - // - // Support: Firefox<=42+ - // Avoid non-left-click in FF but don't block IE radio events (#3861, gh-2343) - if ( delegateCount && cur.nodeType && - ( event.type !== "click" || isNaN( event.button ) || event.button < 1 ) ) { - - /* jshint eqeqeq: false */ - for ( ; cur != this; cur = cur.parentNode || this ) { - /* jshint eqeqeq: true */ - - // Don't check non-elements (#13208) - // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) - if ( cur.nodeType === 1 && ( cur.disabled !== true || event.type !== "click" ) ) { - matches = []; - for ( i = 0; i < delegateCount; i++ ) { - handleObj = handlers[ i ]; - - // Don't conflict with Object.prototype properties (#13203) - sel = handleObj.selector + " "; - - if ( matches[ sel ] === undefined ) { - matches[ sel ] = handleObj.needsContext ? - jQuery( sel, this ).index( cur ) > -1 : - jQuery.find( sel, this, null, [ cur ] ).length; - } - if ( matches[ sel ] ) { - matches.push( handleObj ); - } - } - if ( matches.length ) { - handlerQueue.push( { elem: cur, handlers: matches } ); - } - } - } - } - - // Add the remaining (directly-bound) handlers - if ( delegateCount < handlers.length ) { - handlerQueue.push( { elem: this, handlers: handlers.slice( delegateCount ) } ); - } - - return handlerQueue; - }, - - 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: IE<9 - // Fix target property (#1925) - if ( !event.target ) { - event.target = originalEvent.srcElement || document; - } - - // Support: Safari 6-8+ - // Target should not be a text node (#504, #13143) - if ( event.target.nodeType === 3 ) { - event.target = event.target.parentNode; - } - - // Support: IE<9 - // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) - event.metaKey = !!event.metaKey; - - return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; - }, - - // Includes some event props shared by KeyEvent and MouseEvent - props: ( "altKey bubbles cancelable ctrlKey currentTarget detail eventPhase " + - "metaKey relatedTarget shiftKey target timeStamp view which" ).split( " " ), - - fixHooks: {}, - - 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; - } - - return event; - } - }, - - mouseHooks: { - props: ( "button buttons clientX clientY fromElement offsetX offsetY " + - "pageX pageY screenX screenY toElement" ).split( " " ), - filter: function( event, original ) { - var body, eventDoc, doc, - button = original.button, - fromElement = original.fromElement; - - // 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 relatedTarget, if necessary - if ( !event.relatedTarget && fromElement ) { - event.relatedTarget = fromElement === event.target ? - original.toElement : - fromElement; - } - - // 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; - } - }, - - 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 ) { - try { - this.focus(); - return false; - } catch ( e ) { - - // Support: IE<9 - // If we error on focus to hidden element (#1486, #12518), - // let .trigger() run the handlers - } - } - }, - 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 ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { - this.click(); - return false; - } - }, - - // For cross-browser consistency, don't fire native .click() on links - _default: function( event ) { - return jQuery.nodeName( event.target, "a" ); - } - }, - - beforeunload: { - postDispatch: function( event ) { - - // Support: Firefox 20+ - // Firefox doesn't alert if the returnValue field is not set. - if ( event.result !== undefined && event.originalEvent ) { - event.originalEvent.returnValue = event.result; - } - } - } - }, - - // Piggyback on a donor event to simulate a different one - simulate: function( type, elem, event ) { - var e = jQuery.extend( - new jQuery.Event(), - event, - { - type: type, - isSimulated: true - - // Previously, `originalEvent: {}` was set here, so stopPropagation call - // would not be triggered on donor event, since in our own - // jQuery.event.stopPropagation function we had a check for existence of - // originalEvent.stopPropagation method, so, consequently it would be a noop. - // - // Guard for simulated events was moved to jQuery.event.stopPropagation function - // since `originalEvent` should point to the original event for the - // constancy with other events and for more focused logic - } - ); - - jQuery.event.trigger( e, null, elem ); - - if ( e.isDefaultPrevented() ) { - event.preventDefault(); - } - } -}; - -jQuery.removeEvent = document.removeEventListener ? - function( elem, type, handle ) { - - // This "if" is needed for plain objects - if ( elem.removeEventListener ) { - elem.removeEventListener( type, handle ); - } - } : - function( elem, type, handle ) { - var name = "on" + type; - - if ( elem.detachEvent ) { - - // #8545, #7054, preventing memory leaks for custom events in IE6-8 - // detachEvent needed property on element, by name of that event, - // to properly expose it to GC - if ( typeof elem[ name ] === "undefined" ) { - elem[ name ] = null; - } - - elem.detachEvent( name, handle ); - } - }; - -jQuery.Event = function( src, props ) { - - // Allow instantiation without the 'new' keyword - if ( !( this instanceof jQuery.Event ) ) { - return new jQuery.Event( src, props ); - } - - // Event object - if ( src && src.type ) { - this.originalEvent = src; - this.type = src.type; - - // Events bubbling up the document may have been marked as prevented - // by a handler lower down the tree; reflect the correct value. - this.isDefaultPrevented = src.defaultPrevented || - src.defaultPrevented === undefined && - - // Support: IE < 9, Android < 4.0 - src.returnValue === false ? - returnTrue : - returnFalse; - - // Event type - } else { - this.type = src; - } - - // Put explicitly provided properties onto the event object - if ( props ) { - jQuery.extend( this, props ); - } - - // Create a timestamp if incoming event doesn't have one - this.timeStamp = src && src.timeStamp || jQuery.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 -jQuery.Event.prototype = { - constructor: jQuery.Event, - isDefaultPrevented: returnFalse, - isPropagationStopped: returnFalse, - isImmediatePropagationStopped: returnFalse, - - preventDefault: function() { - var e = this.originalEvent; - - this.isDefaultPrevented = returnTrue; - if ( !e ) { - return; - } - - // If preventDefault exists, run it on the original event - if ( e.preventDefault ) { - e.preventDefault(); - - // Support: IE - // Otherwise set the returnValue property of the original event to false - } else { - e.returnValue = false; - } - }, - stopPropagation: function() { - var e = this.originalEvent; - - this.isPropagationStopped = returnTrue; - - if ( !e || this.isSimulated ) { - return; - } - - // If stopPropagation exists, run it on the original event - if ( e.stopPropagation ) { - e.stopPropagation(); - } - - // Support: IE - // Set the cancelBubble property of the original event to true - e.cancelBubble = true; - }, - stopImmediatePropagation: function() { - var e = this.originalEvent; - - this.isImmediatePropagationStopped = returnTrue; - - if ( e && e.stopImmediatePropagation ) { - e.stopImmediatePropagation(); - } - - this.stopPropagation(); - } -}; - -// Create mouseenter/leave events using mouseover/out and event-time checks -// 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://code.google.com/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", - pointerleave: "pointerout" -}, function( orig, fix ) { - jQuery.event.special[ orig ] = { - delegateType: fix, - bindType: fix, - - handle: function( event ) { - var ret, - target = this, - related = event.relatedTarget, - handleObj = event.handleObj; - - // 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 ) ) ) { - event.type = handleObj.origType; - ret = handleObj.handler.apply( this, arguments ); - event.type = fix; - } - return ret; - } - }; -} ); - -// IE submit delegation -if ( !support.submit ) { - - jQuery.event.special.submit = { - setup: function() { - - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Lazy-add a submit handler when a descendant form may potentially be submitted - jQuery.event.add( this, "click._submit keypress._submit", function( e ) { - - // Node name check avoids a VML-related crash in IE (#9807) - var elem = e.target, - form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? - - // Support: IE <=8 - // We use jQuery.prop instead of elem.form - // to allow fixing the IE8 delegated submit issue (gh-2332) - // by 3rd party polyfills/workarounds. - jQuery.prop( elem, "form" ) : - undefined; - - if ( form && !jQuery._data( form, "submit" ) ) { - jQuery.event.add( form, "submit._submit", function( event ) { - event._submitBubble = true; - } ); - jQuery._data( form, "submit", true ); - } - } ); - - // return undefined since we don't need an event listener - }, - - postDispatch: function( event ) { - - // If form was submitted by the user, bubble the event up the tree - if ( event._submitBubble ) { - delete event._submitBubble; - if ( this.parentNode && !event.isTrigger ) { - jQuery.event.simulate( "submit", this.parentNode, event ); - } - } - }, - - teardown: function() { - - // Only need this for delegated form submit events - if ( jQuery.nodeName( this, "form" ) ) { - return false; - } - - // Remove delegated handlers; cleanData eventually reaps submit handlers attached above - jQuery.event.remove( this, "._submit" ); - } - }; -} - -// IE change delegation and checkbox/radio fix -if ( !support.change ) { - - jQuery.event.special.change = { - - setup: function() { - - if ( rformElems.test( this.nodeName ) ) { - - // IE doesn't fire change on a check/radio until blur; trigger it on click - // after a propertychange. Eat the blur-change in special.change.handle. - // This still fires onchange a second time for check/radio after blur. - if ( this.type === "checkbox" || this.type === "radio" ) { - jQuery.event.add( this, "propertychange._change", function( event ) { - if ( event.originalEvent.propertyName === "checked" ) { - this._justChanged = true; - } - } ); - jQuery.event.add( this, "click._change", function( event ) { - if ( this._justChanged && !event.isTrigger ) { - this._justChanged = false; - } - - // Allow triggered, simulated change events (#11500) - jQuery.event.simulate( "change", this, event ); - } ); - } - return false; - } - - // Delegated event; lazy-add a change handler on descendant inputs - jQuery.event.add( this, "beforeactivate._change", function( e ) { - var elem = e.target; - - if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "change" ) ) { - jQuery.event.add( elem, "change._change", function( event ) { - if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { - jQuery.event.simulate( "change", this.parentNode, event ); - } - } ); - jQuery._data( elem, "change", true ); - } - } ); - }, - - handle: function( event ) { - var elem = event.target; - - // Swallow native change events from checkbox/radio, we already triggered them above - if ( this !== elem || event.isSimulated || event.isTrigger || - ( elem.type !== "radio" && elem.type !== "checkbox" ) ) { - - return event.handleObj.handler.apply( this, arguments ); - } - }, - - teardown: function() { - jQuery.event.remove( this, "._change" ); - - return !rformElems.test( this.nodeName ); - } - }; -} - -// Support: Firefox -// Firefox doesn't have focus(in | out) events -// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 -// -// Support: Chrome, Safari -// 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://code.google.com/p/chromium/issues/detail?id=449857 -if ( !support.focusin ) { - jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { - - // 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 ) ); - }; - - jQuery.event.special[ fix ] = { - setup: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ); - - if ( !attaches ) { - doc.addEventListener( orig, handler, true ); - } - jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); - }, - teardown: function() { - var doc = this.ownerDocument || this, - attaches = jQuery._data( doc, fix ) - 1; - - if ( !attaches ) { - doc.removeEventListener( orig, handler, true ); - jQuery._removeData( doc, fix ); - } else { - jQuery._data( doc, fix, attaches ); - } - } - }; - } ); -} - -jQuery.fn.extend( { - - on: function( types, selector, data, fn ) { - return on( this, types, selector, data, fn ); - }, - one: function( types, selector, data, fn ) { - 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.selector, - handleObj.handler - ); - return this; - } - if ( typeof types === "object" ) { - - // ( types-object [, selector] ) - for ( type in types ) { - this.off( type, selector, types[ type ] ); - } - return this; - } - if ( selector === false || typeof selector === "function" ) { - - // ( types [, fn] ) - fn = selector; - selector = undefined; - } - if ( fn === false ) { - fn = returnFalse; - } - 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 rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, - rnoshimcache = new RegExp( "<(?:" + nodeNames + ")[\\s/>]", "i" ), - rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi, - - // Support: IE 10-11, Edge 10240+ - // In IE/Edge using regex groups here causes severe slowdowns. - // See https://connect.microsoft.com/IE/feedback/details/1736512/ - rnoInnerhtml = /\s*$/g, - safeFragment = createSafeFragment( document ), - fragmentDiv = safeFragment.appendChild( document.createElement( "div" ) ); - -// Support: IE<8 -// Manipulating tables requires a tbody -function manipulationTarget( elem, content ) { - return jQuery.nodeName( elem, "table" ) && - jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? - - elem.getElementsByTagName( "tbody" )[ 0 ] || - elem.appendChild( elem.ownerDocument.createElement( "tbody" ) ) : - elem; -} - -// Replace/restore the type attribute of script elements for safe DOM manipulation -function disableScript( elem ) { - elem.type = ( jQuery.find.attr( elem, "type" ) !== null ) + "/" + elem.type; - return elem; -} -function restoreScript( elem ) { - var match = rscriptTypeMasked.exec( elem.type ); - if ( match ) { - elem.type = match[ 1 ]; - } else { - elem.removeAttribute( "type" ); - } - return elem; -} - -function cloneCopyEvent( src, dest ) { - if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { - return; - } - - var type, i, l, - oldData = jQuery._data( src ), - curData = jQuery._data( dest, oldData ), - events = oldData.events; - - if ( events ) { - delete curData.handle; - curData.events = {}; - - for ( type in events ) { - for ( i = 0, l = events[ type ].length; i < l; i++ ) { - jQuery.event.add( dest, type, events[ type ][ i ] ); - } - } - } - - // make the cloned public data object a copy from the original - if ( curData.data ) { - curData.data = jQuery.extend( {}, curData.data ); - } -} - -function fixCloneNodeIssues( src, dest ) { - var nodeName, e, data; - - // We do not need to do anything for non-Elements - if ( dest.nodeType !== 1 ) { - return; - } - - nodeName = dest.nodeName.toLowerCase(); - - // IE6-8 copies events bound via attachEvent when using cloneNode. - if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { - data = jQuery._data( dest ); - - for ( e in data.events ) { - jQuery.removeEvent( dest, e, data.handle ); - } - - // Event data gets referenced instead of copied if the expando gets copied too - dest.removeAttribute( jQuery.expando ); - } - - // IE blanks contents when cloning scripts, and tries to evaluate newly-set text - if ( nodeName === "script" && dest.text !== src.text ) { - disableScript( dest ).text = src.text; - restoreScript( dest ); - - // IE6-10 improperly clones children of object elements using classid. - // IE10 throws NoModificationAllowedError if parent is null, #12132. - } else if ( nodeName === "object" ) { - if ( dest.parentNode ) { - dest.outerHTML = src.outerHTML; - } - - // This path appears unavoidable for IE9. When cloning an object - // element in IE9, the outerHTML strategy above is not sufficient. - // If the src has innerHTML and the destination does not, - // copy the src.innerHTML into the dest.innerHTML. #10324 - if ( support.html5Clone && ( src.innerHTML && !jQuery.trim( dest.innerHTML ) ) ) { - dest.innerHTML = src.innerHTML; - } - - } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { - - // IE6-8 fails to persist the checked state of a cloned checkbox - // or radio button. Worse, IE6-7 fail to give the cloned element - // a checked appearance if the defaultChecked value isn't also set - - dest.defaultChecked = dest.checked = src.checked; - - // IE6-7 get confused and end up setting the value of a cloned - // checkbox/radio button to an empty string instead of "on" - if ( dest.value !== src.value ) { - dest.value = src.value; - } - - // IE6-8 fails to return the selected option to the default selected - // state when cloning options - } else if ( nodeName === "option" ) { - dest.defaultSelected = dest.selected = src.defaultSelected; - - // IE6-8 fails to set the defaultValue to the correct value when - // cloning other types of input fields - } else if ( nodeName === "input" || nodeName === "textarea" ) { - dest.defaultValue = src.defaultValue; - } -} - -function domManip( collection, args, callback, ignored ) { - - // Flatten any nested arrays - args = concat.apply( [], args ); - - var first, node, hasScripts, - scripts, doc, fragment, - i = 0, - l = collection.length, - 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 collection.each( function( index ) { - var self = collection.eq( index ); - if ( isFunction ) { - 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 (#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.1, PhantomJS<2 - // 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; - - // 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 || "" ) && - !jQuery._data( 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.text || node.textContent || node.innerHTML || "" ) - .replace( rcleanScript, "" ) - ); - } - } - } - } - - // Fix #11809: Avoid leaking memory - fragment = first = null; - } - } - - return collection; -} - -function remove( elem, selector, keepData ) { - var node, - elems = selector ? jQuery.filter( selector, elem ) : elem, - i = 0; - - for ( ; ( node = elems[ i ] ) != null; i++ ) { - - if ( !keepData && node.nodeType === 1 ) { - jQuery.cleanData( getAll( node ) ); - } - - if ( node.parentNode ) { - if ( keepData && jQuery.contains( node.ownerDocument, node ) ) { - setGlobalEval( getAll( node, "script" ) ); - } - node.parentNode.removeChild( node ); - } - } - - return elem; -} - -jQuery.extend( { - htmlPrefilter: function( html ) { - return html.replace( rxhtmlTag, "<$1>" ); - }, - - clone: function( elem, dataAndEvents, deepDataAndEvents ) { - var destElements, node, clone, i, srcElements, - inPage = jQuery.contains( elem.ownerDocument, elem ); - - if ( support.html5Clone || jQuery.isXMLDoc( elem ) || - !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { - - clone = elem.cloneNode( true ); - - // IE<=8 does not properly clone detached, unknown element nodes - } else { - fragmentDiv.innerHTML = elem.outerHTML; - fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); - } - - if ( ( !support.noCloneEvent || !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 - destElements = getAll( clone ); - srcElements = getAll( elem ); - - // Fix all IE cloning issues - for ( i = 0; ( node = srcElements[ i ] ) != null; ++i ) { - - // Ensure that the destination node is not null; Fixes #9587 - if ( destElements[ i ] ) { - fixCloneNodeIssues( node, destElements[ i ] ); - } - } - } - - // Copy the events from the original to the clone - if ( dataAndEvents ) { - if ( deepDataAndEvents ) { - srcElements = srcElements || getAll( elem ); - destElements = destElements || getAll( clone ); - - for ( i = 0; ( node = srcElements[ i ] ) != null; i++ ) { - cloneCopyEvent( node, destElements[ i ] ); - } - } else { - cloneCopyEvent( elem, clone ); - } - } - - // Preserve script evaluation history - destElements = getAll( clone, "script" ); - if ( destElements.length > 0 ) { - setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); - } - - destElements = srcElements = node = null; - - // Return the cloned set - return clone; - }, - - cleanData: function( elems, /* internal */ forceAcceptData ) { - var elem, type, id, data, - i = 0, - internalKey = jQuery.expando, - cache = jQuery.cache, - attributes = support.attributes, - special = jQuery.event.special; - - for ( ; ( elem = elems[ i ] ) != null; i++ ) { - if ( forceAcceptData || acceptData( elem ) ) { - - id = elem[ internalKey ]; - data = id && cache[ id ]; - - if ( data ) { - if ( data.events ) { - for ( type in data.events ) { - if ( special[ type ] ) { - jQuery.event.remove( elem, type ); - - // This is a shortcut to avoid jQuery.event.remove's overhead - } else { - jQuery.removeEvent( elem, type, data.handle ); - } - } - } - - // Remove cache only if it was not already removed by jQuery.event.remove - if ( cache[ id ] ) { - - delete cache[ id ]; - - // Support: IE<9 - // IE does not allow us to delete expando properties from nodes - // IE creates expando attributes along with the property - // IE does not have a removeAttribute function on Document nodes - if ( !attributes && typeof elem.removeAttribute !== "undefined" ) { - elem.removeAttribute( internalKey ); - - // Webkit & Blink performance suffers when deleting properties - // from DOM nodes, so set to undefined instead - // https://code.google.com/p/chromium/issues/detail?id=378607 - } else { - elem[ internalKey ] = undefined; - } - - deletedIds.push( id ); - } - } - } - } - } -} ); - -jQuery.fn.extend( { - - // Keep domManip exposed until 3.0 (gh-2225) - domManip: domManip, - - detach: function( selector ) { - return remove( this, selector, true ); - }, - - remove: function( selector ) { - return remove( this, selector ); - }, - - text: function( value ) { - return access( this, function( value ) { - return value === undefined ? - jQuery.text( this ) : - this.empty().append( - ( this[ 0 ] && this[ 0 ].ownerDocument || document ).createTextNode( value ) - ); - }, null, value, arguments.length ); - }, - - append: function() { - 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 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 domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this ); - } - } ); - }, - - after: function() { - return domManip( this, arguments, function( elem ) { - if ( this.parentNode ) { - this.parentNode.insertBefore( elem, this.nextSibling ); - } - } ); - }, - - empty: function() { - var elem, - i = 0; - - for ( ; ( elem = this[ i ] ) != null; i++ ) { - - // Remove element nodes and prevent memory leaks - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - } - - // Remove any remaining nodes - while ( elem.firstChild ) { - elem.removeChild( elem.firstChild ); - } - - // If this is a select, ensure that it displays empty (#12336) - // Support: IE<9 - if ( elem.options && jQuery.nodeName( elem, "select" ) ) { - elem.options.length = 0; - } - } - - return this; - }, - - clone: function( dataAndEvents, deepDataAndEvents ) { - dataAndEvents = dataAndEvents == null ? false : dataAndEvents; - deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; - - return this.map( function() { - return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); - } ); - }, - - html: function( value ) { - return access( this, function( value ) { - var elem = this[ 0 ] || {}, - i = 0, - l = this.length; - - if ( value === undefined ) { - return elem.nodeType === 1 ? - elem.innerHTML.replace( rinlinejQuery, "" ) : - undefined; - } - - // See if we can take a shortcut and just use innerHTML - if ( typeof value === "string" && !rnoInnerhtml.test( value ) && - ( support.htmlSerialize || !rnoshimcache.test( value ) ) && - ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && - !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { - - value = jQuery.htmlPrefilter( value ); - - try { - for ( ; i < l; i++ ) { - - // Remove element nodes and prevent memory leaks - elem = this[ i ] || {}; - if ( elem.nodeType === 1 ) { - jQuery.cleanData( getAll( elem, false ) ); - elem.innerHTML = value; - } - } - - elem = 0; - - // If using innerHTML throws an exception, use the fallback method - } catch ( e ) {} - } - - if ( elem ) { - this.empty().append( value ); - } - }, null, value, arguments.length ); - }, - - replaceWith: function() { - var ignored = []; - - // Make the changes, replacing each non-ignored context element with the new content - return domManip( this, arguments, function( elem ) { - var parent = this.parentNode; - - if ( jQuery.inArray( this, ignored ) < 0 ) { - jQuery.cleanData( getAll( this ) ); - if ( parent ) { - parent.replaceChild( elem, this ); - } - } - - // Force callback invocation - }, ignored ); - } -} ); - -jQuery.each( { - appendTo: "append", - prependTo: "prepend", - insertBefore: "before", - insertAfter: "after", - replaceAll: "replaceWith" -}, function( name, original ) { - jQuery.fn[ name ] = function( selector ) { - var elems, - i = 0, - ret = [], - insert = jQuery( selector ), - last = insert.length - 1; - - for ( ; i <= last; i++ ) { - elems = i === last ? this : this.clone( true ); - jQuery( insert[ i ] )[ original ]( elems ); - - // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() - push.apply( ret, elems.get() ); - } - - return this.pushStack( ret ); - }; -} ); - - -var iframe, - elemdisplay = { - - // Support: Firefox - // We have to pre-define these values for FF (#10227) - HTML: "block", - BODY: "block" - }; - -/** - * 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 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), - - 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( "